/* FDES Meeting Translator.
   Warm paper background, editorial serif headings, hairline rules — with the
   FDES navy and green carrying every accent so the product reads as ours. */
:root {
  --bone:        #f0eee6;   /* page */
  --surface:     #faf9f5;   /* raised card */
  --surface-alt: #ebe7db;   /* inset: link fields, meta strips */
  --ink:         #1a1a18;   /* body copy */
  --ink-soft:    #3f3e39;
  --muted:       #78766f;
  --line:        #dcd8cc;
  --line-strong: #c8c3b4;

  --navy:        #1e3a5c;   /* brand: headings, primary actions */
  --navy-deep:   #16293f;
  --sidebar:     #1a3350;   /* console rail, a shade under the brand navy */
  --navy-tint:   rgba(30, 58, 92, .07);
  --green:       #8bc53f;   /* brand: live indicators, pulse — never text */
  --green-deep:  #4e8523;   /* brand green dark enough to carry white text */
  --danger:      #a4442f;

  --bar:       #e6e1d3;   /* app bar: a deeper tone of the page, not a tint */
  --bar-line:  #cdc7b6;

  --radius:    12px;
  --radius-sm: 8px;
  --bar-h:     70px;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI",
          "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", "Malgun Gothic", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }
h1 { font-size: 27px; line-height: 1.2; }
h2 { font-size: 15px; }

.display {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--navy);
}

a { color: var(--navy); text-decoration: underline; text-underline-offset: 3px;
    text-decoration-color: var(--line-strong); }
a:hover { text-decoration-color: var(--navy); }

.muted { color: var(--muted); font-size: 13px; }
.error-text { color: var(--danger); font-size: 14px; min-height: 20px; margin: 12px 0 0; }

/* !important: the .room/.chips display rules would otherwise defeat the
   hidden attribute that gates the pre-join view. */
[hidden] { display: none !important; }

/* ------------------------------------------------------------- app shell */

.app-bar {
  position: sticky; top: 0; z-index: 20;
  height: var(--bar-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 0 24px;
  background: rgba(230, 225, 211, .94);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--bar-line);
}
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 38px; width: auto; display: block; }
.brand-sep { width: 1px; height: 26px; background: var(--line-strong); }
.brand-name {
  font-size: 15px; font-weight: 500; color: var(--ink-soft);
  letter-spacing: -0.01em; white-space: nowrap;
}
.app-bar-actions { display: flex; align-items: center; gap: 14px; }
.app-bar-actions .who { font-size: 13px; color: var(--muted); }

.app-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  max-width: 1120px; margin: 0 auto; padding: 24px;
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}

.page   { max-width: 1120px; margin: 0 auto; padding: 36px 24px 56px; }
.narrow { max-width: 430px; margin: 0 auto; padding: 0 20px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

/* Centred, branded entry screens: sign-in and the guest join card. */
.auth { display: flex; flex-direction: column; align-items: center;
        gap: 22px; padding: 9vh 20px 40px; }
.auth .card, .auth .narrow { width: 100%; max-width: 430px; }
.auth-logo { height: 44px; width: auto; }
.auth-note { text-align: center; }

/* ----------------------------------------------------------------- forms */

label {
  display: block;
  font-size: 11px; font-weight: 500; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--muted);
  margin: 16px 0 6px;
}

