:root {
  font-family:
    -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR",
    sans-serif;
  color: #20272d;
  background: #f8fafb;
  font-size: 14px;
  --line: #e4e8eb;
  --muted: #727e89;
  --blue: #2759ce;
  --soft: #edf3ff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: inherit;
  padding: 9px 13px;
  white-space: nowrap;
}
button:hover {
  background: #f3f6fa;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
button.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
button.primary:hover {
  background: #214aaf;
}
button.quiet {
  border: 0;
  background: transparent;
}
input,
select,
textarea {
  border: 1px solid #dce2e7;
  border-radius: 6px;
  background: white;
  color: inherit;
  padding: 10px 12px;
  max-width: 100%;
}
textarea {
  resize: vertical;
  line-height: 1.8;
  width: 100%;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 24px;
  letter-spacing: -0.8px;
  font-weight: 650;
}
h2 {
  font-size: 17px;
  letter-spacing: -0.4px;
}
h3 {
  font-size: 14px;
}
small,
.muted {
  color: var(--muted);
}
small {
  font-size: 12px;
}
a {
  color: var(--blue);
}
svg {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  flex: none;
}
.shell {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  border-right: 1px solid var(--line);
  background: #f4f6f8;
  padding: 27px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 30px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.brandmark {
  background: #273341;
  color: white;
  width: 29px;
  height: 29px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 18px;
}
.brand small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.8px;
  margin-top: 3px;
}
.navgroup {
  font-size: 11px;
  color: #89949e;
  letter-spacing: 0.5px;
  margin: 20px 12px 8px;
}
.nav {
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  margin: 2px 0;
  color: #55606d;
}
.nav.active {
  background: #e6ecf5;
  color: #234a91;
  font-weight: 650;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 20px 10px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.9;
  color: var(--muted);
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #95a2ae;
  border-radius: 100%;
  margin-right: 6px;
}
.dot.on {
  background: #2a8b6b;
}
.workspace {
  min-width: 0;
}
.topbar {
  height: 66px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.row.spread {
  justify-content: space-between;
}
.page {
  padding: 30px 32px 40px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 25px;
}
.page-heading p {
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.6;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  margin-bottom: 24px;
}
.stat {
  padding: 20px 24px;
  border-right: 1px solid var(--line);
}
.stat:last-child {
  border: 0;
}
.stat strong {
  display: block;
  font-size: 27px;
  font-weight: 600;
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}
.stat span {
  font-size: 12px;
  color: var(--muted);
}
.notice {
  display: flex;
  gap: 10px;
  background: #fff9ec;
  border: 1px solid #efe3c7;
  color: #826326;
  font-size: 12px;
  padding: 12px 15px;
  border-radius: 7px;
  line-height: 1.7;
  margin-bottom: 18px;
}
.notice.info {
  background: #eff4fc;
  border-color: #dbe5f6;
  color: #49638c;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  overflow: hidden;
}
.toolbar {
  display: flex;
  gap: 9px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  flex-wrap: wrap;
}
.toolbar input {
  width: 230px;
  padding: 8px 11px;
}
.toolbar select {
  padding: 8px 11px;
}
.split {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(380px, 1.3fr);
  gap: 20px;
  align-items: start;
}
.list-header {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.item-row {
  display: block;
  width: 100%;
  padding: 17px 19px;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: normal;
}
.item-row:last-child {
  border-bottom: 0;
}
.item-row.selected {
  background: #f0f5ff;
  box-shadow: inset 3px 0 var(--blue);
}
.item-row .title {
  display: block;
  font-weight: 600;
  margin: 9px 0 7px;
  line-height: 1.5;
}
.item-row .preview {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.item-row .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  gap: 6px;
  color: var(--muted);
}
.badge {
  font-size: 11px;
  background: #f0f3f5;
  padding: 3px 7px;
  border-radius: 4px;
  color: #63717c;
  display: inline-block;
  white-space: nowrap;
}
.badge.draft,
.badge.proposed {
  background: #edf2ff;
  color: #3d60af;
}
.badge.new,
.badge.pending {
  background: #edf7f2;
  color: #398064;
}
.badge.failed,
.badge.error,
.badge.needs_review {
  background: #fff2e7;
  color: #a86a2c;
}
.badge.running,
.badge.queued {
  background: #f0effa;
  color: #7763a8;
}
.detail-head {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}
.detail-head h2 {
  margin: 12px 0 8px;
  line-height: 1.5;
}
.detail-body {
  padding: 20px 22px;
}
.label {
  font-size: 11px;
  color: #88929c;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 12px;
}
.source-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.85;
  font-size: 13px;
  max-height: 320px;
  overflow: auto;
}
.divider {
  height: 1px;
  background: var(--line);
  margin: 22px 0;
}
.draft-area {
  min-height: 245px;
  margin: 13px 0 10px;
  font-size: 13px;
}
.draft-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.chat {
  border: 1px solid var(--line);
  border-radius: 7px;
  margin-top: 22px;
  overflow: hidden;
}
.chat-title {
  padding: 12px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
}
.chat-messages {
  padding: 12px 14px;
  max-height: 260px;
  overflow: auto;
}
.bubble {
  line-height: 1.7;
  white-space: pre-wrap;
  font-size: 12px;
  margin-bottom: 12px;
}
.bubble.user {
  background: #f0f4fa;
  padding: 10px 12px;
  border-radius: 6px;
}
.bubble small {
  display: block;
  margin-bottom: 4px;
}
.chat-form {
  padding: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.chat-form textarea {
  min-height: 62px;
  max-height: 170px;
  font-size: 12px;
}
.empty {
  padding: 70px 24px;
  text-align: center;
  color: var(--muted);
  line-height: 1.8;
}
.empty svg {
  width: 30px;
  height: 30px;
  color: #a4afb9;
  margin-bottom: 15px;
}
.empty strong {
  display: block;
  color: #53616f;
  font-size: 14px;
  margin: 0 0 6px;
}
.empty p {
  font-size: 12px;
  max-width: 310px;
  margin: auto;
}
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
}
.pagination button {
  padding: 6px 10px;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
}
th {
  background: #f9fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  padding: 13px 18px;
  white-space: nowrap;
}
td {
  padding: 17px 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.6;
}
td.title-cell {
  font-weight: 600;
  min-width: 200px;
}
td small {
  display: block;
  font-weight: 400;
  margin-top: 4px;
}
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr);
  gap: 22px;
}
.card-content {
  padding: 24px;
}
.field {
  display: block;
  margin-top: 22px;
}
.field > span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}
.field > small {
  display: block;
  margin-top: 7px;
  line-height: 1.6;
}
.field input:not([type="checkbox"]),
.field select {
  width: 100%;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 19px 0;
  border-bottom: 1px solid var(--line);
  gap: 18px;
}
.toggle-row small {
  display: block;
  line-height: 1.6;
  margin-top: 5px;
}
.toggle-row input {
  accent-color: var(--blue);
  width: 18px;
  height: 18px;
}
.connection {
  padding: 17px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.connection:first-child {
  border: 0;
}
.connection small {
  display: block;
  margin-top: 6px;
  line-height: 1.6;
}
.doc-content {
  min-height: 430px;
}
.login {
  max-width: 390px;
  margin: 14vh auto;
  padding: 32px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
}
.login .brand {
  padding-left: 0;
}
.login h1 {
  font-size: 21px;
}
.login p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  margin: 12px 0 25px;
}
.login label {
  font-size: 12px;
}
.login input,
.login button {
  width: 100%;
  margin-top: 10px;
}
.login small {
  display: block;
  line-height: 1.7;
  margin-top: 16px;
}
.boot {
  padding: 20vh 20px;
  text-align: center;
  color: var(--muted);
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: #263442;
  color: white;
  border-radius: 7px;
  box-shadow: 0 5px 25px #0002;
  max-width: 90vw;
  z-index: 20;
  display: none;
  font-size: 13px;
}
.loading {
  opacity: 0.55;
  pointer-events: none;
}
.inline-error {
  color: #ad4e40;
  font-size: 12px;
  margin-top: 10px;
}
.back {
  display: none;
}
.mobile-nav {
  display: none;
}
.source-info {
  font-size: 11px;
  overflow-wrap: anywhere;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 10px;
}
.link-button {
  color: var(--blue);
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  white-space: normal;
}
.history {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.history button {
  font-size: 11px;
  padding: 5px 8px;
}
.flex1 {
  flex: 1;
}
.nowrap {
  white-space: nowrap;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  line-height: 1.8;
  font-size: 12px;
}
.review-list {
  padding-left: 20px;
  line-height: 1.8;
  font-size: 13px;
}
.section-gap {
  margin-top: 22px;
}
@media (min-width: 1600px) {
  .page {
    max-width: 1550px;
    margin: auto;
  }
  .split {
    grid-template-columns: 1fr 1.4fr;
  }
}
@media (max-width: 1150px) {
  .shell {
    grid-template-columns: 182px minmax(0, 1fr);
  }
  .page {
    padding: 24px 20px;
  }
  .topbar {
    padding: 0 20px;
  }
  .split {
    grid-template-columns: minmax(270px, 1fr) minmax(330px, 1.2fr);
    gap: 14px;
  }
  .stat {
    padding: 18px;
  }
  .detail-body,
  .detail-head {
    padding: 17px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 850px) {
  .shell {
    display: block;
  }
  .sidebar {
    display: none;
  }
  .topbar {
    height: 56px;
  }
  .mobile-nav {
    display: block;
    padding: 7px 10px;
    font-size: 12px;
  }
  .page {
    padding: 22px 16px;
  }
  .page-heading {
    align-items: flex-start;
  }
  h1 {
    font-size: 22px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat:nth-child(2) {
    border-right: 0;
  }
  .stat:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
  .stat strong {
    font-size: 23px;
  }
  .split {
    display: block;
  }
  .split.has-detail > .list-panel {
    display: none;
  }
  .split:not(.has-detail) > .detail-panel {
    display: none;
  }
  .back {
    display: block;
  }
  .toolbar {
    padding: 12px;
  }
  .toolbar input {
    width: 100%;
  }
  .detail-panel {
    margin-top: 14px;
  }
  .page-heading button {
    padding: 8px 10px;
    font-size: 12px;
  }
  .row {
    gap: 7px;
  }
  .topbar .breadcrumb {
    display: none;
  }
  .doc-content {
    min-height: 380px;
  }
  .settings-grid {
    display: block;
  }
  .settings-grid > .panel + .panel {
    margin-top: 20px;
  }
  .login {
    margin: 10vh 16px;
    max-width: none;
  }
  .stat {
    padding: 15px 18px;
  }
  .draft-footer {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition: background 0.12s;
  }
  .item-row {
    transition: background 0.12s;
  }
}
@media (max-width: 850px) {
  .topbar {
    height: auto;
    min-height: 56px;
    gap: 10px;
    padding: 10px 16px;
  }
  .topbar > .row {
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .mobile-nav {
    flex-shrink: 0;
    max-width: 135px;
  }
}

.brief-overview, .brief-card { padding: 22px; }
.brief-overview h2, .brief-card h3 { margin: 8px 0 12px; }
.brief-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.brief-card p, .brief-overview p, .brief-reading p { line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.brief-action { background: #f5f7fa; padding: 12px; border-radius: 6px; line-height: 1.6; }
.brief-action strong { margin-right: 8px; }
.original-reading { margin: 18px 0; border-top: 1px solid #e5e7eb; padding-top: 12px; }
.original-reading summary { cursor: pointer; color: #596579; font-size: 13px; }
.original-reading .source-body { margin-top: 12px; max-height: 420px; overflow: auto; }
.category-counts { flex-wrap: wrap; }
.toolbar label { display: flex; align-items: center; gap: 8px; }
.toolbar input[type=checkbox] { width: auto; }
@media (max-width: 1000px) { .brief-cards { grid-template-columns: 1fr; } }

.translation-reading { margin: 16px 0; padding: 16px; background: var(--bg, #f6f8fa); border: 1px solid var(--border, #e4e8ed); border-radius: 8px; }
.translation-reading h4 { margin: 0 0 12px; font-size: 14px; }
.translation-reading small { display: block; margin-top: 12px; color: var(--muted, #64748b); }

.overview-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 24px; }
.overview-section { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.overview-section h2 { font-size: 18px; margin: 0; }
.section-counts { display: grid; grid-template-columns: repeat(4, 1fr); padding: 12px 0; gap: 8px; }
.section-counts strong { display: block; font-size: 24px; }
.section-counts small, .overview-section > small { color: var(--muted, #64748b); }
.section-preview-item { white-space: normal; width: 100%; display: block; text-align: left; border: 0; border-top: 1px solid var(--border, #e4e8ed); padding: 12px 0; background: transparent; border-radius: 0; }
.section-preview-item strong { display: block; margin-bottom: 6px; }
.section-preview-item span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-weight: 400; color: var(--muted, #64748b); line-height: 1.6; }
.section-link { margin-top: auto; align-self: flex-start; }
.section-unavailable { color: var(--muted, #64748b); line-height: 1.8; }
@media (max-width: 900px) { .overview-sections { grid-template-columns: 1fr; } }

.world-clocks { padding: 18px 22px; margin-bottom: 20px; }
.world-clock-heading { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.world-clock-heading h2 { margin: 0; font-size: 14px; }
.world-clocks small, .source-time { color: var(--muted, #64748b); font-size: 12px; font-weight: 400; }
.world-clock-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; }
.world-clock { min-width: 0; }
.world-clock .row { flex-wrap: wrap; gap: 4px 8px; }
.world-clock strong { font-size: 13px; }
.world-clock time { display: block; margin: 5px 0; font-size: 23px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.world-clock > small { display: block; }
.section-preview-item .source-time { display: block; margin-bottom: 5px; line-height: 1.5; }
@media (max-width: 1100px) { .world-clock-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .world-clock-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } .world-clocks { padding: 16px; } }

.operation-overview { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; margin-top: 20px; }
.operation-overview p, .mail-routing p { margin: 8px 0; font-size: 13px; }
.mail-category-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.mail-category-tabs button[aria-pressed=true] { background: var(--text, #25313d); color: white; }
.mail-routing { padding: 14px; background: var(--bg, #f5f7fa); border-radius: 6px; margin-bottom: 20px; }
.mail-routing label { display: flex; align-items: center; gap: 8px; }
.mail-routing small { color: var(--muted, #64748b); }
@media (max-width: 600px) { .operation-overview { align-items: stretch; flex-direction: column; } .mail-routing .row { flex-wrap: wrap; } }

.optional-reply { margin-top: 18px; }
.optional-reply > summary { cursor: pointer; font-size: 13px; font-weight: 600; padding: 12px 0; }

#cli-accounts {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;margin-top:20px}
.cli-account {min-width:0;border-top:1px solid var(--border,#e4e7ec);padding-top:18px}
.cli-account p {overflow-wrap:anywhere}.cli-controls {flex-wrap:wrap}.cli-login-link {display:inline-block;font-weight:600;margin:8px 0}
.cli-model-form {margin-bottom:12px}.cli-account small {display:block;line-height:1.6;color:var(--muted,#667085)}
@media(max-width:900px){#cli-accounts{grid-template-columns:1fr}}

.work-change-confirm { display: block; }
.work-change-confirm p { margin: 10px 0; }

.operator-identity {font-size:12px;text-align:right;line-height:1.4;}
.operator-identity small {display:block;color:var(--muted);}
.access-add {align-items:end;gap:16px;flex-wrap:wrap;margin:16px 0;}
.access-add .field {margin:0;}
.access-add button {margin-bottom:2px;}
#google-login {width:100%;margin-top:12px;}
@media(max-width:700px){.operator-identity{display:none}.access-add .field{width:100%}}
