/* NiftyRoundTable app (behind the sign-in). Same tokens as the public pages. */
body { font-size: 15px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--link); }

.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 18px 14px; border-right: 1px solid var(--line); background: var(--card); }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; color: var(--ink); text-decoration: none; font: 800 18px var(--display); letter-spacing: -.02em; }
.side .brand svg { width: 26px; height: 26px; }
.table-name { margin: 0 8px 10px; font-size: 12px; color: var(--slate); }
.nav-i { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--slate); text-decoration: none; font-weight: 600; font-size: 14px; }
.nav-i:hover { background: var(--well); color: var(--ink); }
.nav-i.on { background: var(--well); color: var(--ink); }
.nav-i .count { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 99px; background: var(--amber); color: var(--on-amber); font-size: 12px; text-align: center; }
.side .grow { flex: 1; }
.stop { display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border: 0; border-radius: 999px; background: #C8402F; color: #fff; font-weight: 700; cursor: pointer; }
.stop.resume { background: var(--teal); color: var(--ink); }
.me { display: flex; align-items: center; gap: 10px; padding: 10px 8px 0; font-size: 13px; color: var(--slate); }
.me button { margin-left: auto; border: 0; background: none; color: var(--link); text-decoration: underline; cursor: pointer; font-size: 13px; }

.main { min-width: 0; padding: 28px clamp(16px, 4vw, 40px) 80px; }
.main-in { max-width: 920px; margin: 0 auto; }
.top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.top h1 { margin: 0; font: 800 30px/1.1 var(--display); letter-spacing: -.02em; }
.top .sub { width: 100%; margin: 0; color: var(--slate); }
.top .spacer { flex: 1; }

.banner { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--slate); font-size: 13px; }
.banner::before { content: ""; flex: 0 0 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.banner.stopped { background: #FBE3DF; color: #9A2E22; border-color: #F1B9AF; }
.banner.stopped::before { background: #C8402F; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--amber); color: var(--on-amber); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--amber-hover); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn.ghost:hover { background: var(--well); }
.btn.dark { background: var(--deep); color: var(--paper); }
.btn.danger { background: transparent; border: 1px solid #E0A196; color: #B03A2A; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }

.card { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.muted { color: var(--slate); }
.small { font-size: 13px; }
.empty { padding: 28px; text-align: center; border: 1px dashed var(--line); border-radius: 14px; color: var(--slate); }

.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); background: var(--well); color: var(--slate); }
.pill.ok { background: var(--mint); color: var(--mint-ink); border-color: transparent; }
.pill.wait { background: var(--peach); color: var(--peach-ink); border-color: transparent; }
.pill.no { background: #FBE3DF; color: #9A2E22; border-color: transparent; }

.av { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 800 14px var(--display); }
.av.lg { width: 48px; height: 48px; font-size: 18px; }
.c-amber { background: linear-gradient(160deg, #F7B94A, #E08A12); color: var(--ink); }
.c-teal { background: linear-gradient(160deg, #6FD5C4, #2E9E8C); color: var(--ink); }
.c-slate { background: linear-gradient(160deg, #8C95AE, #5A6480); }
.c-indigo { background: linear-gradient(160deg, #3A4A7A, #1C2846); }
.c-rose { background: linear-gradient(160deg, #F0A6A0, #C8605A); }
.c-sage { background: linear-gradient(160deg, #A9C9A4, #5F8D5A); }
.c-you { background: var(--ink); color: var(--bg); }

/* Threads */
.thread-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); text-decoration: none; }
.thread-row:hover { border-color: var(--amber); }
.thread-row .t { font-weight: 700; }
.thread-row .m { font-size: 13px; color: var(--slate); }
.thread-row .r { margin-left: auto; display: flex; gap: 6px; align-items: center; }

.composer { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.composer textarea, .field input, .field select, .field textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--field); outline: none; resize: vertical; }
.composer textarea:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(245, 165, 36, .2); }
.composer .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 600; }
.field .hint { font-size: 12px; color: var(--slate); }
.inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline .field { flex: 1 1 160px; }

.msgs { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.msg { display: flex; gap: 12px; }
.msg .body { min-width: 0; flex: 1; }
.msg .who { font-weight: 700; font-size: 14px; }
.msg .who span { font-weight: 400; color: var(--slate); font-size: 12px; margin-left: 6px; }
.msg .txt { margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.sys .txt { color: var(--slate); font-size: 13px; font-style: italic; }
.okcard { margin-top: 8px; padding: 14px; border-radius: 14px; border: 1.5px solid var(--amber); background: var(--peach); color: var(--ink); }
.okcard h4 { margin: 0 0 4px; font: 700 15px var(--display); }
.okcard .act { margin: 6px 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--card); font-size: 14px; white-space: pre-wrap; }
.okcard .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.okcard.done { border-color: var(--line); background: var(--card); }
.typing { color: var(--slate); font-size: 13px; }

/* Agents */
.seat { display: flex; gap: 12px; align-items: flex-start; }
.seat .info { flex: 1; min-width: 0; }
.seat .name { font-weight: 700; }
.seat .meta { font-size: 13px; color: var(--slate); }
.seat .acts { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* Modal */
.modal-bg { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(16, 22, 43, .45); }
.modal { width: 560px; max-width: 100%; max-height: calc(100vh - 32px); overflow: auto; padding: 24px; border-radius: 20px; background: var(--card); box-shadow: 0 20px 60px rgba(16, 22, 43, .3); }
.modal h2 { margin: 0 0 4px; font: 800 22px var(--display); }
.steps-bar { display: flex; gap: 6px; margin: 12px 0 18px; }
.steps-bar span { flex: 1; height: 4px; border-radius: 4px; background: var(--well); }
.steps-bar span.on { background: var(--amber); }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); text-align: left; cursor: pointer; }
.choice:hover { border-color: var(--amber); }
.choice.on { border-color: var(--amber); background: var(--peach); }
.choice b { font-size: 14px; }
.choice small { color: var(--slate); font-size: 12px; line-height: 1.35; }
.chars { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chars button { padding: 0; border: 3px solid transparent; border-radius: 50%; background: none; cursor: pointer; }
.chars button.on { border-color: var(--amber); }
.keybox { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); font: 13px ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.keybox code { flex: 1; }
.modal .foot-row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translateX(-50%); padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 14px; box-shadow: 0 8px 24px rgba(16, 22, 43, .3); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { font-size: 12px; color: var(--slate); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.section-h { margin: 26px 0 10px; font: 700 18px var(--display); }
.bar { height: 8px; border-radius: 8px; background: var(--well); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--teal); }

/* Phone: sidebar becomes a top bar + bottom tabs */
.mtop { display: none; }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 30; height: auto; flex-direction: row; justify-content: space-around; gap: 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); }
  .side .brand, .side .table-name, .side .grow, .side .me, .side .stop { display: none; }
  .nav-i { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 11px; position: relative; }
  .nav-i .count { position: absolute; top: 0; right: 0; margin: 0; min-width: 16px; padding: 0 5px; font-size: 10px; }
  .mtop { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 20; }
  .mtop .brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font: 800 16px var(--display); }
  .mtop .brand svg { width: 22px; height: 22px; }
  .mtop .stop { margin-left: auto; height: 34px; padding: 0 14px; font-size: 13px; }
  .main { padding-bottom: 96px; }
  .top h1 { font-size: 24px; }
}