input, select {
  width: 100%; padding: 10px 12px;
  font: inherit; font-size: 15px; color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #aaa69c; }
input:hover, select:hover { border-color: #b3ad9c; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
  border-color: transparent;
}

button {
  font: inherit; font-size: 14px; font-weight: 500;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: transparent; color: var(--ink);
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
button:hover:not(:disabled) { background: var(--navy-tint); border-color: #b3ad9c; }

button.primary {
  background: var(--navy); border-color: var(--navy); color: #fff;
}
button.primary:hover:not(:disabled) {
  background: var(--navy-deep); border-color: var(--navy-deep);
}

button.danger { border-color: var(--line-strong); color: var(--danger); }
button.danger:hover:not(:disabled) {
  background: rgba(164, 68, 47, .07); border-color: var(--danger);
}

button.danger-solid {
  background: var(--danger); border-color: var(--danger); color: #fff;
}
button.danger-solid:hover:not(:disabled) {
  background: #8c3927; border-color: #8c3927;
}

button:disabled { opacity: .45; cursor: default; }

/* ------------------------------------------------- console shell (sidebar) */

/* The console fills the viewport and never scrolls as a whole — only the
   meetings list does, so the header, stats and tabs stay put. */
.app {
  display: grid; grid-template-columns: 250px 1fr;
  height: 100vh; overflow: hidden;
  transition: grid-template-columns .22s ease;
}
.app.collapsed { grid-template-columns: 74px 1fr; }

.sidebar {
  height: 100vh; overflow: hidden;
  display: flex; flex-direction: column;
  padding: 22px 16px 16px;
  background: var(--sidebar);
  color: rgba(255, 255, 255, .82);
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 0 6px 22px; }
.side-toggle {
  margin-left: auto; flex: none; padding: 7px;
  border: none; border-radius: 6px; background: transparent;
  color: rgba(255, 255, 255, .72);
}
.side-toggle:hover:not(:disabled) {
  background: rgba(255, 255, 255, .12); color: #fff;
}

/* Collapsed: icons only, everything centred. */
.app.collapsed .sidebar { padding: 22px 10px 16px; }
.app.collapsed .side-brand {
  flex-direction: column; gap: 12px; padding: 0 0 20px;
}
.app.collapsed .side-toggle { margin: 0; }
.app.collapsed .side-product,
.app.collapsed .nav-label,
.app.collapsed .side-user { display: none; }
.app.collapsed .nav-item { justify-content: center; gap: 0; padding: 11px 0; }
.app.collapsed .side-foot { flex-direction: column; gap: 10px; }
/* The wordmark is navy: it needs a light plate to sit on, not a dark one. */
.logo-chip {
  display: inline-flex; padding: 7px 9px; border-radius: 9px; background: #fff;
}
.logo-chip img { height: 22px; width: auto; display: block; }
.side-product {
  font-size: 13px; font-weight: 500; line-height: 1.25; color: #fff;
  letter-spacing: -0.01em;
}

.side-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; font-size: 14px; font-weight: 500; text-align: left;
  color: rgba(255, 255, 255, .74);
  background: transparent; border: none; border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-item:hover:not(:disabled) { background: rgba(255, 255, 255, .09); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, .15); color: #fff; }
.nav-item svg { flex: none; opacity: .9; }

.side-foot {
  margin-top: auto; display: flex; align-items: center; gap: 11px;
  padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .14);
}
.avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .16); color: #fff;
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
}
.side-user { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.side-user-name {
  font-size: 13px; color: #fff; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.side-user-role { font-size: 11px; color: rgba(255, 255, 255, .55); }
.side-signout {
  flex: none; padding: 7px; border: none; background: transparent;
  color: rgba(255, 255, 255, .7); border-radius: 6px;
}
.side-signout:hover:not(:disabled) {
  background: rgba(255, 255, 255, .12); color: #fff;
}

.main {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  padding: 26px 32px 0;
}
.main > .main-head, .main > .stats, .main > .tabs { flex: none; }
/* The only scroll region on the page. */
#meetings { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 28px; }

.main-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 22px;
}
.page-title { font-size: 26px; }
.main-head .muted { margin: 3px 0 0; }
.head-actions { display: flex; align-items: center; gap: 10px; }
.search {
  width: 240px; padding: 9px 13px; font-size: 14px;
  border-radius: var(--radius-sm); background: var(--surface);
}

/* Stat tiles — the numbers that make it read as a system, not a list. */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 26px;
}
.stat {
  padding: 16px 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.stat-label {
  font-size: 11px; font-weight: 500; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted);
}
.stat-value {
  margin-top: 5px; font-size: 25px; font-weight: 600; color: var(--navy);
  letter-spacing: -0.02em; line-height: 1.1;
}
.stat-value .unit { font-size: 13px; font-weight: 500; color: var(--muted); }
.stat.is-live .stat-value { color: var(--green-deep); }

.tabs {
  display: flex; gap: 4px; margin-bottom: 2px;
  border-bottom: 1px solid var(--line);
}
.tab {
  padding: 9px 15px; font-size: 14px; font-weight: 500; color: var(--muted);
  background: transparent; border: none; border-bottom: 2px solid transparent;
  border-radius: 0; cursor: pointer;
}
.tab:hover:not(:disabled) { background: var(--navy-tint); color: var(--ink); }
.tab.active { color: var(--navy); border-bottom-color: var(--navy); }
.tab .tab-count { color: var(--muted); font-weight: 400; margin-left: 5px; }

