/* ==========================================================================
   grokcli-2api Admin — Design System
   Based on design.md: light editorial SaaS aesthetic, border-first elevation,
   Inter workhorse type, single electric-blue accent (#2563eb).
   ========================================================================== */

:root {
  /* Colors */
  --color-canvas: #ffffff;
  --color-paper: #f5f5f5;
  --color-ash: #e5e5e5;
  --color-smoke: #d4d4d4;
  --color-pebble: #c8c8c8;
  --color-ink: #0a0a0a;
  --color-charcoal: #171717;
  --color-graphite: #262626;
  --color-slate: #404040;
  --color-steel: #525252;
  --color-fog: #737373;
  --color-silver: #a3a3a3;
  --color-blue: #2563eb;
  --color-sapphire: #1e40af;
  --color-mint: #dcfce7;
  --color-green: #16a34a;
  --color-orange: #ea580c;
  --color-violet: #7c3aed;
  --color-red: #dc2626;
  --color-red-soft: #fee2e2;
  --color-amber: #d97706;
  --color-amber-soft: #fef3c7;
  --color-blue-soft: #dbeaff;
  --color-violet-soft: #ede9fe;
  --color-action: #000000;

  /* Typography */
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --text-caption: 11px;
  --text-body: 14px;
  --text-body-lg: 16px;
  --text-subheading: 20px;
  --text-heading-sm: 24px;
  --text-heading: 30px;
  --text-heading-lg: 36px;

  /* Shape */
  --radius-tag: 9999px;
  --radius-card: 12px;
  --radius-input: 6px;
  --radius-btn: 8px;
  --radius-lgcard: 16px;

  /* Shadows (used sparingly — borders define containers) */
  --shadow-subtle: rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;
  --shadow-ring: rgba(0, 0, 0, 0.1) 0px 0px 0px 4px;
  --shadow-md: rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.1) 0px 4px 6px -4px;

  /* Layout */
  --sidebar-w: 232px;
  --content-max: 1440px;
}

/* ---------- Reset ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.43;
  color: var(--color-charcoal);
  background: var(--color-canvas);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin: 0; }

a { color: var(--color-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .mono { font-family: var(--font-mono); font-size: 12px; }

button { font-family: inherit; }

/* ---------- App Shell ---------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--color-ash);
  background: var(--color-canvas);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
}

.brand-name { font-size: 14px; font-weight: 600; color: var(--color-charcoal); line-height: 1.2; }
.brand-sub { font-size: 11px; color: var(--color-fog); margin-top: 2px; }

.nav { flex: 1; padding: 4px 8px 16px; }

.nav-group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-silver);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 16px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: var(--radius-btn);
  color: var(--color-slate);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 1px;
}

.nav-item:hover { background: var(--color-paper); color: var(--color-charcoal); text-decoration: none; }

.nav-item.active { background: var(--color-blue-soft); color: var(--color-sapphire); }

.nav-item .nav-ico { width: 18px; height: 18px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.nav-item .nav-ico svg { width: 16px; height: 16px; stroke: currentColor; }

.sidebar-foot {
  border-top: 1px solid var(--color-ash);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-links { display: flex; gap: 12px; font-size: 12px; }
.sidebar-links a { color: var(--color-fog); }
.sidebar-links a:hover { color: var(--color-blue); }

/* ---------- Main content ---------- */

.main { flex: 1; min-width: 0; background: var(--color-canvas); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--color-ash);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  z-index: 50;
}

