:root {
  --bg: #f7f5ef;
  --panel: #fffdfa;
  --ink: #1d1a15;
  --muted: #665f56;
  --line: #d8d1c7;
  --accent: #1f6e5a;
  --accent-2: #175647;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 0 0, #fff 0, var(--bg) 45%, #f1ede4 100%);
}

.app {
  width: min(1200px, 94vw);
  margin: 24px auto 60px;
  display: grid;
  gap: 16px;
}

.hero,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  min-width: 0;
  box-shadow: 0 8px 20px rgba(18, 16, 13, 0.04);
}

.hero h1 {
  margin: 0;
  font-family: "IBM Plex Serif", Georgia, serif;
  letter-spacing: 0.2px;
}

.heroTop {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.langBox {
  min-width: 120px;
}

.hero p {
  margin: 8px 0 0;
  color: var(--muted);
}

.health {
  font-size: 14px;
}

h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-bottom: 10px;
}

label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}

input[type="text"] {
  width: min(480px, 80vw);
  height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

select {
  height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

button {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

button.danger {
  border-color: #ad2b2b;
  background: #ad2b2b;
  color: #fff;
}

button:hover {
  filter: brightness(0.97);
}

button:active {
  transform: translateY(1px) scale(0.99);
}

.selected {
  font-size: 14px;
  margin-bottom: 10px;
}

.selectedBar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 10px;
  font-size: 14px;
}

.hint {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.tableWrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

thead {
  background: #f3eee6;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 8px;
  white-space: normal;
  vertical-align: top;
}

td.typeCell {
  font-weight: 600;
}

th:nth-child(2),
td:nth-child(2) {
  width: 170px;
}

th:nth-child(3),
td:nth-child(3) {
  width: 260px;
}

th:nth-child(5),
td:nth-child(5) {
  width: 96px;
}

.sidCell {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.titleCell,
.dirCell {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.updatedCell {
  white-space: nowrap;
}

th:first-child,
td:first-child {
  width: 38px;
  min-width: 38px;
  text-align: center;
}

tr.row-selectable {
  cursor: pointer;
  transition: background-color 0.16s ease, box-shadow 0.16s ease, transform 0.08s ease;
}

tr.row-selectable:hover {
  background: #f8f4ed;
}

tr.row-selectable:active {
  transform: scale(0.997);
  background: #e8f3ef;
}

tr.selectedRow {
  background: #def1ea;
  box-shadow: inset 4px 0 0 var(--accent);
}

tr.rowClicked {
  animation: rowClickPulse 320ms ease;
}

@keyframes rowClickPulse {
  0% {
    background: #d4ece4;
  }
  100% {
    background: transparent;
  }
}

.checkLabel {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
}

.jobBar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.pagerBar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

#pageInfoText,
#paginationCountText {
  font-size: 13px;
  color: var(--muted);
}

.downloadLink {
  color: var(--accent-2);
  text-decoration: underline;
  font-size: 14px;
}

.sessionViewMessages {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  max-height: 420px;
  overflow: auto;
  display: grid;
  gap: 10px;
  background: #faf8f3;
}

.sessionMsg {
  border: 1px solid #e0d8cc;
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}

.sessionMsgMeta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.msgRole {
  font-weight: 700;
  color: var(--ink);
}

.sessionMsgText {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.45;
}

#logBox {
  height: 210px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin: 0;
  background: #121212;
  color: #e8e8e8;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .app {
    width: 96vw;
    margin-top: 12px;
  }

  input[type="text"] {
    width: 92vw;
  }

  .heroTop {
    flex-direction: column;
    align-items: stretch;
  }

  .selectedBar {
    gap: 8px;
    flex-direction: column;
  }

  .pagerBar {
    align-items: stretch;
  }

  th,
  td {
    font-size: 12px;
  }
}