/* Data table */
.mtable { width: 100%; border-collapse: collapse; }
.mtable th {
  position: sticky; top: 0; z-index: 2;
  padding: 12px 14px; text-align: left; white-space: nowrap;
  font-size: 11px; font-weight: 500; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted);
  background: var(--bone);
  border-bottom: 1px solid var(--line);
}
.mtable td {
  padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle;
}
.mtable tbody tr:hover { background: rgba(30, 58, 92, .035); }
.mtable tr.expanded { background: rgba(30, 58, 92, .05); }
.mtable td.num { text-align: right; font-variant-numeric: tabular-nums; }
.mtable td.actions { text-align: right; white-space: nowrap; }
.mtable td.actions > * { vertical-align: middle; }
.mtable .actions .menu { display: inline-block; margin-left: 6px; }

.cell-title {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--serif); font-size: 17px; font-weight: 500;
  color: var(--navy); letter-spacing: -0.01em;
}
.cell-people { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.chev {
  flex: none; width: 20px; height: 20px; padding: 0; border: none;
  background: transparent; color: var(--muted); font-size: 10px;
  transition: transform .15s;
}
tr.expanded .chev { transform: rotate(90deg); }
.cell-when { font-size: 13.5px; white-space: nowrap; }
.cell-sub { font-size: 12px; color: var(--muted); }

.detail-cell { padding: 0 14px 18px !important; background: rgba(30, 58, 92, .05); }
.detail-box {
  padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.detail-head {
  font-size: 11px; font-weight: 500; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 4px;
}

/* ------------------------------------------------------------- dashboard */

.toolbar {
  display: flex; gap: 16px; align-items: center; justify-content: space-between;
  padding-bottom: 20px; margin-bottom: 28px; border-bottom: 1px solid var(--line);
}
.toolbar .muted { margin: 2px 0 0; }

.section { margin-bottom: 34px; }
.section-head {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
  margin: 0 0 12px;
}
.section-count {
  font-size: 11px; letter-spacing: 0; padding: 1px 8px; border-radius: 999px;
  background: var(--surface-alt); color: var(--ink-soft);
}

.meeting { margin-bottom: 14px; padding: 22px 26px; }
.meeting-head .when { margin-left: auto; white-space: nowrap; }
.meta-line {
  margin-top: 8px; font-size: 13px; color: var(--muted);
}

.join-state { font-size: 13px; color: var(--muted); }
.join-state.on { color: var(--green-deep); font-weight: 500; }

.add-invite {
  margin-top: 12px; padding: 7px 14px; font-size: 13px;
  border-style: dashed; color: var(--ink-soft);
}

button.quiet, .quiet-link {
  padding: 6px 13px; font-size: 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: transparent;
  color: var(--ink-soft); text-decoration: none; white-space: nowrap;
}
.quiet-link:hover { background: var(--navy-tint); text-decoration: none; }

/* Finished meetings: one line each, so history recedes behind live work. */
.past-row {
  display: flex; align-items: center; gap: 16px;
  padding: 15px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.past-main { flex: 1; min-width: 0; }
.past-title {
  display: block; font-family: var(--serif); font-size: 17px; font-weight: 500;
  color: var(--navy); letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.past-meta {
  display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.past-when { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* Overflow menu: <details> gives open/close without extra state. */
.menu { position: relative; }
.menu-btn {
  list-style: none; cursor: pointer;
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: 1px solid transparent;
  display: flex; align-items: center; justify-content: center;
}
.menu-btn::-webkit-details-marker { display: none; }
.menu-btn::after {
  content: "•••"; font-size: 11px; letter-spacing: 1px; color: var(--muted);
}
.menu-btn:hover { background: var(--navy-tint); border-color: var(--line); }
.menu[open] .menu-btn { background: var(--navy-tint); border-color: var(--line); }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 170px; padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 30px rgba(22, 25, 31, .16);
}
.menu-item {
  display: block; width: 100%; text-align: left;
  padding: 8px 12px; font-size: 14px;
  border: none; border-radius: 6px; background: transparent;
}
.menu-item:hover:not(:disabled) { background: var(--navy-tint); }
.menu-item.danger-text { color: var(--danger); }
.menu-item.danger-text:hover { background: rgba(164, 68, 47, .08); }

.empty-state {
  padding: 64px 24px; text-align: center;
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
}
.empty-title { margin: 0 0 6px; font-family: var(--serif); font-size: 20px;
               color: var(--navy); }
.empty-state .muted { margin: 0; }

.meeting-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.meeting-head .title {
  font-family: var(--serif); font-size: 21px; font-weight: 500;
  letter-spacing: -0.015em; color: var(--navy);
  flex: 1; min-width: 180px;
}

.badge {
  font-size: 11px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; white-space: nowrap;
  padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--muted);
}
.badge.live, .badge.active {
  border-color: var(--green-deep); color: var(--green-deep);
  background: rgba(139, 197, 63, .14);
}
.badge.live::before {
  content: "●"; margin-right: 6px; font-size: 8px; vertical-align: 1px;
  animation: live-blink 2s ease-in-out infinite;
}
@keyframes live-blink { 50% { opacity: .35; } }
.badge.scheduled { border-color: var(--line-strong); color: var(--ink-soft); }
.badge.ended { border-color: var(--line); color: #9d998f; }

.invites { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 4px; }
.invite-row {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.invite-row:last-child { border-bottom: none; }
.invite-row .who { min-width: 150px; font-weight: 500; }
.invite-row input.link {
  flex: 1; min-width: 240px; font-size: 13px; color: var(--ink-soft);
  background: var(--surface-alt); border-color: transparent; padding: 8px 12px;
}
.row-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.row-form > div { flex: 1; min-width: 140px; }
.row-form label { margin-top: 0; }

/* ------------------------------------------------------------------ room */

.room {
  display: flex; flex-direction: column; height: 100vh;
  max-width: 1400px; margin: 0 auto; padding: 14px 24px 12px;
}

.room-head {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.room-logo { height: 30px; width: auto; }
.room-head .brand-sep { height: 24px; }
.room-head .title {
  font-family: var(--serif); font-size: 21px; font-weight: 500;
  letter-spacing: -0.015em; color: var(--navy); flex: 1; min-width: 120px;
}

.dot { font-size: 12px; letter-spacing: 0.03em; color: var(--muted); }
.dot::before { content: "●"; margin-right: 6px; font-size: 9px; vertical-align: 1px; }
.dot.connected::before    { color: var(--green-deep); }
.dot.reconnecting::before { color: #c08a2e; }
.dot.off::before          { color: var(--line-strong); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 2px; }
.chip {
  font-size: 13px; padding: 5px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
}
.chip::before { content: "●"; margin-right: 7px; font-size: 8px;
                vertical-align: 1px; color: var(--line-strong); }
.chip.online::before  { color: var(--green-deep); }
.chip.offline::before { color: #c08a2e; }
.chip.yet_to_join { color: var(--muted); }

.room-grid {
  flex: 1; display: grid; grid-template-columns: 1fr 330px 1fr;
  gap: 20px; min-height: 0; padding-top: 12px;
}
.lang-col { display: flex; flex-direction: column; min-height: 0; }
.lang-col h2 {
  font-size: 11px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
  margin: 0 0 9px; text-align: center;
}

.messages {
  flex: 1; overflow-y: auto; padding: 4px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
#col-en:empty::before {
  content: "Messages appear here as people speak.";
  display: block; padding: 44px 8px; text-align: center;
  color: var(--muted); font-size: 13px;
}
#col-ko:empty::before {
  content: "대화 내용이 여기에 표시됩니다.";
  display: block; padding: 44px 8px; text-align: center;
  color: var(--muted); font-size: 13px;
}
.msg { padding: 14px 0; border-bottom: 1px solid var(--line); }
.msg:last-child { border-bottom: none; }
.msg .who { font-weight: 600; color: var(--navy); margin-right: 2px; }
.msg time { display: block; margin-top: 5px; font-size: 11px;
            letter-spacing: 0.05em; color: #9d998f; }

.center-col { display: flex; flex-direction: column; align-items: center; gap: 20px; }

.status-card {
  width: 100%; min-height: 106px; padding: 22px 18px;
  display: flex; align-items: center; justify-content: center;
  text-align: center; white-space: pre-line;
  font-family: var(--serif); font-size: 20px; font-weight: 500;
  letter-spacing: -0.01em; line-height: 1.35;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .2s, color .2s;
}
.status-idle { color: var(--navy); }
.status-mine { color: var(--green-deep); border-color: var(--green); }
.status-busy { color: var(--ink-soft); }
.status-peer { color: var(--navy); border-color: var(--line-strong); }
.status-off  { color: var(--muted); }

.talk-btn {
  width: 118px; height: 118px; border-radius: 50%;
  border: none; background: var(--navy); color: #fff;
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em; line-height: 1.5;
  user-select: none; -webkit-user-select: none; touch-action: none;
  transition: background .15s, transform .1s;
}
.talk-btn:hover:not(:disabled)  { background: var(--navy-deep); }
.talk-btn:active:not(:disabled) { transform: scale(.97); }
.talk-btn.recording {
  background: var(--green-deep); animation: pulse 1.4s ease-out infinite;
}
.talk-btn:disabled {
  background: transparent; color: var(--muted);
  border: 1px dashed var(--line-strong); opacity: 1;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(139, 197, 63, .45); }
  100% { box-shadow: 0 0 0 22px rgba(139, 197, 63, 0); }
}
.talk-hint { text-align: center; font-size: 13px; color: var(--muted); margin: 0; }
.talk-hint kbd {
  font: inherit; font-weight: 600; color: var(--ink-soft);
  background: var(--surface-alt); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px;
}

.room-foot {
  display: flex; justify-content: center;
  padding: 14px 0 2px; margin-top: 10px; border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------------- shared */

/* Confirmation dialog (replaces the browser's confirm box). */
.modal {
  padding: 0; border: none; background: transparent;
  width: calc(100% - 40px); max-width: 450px;
  color: var(--ink);
}
.modal::backdrop { background: rgba(22, 25, 31, .46); }
.modal[open] { animation: modal-in .16s ease-out; }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(-8px) scale(.985); }
}
.modal-inner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px 22px;
  box-shadow: 0 20px 56px rgba(22, 25, 31, .26);
}
.modal-title { font-size: 22px; margin: 0 0 10px; }
.modal-body {
  margin: 0 0 24px; font-size: 14px; line-height: 1.6; color: var(--ink-soft);
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

.toast {
  position: fixed; bottom: 28px; right: 28px; max-width: 340px;
  padding: 12px 20px; border-radius: var(--radius-sm);
  background: var(--ink); color: #fff; font-size: 14px;
  opacity: 0; transform: translateY(6px);
  transition: opacity .2s, transform .2s;
  pointer-events: none; z-index: 50;
}
.toast.show { opacity: 1; transform: translateY(0); }

.center-note { text-align: center; padding: 12vh 20px 40px; }
.center-note .auth-logo { margin-bottom: 22px; }

@media (max-width: 1000px) {
  .app, .app.collapsed {
    grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: 100vh;
  }
  .sidebar, .app.collapsed .sidebar {
    height: auto; flex-direction: row; align-items: center;
    gap: 14px; padding: 10px 14px; flex-wrap: wrap;
  }
  .side-toggle { display: none; }        /* nothing to collapse in a strip */
  .app.collapsed .side-brand { flex-direction: row; padding: 0; }
  .app.collapsed .nav-label { display: inline; }
  .app.collapsed .nav-item { padding: 10px 12px; gap: 11px; }
  .app.collapsed .side-foot { flex-direction: row; }
  .side-brand { padding: 0; }
  .side-product { display: none; }
  .side-nav { flex-direction: row; }
  .side-foot { margin: 0 0 0 auto; padding-top: 0; border-top: none; }
  .side-user { display: none; }
  .main { padding: 20px 16px 40px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .search { width: 160px; }
}

@media (max-width: 900px) {
  .app-bar { padding: 0 16px; }
  .brand-name { display: none; }
  .brand-sep  { display: none; }
  .room { height: auto; min-height: 100vh; padding: 12px 16px; }
  .room-grid { grid-template-columns: 1fr; }
  .center-col { order: -1; padding: 6px 0 2px; }
  .messages { max-height: 40vh; }
  .page { padding: 26px 16px 44px; }
}