.topbar h1 { font-size: 18px; font-weight: 600; color: var(--color-charcoal); }
.topbar .page-sub { font-size: 12px; color: var(--color-fog); margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.content {
  max-width: var(--content-max);
  padding: 24px 32px 64px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- Cards ---------- */

.card {
  background: var(--color-canvas);
  border: 1px solid var(--color-ash);
  border-radius: var(--radius-card);
  padding: 16px;
}

.card-plain { padding: 0; overflow: hidden; }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-plain .card-head { padding: 16px 16px 0; margin-bottom: 12px; }

.card-title { font-size: 15px; font-weight: 600; color: var(--color-charcoal); }
.card-desc { font-size: 12px; color: var(--color-fog); margin-top: 2px; line-height: 1.5; }

.card-alt {
  background: var(--color-paper);
  border: none;
  border-radius: var(--radius-lgcard);
  padding: 16px;
}

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- Stat tiles ---------- */

.stat {
  border: 1px solid var(--color-ash);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  background: var(--color-canvas);
}

.stat-label { font-size: 12px; color: var(--color-fog); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 24px; font-weight: 600; color: var(--color-charcoal); margin-top: 6px; line-height: 1.2; letter-spacing: -0.01em; }
.stat-value.blue { color: var(--color-blue); }
.stat-meta { font-size: 12px; color: var(--color-fog); margin-top: 4px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--color-ash);
  background: var(--color-canvas);
  color: var(--color-charcoal);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  text-decoration: none;
}

.btn:hover { background: var(--color-paper); text-decoration: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--color-action);
  border-color: var(--color-action);
  color: #fff;
  box-shadow: var(--shadow-subtle);
}
.btn-primary:hover { background: var(--color-graphite); border-color: var(--color-graphite); }

.btn-blue { background: var(--color-sapphire); border-color: var(--color-sapphire); color: #fff; }
.btn-blue:hover { background: var(--color-blue); border-color: var(--color-blue); }

.btn-danger { color: var(--color-red); border-color: var(--color-ash); }
.btn-danger:hover { background: var(--color-red-soft); border-color: var(--color-red-soft); }

.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--color-paper); }

.btn-sm { height: 26px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn-lg { height: 40px; padding: 0 20px; font-size: 14px; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */

.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 12.5px; font-weight: 500; color: var(--color-graphite); }
.field-hint { font-size: 11.5px; color: var(--color-fog); line-height: 1.45; }

.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--color-pebble);
  border-radius: var(--radius-input);
  background: var(--color-canvas);
  color: var(--color-charcoal);
  font-size: 13.5px;
  font-family: inherit;
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.input::placeholder, .textarea::placeholder { color: var(--color-silver); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--color-paper); color: var(--color-fog); }

.textarea { resize: vertical; min-height: 90px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.55; }

.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--color-graphite);
  cursor: pointer;
  user-select: none;
}
.check input { width: 15px; height: 15px; accent-color: var(--color-blue); cursor: pointer; margin: 0; }

.form-row { display: grid; gap: 12px; }
.form-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Toggle switch */
.switch { position: relative; display: inline-flex; width: 34px; height: 20px; flex-shrink: 0; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0;
  background: var(--color-smoke);
  border-radius: var(--radius-tag);
  transition: background 0.15s ease;
}
.switch .track::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 2px; top: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow-subtle);
  transition: transform 0.15s ease;
}
.switch input:checked + .track { background: var(--color-blue); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--color-paper); }
.switch-row:last-child { border-bottom: none; }
.switch-row .switch-label { font-size: 13.5px; font-weight: 500; color: var(--color-charcoal); }
.switch-row .switch-hint { font-size: 11.5px; color: var(--color-fog); margin-top: 2px; line-height: 1.45; }

/* ---------- Tags / badges ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--radius-tag);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.6;
  border: 1px solid transparent;
  white-space: nowrap;
}

.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.tag-neutral { background: var(--color-paper); color: var(--color-steel); border-color: var(--color-ash); }
.tag-green { background: var(--color-mint); color: #15803d; }
.tag-blue { background: var(--color-blue-soft); color: var(--color-sapphire); }
.tag-amber { background: var(--color-amber-soft); color: #b45309; }
.tag-red { background: var(--color-red-soft); color: #b91c1c; }
.tag-violet { background: var(--color-violet-soft); color: #6d28d9; }
.tag-outline { background: transparent; color: var(--color-steel); border-color: var(--color-smoke); }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }

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

.table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-fog);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-ash);
  background: var(--color-paper);
  white-space: nowrap;
}

.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-ash);
  color: var(--color-graphite);
  vertical-align: middle;
}

.table tbody tr:hover { background: #fafafa; }
.table tbody tr:last-child td { border-bottom: none; }

.table .cell-mono { font-family: var(--font-mono); font-size: 12px; }
.table .cell-muted { color: var(--color-fog); font-size: 12px; }
.table .cell-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* Quota column: pill + used/limit + progress bar */
.quota-cell { min-width: 150px; }
.quota-cell .quota-nums { margin-top: 3px; font-size: 11px; white-space: nowrap; }
.quota-bar {
  height: 5px;
  border-radius: 3px;
  background: var(--color-ash);
  margin-top: 5px;
  overflow: hidden;
}
.quota-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.table-empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--color-fog);
  font-size: 13px;
}

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-ash);
  margin-bottom: 16px;
  overflow-x: auto;
}

.tab {
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-fog);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  white-space: nowrap;
}

.tab:hover { color: var(--color-charcoal); }
.tab.active { color: var(--color-blue); border-bottom-color: var(--color-blue); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Pill segmented control */
.seg { display: inline-flex; background: var(--color-paper); border: 1px solid var(--color-ash); border-radius: var(--radius-tag); padding: 2px; gap: 2px; }
.seg button {
  border: none; background: transparent; padding: 4px 12px;
  border-radius: var(--radius-tag); font-size: 12px; font-weight: 500;
  color: var(--color-steel); cursor: pointer;
}
.seg button.active { background: var(--color-canvas); color: var(--color-charcoal); box-shadow: var(--shadow-subtle); }

/* ---------- Toolbar ---------- */

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.toolbar .input, .toolbar .select { width: auto; }

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 10, 10, 0.4);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 16px 16px;
  z-index: 200;
  overflow-y: auto;
}

.modal-backdrop.open { display: flex; }

.modal {
  background: var(--color-canvas);
  border-radius: var(--radius-lgcard);
  border: 1px solid var(--color-ash);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
}

.modal.modal-lg { max-width: 760px; }

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 0;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close { border: none; background: none; font-size: 18px; color: var(--color-fog); cursor: pointer; padding: 4px; line-height: 1; }
.modal-close:hover { color: var(--color-charcoal); }
.modal-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; }

/* ---------- Toast ---------- */

#toast-region {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: var(--color-canvas);
  border: 1px solid var(--color-ash);
  border-radius: var(--radius-btn);
  box-shadow: var(--shadow-md);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toast-in 0.18s ease;
  max-width: 480px;
}

.toast .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.toast-success .dot { background: var(--color-green); }
.toast-error .dot { background: var(--color-red); }
.toast-info .dot { background: var(--color-blue); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Misc ---------- */

.muted { color: var(--color-fog); font-size: 12.5px; }
.divider { border: none; border-top: 1px solid var(--color-ash); margin: 4px 0; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13px; }
.kv dt { color: var(--color-fog); }
.kv dd { margin: 0; color: var(--color-graphite); }

.code-block {
  background: var(--color-paper);
  border: 1px solid var(--color-ash);
  border-radius: var(--radius-btn);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  color: var(--color-graphite);
  position: relative;
}

.copy-chip {
  position: absolute;
  top: 8px; right: 8px;
  border: 1px solid var(--color-ash);
  background: var(--color-canvas);
  border-radius: 6px;
  font-size: 11px;
  padding: 3px 8px;
  color: var(--color-steel);
  cursor: pointer;
}
.copy-chip:hover { color: var(--color-blue); border-color: var(--color-blue); }

.spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--color-ash);
  border-top-color: var(--color-blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: -2px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--color-paper) 25%, #ececec 37%, var(--color-paper) 63%);
  background-size: 400% 100%;
  animation: skeleton 1.2s ease infinite;
  border-radius: 6px;
  min-height: 14px;
}

@keyframes skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.progress {
  height: 6px;
  background: var(--color-paper);
  border-radius: var(--radius-tag);
  overflow: hidden;
}
.progress .bar { height: 100%; background: var(--color-blue); border-radius: var(--radius-tag); transition: width 0.3s ease; }

/* Pagination */
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 12px 16px; font-size: 12.5px; color: var(--color-fog); }

/* ---------- Login page ---------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-canvas);
  background-image: radial-gradient(var(--color-ash) 1px, transparent 1px);
  background-size: 22px 22px;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--color-canvas);
  border: 1px solid var(--color-ash);
  border-radius: var(--radius-lgcard);
  box-shadow: var(--shadow-ring);
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.auth-brand .brand-logo { width: 44px; height: 44px; border-radius: 12px; font-size: 20px; }
.auth-title { font-size: 20px; font-weight: 600; color: var(--color-charcoal); }
.auth-sub { font-size: 13px; color: var(--color-fog); }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 100; transform: translateX(-100%); transition: transform 0.2s ease; height: 100vh; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-md); }
  .sidebar-scrim { position: fixed; inset: 0; background: rgba(10,10,10,0.3); z-index: 99; display: none; }
  .sidebar-scrim.show { display: block; }
  .menu-btn { display: inline-flex !important; }
  .content { padding: 16px 16px 48px; }
  .topbar { padding: 12px 16px; }
  .grid-2, .grid-3, .grid-4, .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
}

.menu-btn { display: none; }

/* ---------- Task Center dock ---------- */

.tc-dock { position: fixed; right: 20px; bottom: 20px; z-index: 300; }
.tc-dock[hidden] { display: none; }

.tc-fab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px 0 12px;
  border-radius: var(--radius-tag);
  border: 1px solid var(--color-ash);
  background: var(--color-canvas);
  color: var(--color-charcoal);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  position: relative;
}
.tc-fab[hidden] { display: none; }
.tc-fab:hover { background: var(--color-paper); }
.tc-fab-ico { display: inline-flex; align-items: center; }
.tc-fab-badge {
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--radius-tag);
  background: var(--color-blue); color: #fff;
  font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
}
.tc-fab-badge.idle { background: var(--color-silver); }

.tc-panel {
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: min(560px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  background: var(--color-canvas);
  border: 1px solid var(--color-ash);
  border-radius: var(--radius-lgcard);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: toast-in 0.16s ease;
}
.tc-panel[hidden] { display: none; }

.tc-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--color-ash);
  background: var(--color-paper);
}
.tc-panel-title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--color-charcoal); }
.tc-panel-actions { display: flex; align-items: center; gap: 10px; }
.tc-link { font-size: 12px; color: var(--color-blue); }
.tc-icon-btn { border: none; background: none; font-size: 20px; line-height: 1; color: var(--color-fog); cursor: pointer; padding: 0 2px; }
.tc-icon-btn:hover { color: var(--color-charcoal); }

.tc-panel-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }

.tc-card { border: 1px solid var(--color-ash); border-radius: var(--radius-card); padding: 10px 12px; }
.tc-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.tc-card-title { font-size: 13px; font-weight: 600; color: var(--color-charcoal); }
.tc-card-bar { margin-bottom: 6px; }
.tc-card-meta { font-size: 11.5px; color: var(--color-fog); margin-bottom: 8px; }

.tc-log {
  margin: 0;
  background: var(--color-paper);
  border: 1px solid var(--color-ash);
  border-radius: var(--radius-btn);
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.55;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--color-graphite);
}

.tc-card-foot { display: flex; gap: 8px; margin-top: 8px; }
.tc-mini-btn {
  border: 1px solid var(--color-ash);
  background: var(--color-canvas);
  border-radius: 6px;
  font-size: 11.5px;
  padding: 3px 10px;
  color: var(--color-steel);
  cursor: pointer;
}
.tc-mini-btn:hover { color: var(--color-blue); border-color: var(--color-blue); }
.tc-spin { width: 12px; height: 12px; border-width: 2px; vertical-align: -1px; }

@media (max-width: 860px) {
  .tc-dock { right: 12px; bottom: 12px; }
  .tc-panel { width: calc(100vw - 24px); }
}
