/* ==========================================================================
   On Group Lead & Social Manager — app stylesheet

   Look: warm stone + charcoal with a safety-orange accent. Construction trade
   without the clip-art. The sidebar stays dark in both themes on purpose —
   it anchors the page and gives the app a consistent silhouette.

   Theming follows the Garage Tec CRM convention: the theme is a CLASS on
   <html> (theme-dark / theme-light), persisted under the gt_theme localStorage
   key. Every colour is a token; nothing below hard-codes one except platform
   brand colours, which are passed in as --b / --brand.

   The --gt-* names at the end of each block are aliases of the local tokens,
   so a component copied out of the Garage Tec CRM renders correctly here
   without being rewritten.
   ========================================================================== */

:root {
  --acc:        #ea580c;
  --acc-strong: #c2410c;
  --acc-soft:   rgba(234, 88, 12, .10);
  --acc-ring:   rgba(234, 88, 12, .28);

  --bg:        #f6f5f3;
  --bg-sunk:   #efedea;
  --card:      #ffffff;
  --card-2:    #faf9f8;
  --ink:       #1c1917;
  --ink-2:     #57534e;
  --ink-3:     #8b857f;
  --line:      #e4e1dd;
  --line-2:    #d6d2cd;
  --shadow:    0 1px 2px rgba(28,25,23,.05), 0 8px 24px -12px rgba(28,25,23,.14);
  --shadow-lg: 0 18px 50px -18px rgba(28,25,23,.30);

  --ok:   #16a34a;  --ok-bg:   rgba(22,163,74,.12);
  --warn: #d97706;  --warn-bg: rgba(217,119,6,.12);
  --err:  #dc2626;  --err-bg:  rgba(220,38,38,.12);
  --info: #2563eb;  --info-bg: rgba(37,99,235,.12);

  /* The rail is dark in both themes. */
  --rail:      #1a1614;
  --rail-2:    #241e1a;
  --rail-ink:  #e8e3df;
  --rail-ink-2:#9c938c;
  --rail-line: #332b26;

  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
  --sidebar-w: 248px;
  --fs: 14.5px;

  /* Garage Tec aliases — resolve to whichever theme is active. */
  --gt-bg-body: var(--bg);        --gt-bg-card: var(--card);
  --gt-bg-card-hover: var(--card-2); --gt-bg-input: var(--bg-sunk);
  --gt-bg-soft: var(--bg-sunk);
  --gt-border: var(--line);       --gt-border-light: var(--line-2);
  --gt-text: var(--ink);          --gt-text-secondary: var(--ink-2);
  --gt-text-muted: var(--ink-3);
  --gt-success: var(--ok);        --gt-warning: var(--warn);
  --gt-danger:  var(--err);       --gt-primary: var(--acc);
  --gt-shadow:  var(--shadow);    --gt-shadow-lg: var(--shadow-lg);
}

html.theme-dark {
  --bg:      #12100e;
  --bg-sunk: #0d0b0a;
  --card:    #1c1917;
  --card-2:  #221e1b;
  --ink:     #ede9e6;
  --ink-2:   #a8a29e;
  --ink-3:   #78716c;
  --line:    #2f2925;
  --line-2:  #3d3630;
  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 18px 50px -18px rgba(0,0,0,.75);
  --acc-soft: rgba(234,88,12,.14);
  --rail:      #171310;
  --rail-2:    #1f1a16;
  --rail-line: #2b2420;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: var(--fs)/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.018em; line-height: 1.2; }
p  { margin: 0 0 .8em; }
.ic { flex-shrink: 0; }

::selection { background: var(--acc-ring); }

/* ---------------------------------------------------------------- layout -- */

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

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--rail);
  color: var(--rail-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--rail-line);
}

.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--rail-line);
}
.brand-mark {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--acc), var(--acc-strong));
  color: #fff; font-weight: 800; font-size: 14px; letter-spacing: -.03em;
  box-shadow: 0 4px 14px -4px var(--acc-ring);
}
.brand-text { min-width: 0; line-height: 1.25; }
.brand-text strong { display: block; font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.brand-text span   { display: block; font-size: 11px; color: var(--rail-ink-2); letter-spacing: .02em; }

.nav { flex: 1; overflow-y: auto; padding: 12px 10px 20px; }
.nav::-webkit-scrollbar { width: 8px; }
.nav::-webkit-scrollbar-thumb { background: var(--rail-line); border-radius: 8px; }

.nav-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: var(--rail-ink-2); padding: 16px 10px 7px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8.5px 10px; border-radius: 9px;
  color: var(--rail-ink-2); font-size: 13.5px; font-weight: 500;
  transition: background .13s, color .13s;
}
.nav-item:hover { background: var(--rail-2); color: var(--rail-ink); }
.nav-item.active {
  background: linear-gradient(90deg, var(--acc-soft), transparent 85%);
  color: #fff; font-weight: 600;
  box-shadow: inset 2px 0 0 var(--acc);
}
.nav-item.active .ic { color: var(--acc); }
.nav-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count {
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px;
  background: var(--rail-2); color: var(--rail-ink-2);
}
.nav-item.active .nav-count { background: rgba(255,255,255,.12); color: #fff; }
.nav-count.alert { background: var(--acc); color: #fff; }

.sidebar-foot {
  padding: 12px 16px; border-top: 1px solid var(--rail-line);
  font-size: 11px; color: var(--rail-ink-2);
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--ink-3); }
.dot.ok  { background: var(--ok);  box-shadow: 0 0 0 3px var(--ok-bg); }
.dot.sim { background: var(--warn);box-shadow: 0 0 0 3px var(--warn-bg); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 22px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.search {
  flex: 1; max-width: 460px; position: relative;
  display: flex; align-items: center; gap: 9px;
  padding: 0 12px; height: 38px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; color: var(--ink-3);
  transition: border-color .14s, box-shadow .14s;
}
.search:focus-within { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-ring); }
.search input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font: inherit; color: var(--ink); min-width: 0;
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }

.content { padding: 24px 22px 60px; max-width: 1440px; width: 100%; }

.mobile-menu { display: none; }

/* ---------------------------------------------------------------- pieces -- */

.page-head {
  display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-head h1 { font-size: 24px; font-weight: 700; }
.page-head .sub { color: var(--ink-2); font-size: 13.5px; margin-top: 3px; }
.page-head .spacer { flex: 1; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.card-pad { padding: 18px 20px; }
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 20px; border-bottom: 1px solid var(--line);
}
.card-head h2 { font-size: 15px; font-weight: 700; }
.card-head .spacer { flex: 1; }
.card-head .hint { font-size: 12px; color: var(--ink-3); }

.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)); }
.grid-side { grid-template-columns: minmax(0,1.9fr) minmax(280px,1fr); align-items: start; }

/* ----------------------------------------------------------------- stats -- */

.stat {
  padding: 16px 18px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.stat::after {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--sc, var(--acc));
}
.stat .k {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-3); display: flex; align-items: center; gap: 7px;
}
.stat .v { font-size: 27px; font-weight: 750; letter-spacing: -.03em; margin-top: 6px; }
.stat .m { font-size: 12px; color: var(--ink-2); margin-top: 2px; }

/* --------------------------------------------------------------- buttons -- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--card); color: var(--ink);
  font: 600 13.5px/1 inherit; cursor: pointer; white-space: nowrap;
  transition: background .13s, border-color .13s, transform .08s, box-shadow .13s;
}
.btn:hover  { background: var(--card-2); border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--acc-ring); }

.btn-primary {
  background: linear-gradient(140deg, var(--acc), var(--acc-strong));
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px -6px var(--acc-ring);
}
.btn-primary:hover { filter: brightness(1.07); border-color: transparent; }
.btn-ghost  { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--card-2); color: var(--ink); }
.btn-danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 35%, var(--line)); }
.btn-danger:hover { background: var(--err-bg); border-color: var(--err); }
.btn-sm { height: 31px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; flex-shrink: 0;
  border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--ink-2); cursor: pointer;
  transition: background .13s, color .13s;
}
.icon-btn:hover { background: var(--card-2); color: var(--ink); border-color: var(--line); }
.sidebar .icon-btn { color: var(--rail-ink-2); }
.sidebar .icon-btn:hover { background: var(--rail-2); color: #fff; border-color: transparent; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  border: 0; cursor: pointer;
  background: var(--a, var(--acc)); color: #fff;
  font: 700 12px/1 inherit; letter-spacing: .02em;
  display: grid; place-items: center;
}

/* ------------------------------------------------------------ tabs/chips -- */

.tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 4px; margin-bottom: 16px;
  background: var(--bg-sunk); border: 1px solid var(--line);
  border-radius: 12px; width: fit-content; max-width: 100%;
}
.tab {
  padding: 7px 13px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 7px;
  transition: background .13s, color .13s;
}
.tab:hover  { color: var(--ink); }
.tab.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.tab .n {
  font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 99px;
  background: var(--bg-sunk); color: var(--ink-3);
}
.tab.active .n { background: var(--acc-soft); color: var(--acc-strong); }
html.theme-dark .tab.active .n { color: var(--acc); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2.5px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
  background: color-mix(in srgb, var(--b, var(--ink-3)) 15%, transparent);
  color: var(--b, var(--ink-3));
  border: 1px solid color-mix(in srgb, var(--b, var(--ink-3)) 30%, transparent);
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600;
  background: var(--bg-sunk); color: var(--ink-2); border: 1px solid var(--line);
}
.chip .ic { opacity: .7; }
.hot { color: var(--acc); }

/* --------------------------------------------------------------- tables --- */

.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
table.t th {
  text-align: left; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3);
  padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.t td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tbody tr { transition: background .1s; }
table.t tbody tr:hover { background: var(--card-2); }
table.t tbody tr:last-child td { border-bottom: 0; }
.t-name { font-weight: 650; letter-spacing: -.005em; }
.t-sub  { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.t-right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }

.empty {
  padding: 54px 20px; text-align: center; color: var(--ink-3);
}
.empty .ic { opacity: .35; margin-bottom: 10px; }
.empty h3 { font-size: 15px; color: var(--ink-2); margin-bottom: 4px; }
.empty p { font-size: 13px; max-width: 380px; margin: 0 auto 14px; }

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

.field { margin-bottom: 15px; }
.field > label,
.label {
  display: block; margin-bottom: 6px;
  font-size: 12.5px; font-weight: 650; color: var(--ink-2);
}
.req { color: var(--acc); }

input[type=text], input[type=email], input[type=tel], input[type=url],
input[type=number], input[type=password], input[type=search],
input[type=datetime-local], input[type=date], select, textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--card); color: var(--ink);
  font: inherit; outline: 0;
  transition: border-color .14s, box-shadow .14s;
}
html.theme-dark input, html.theme-dark select, html.theme-dark textarea { background: var(--bg-sunk); }
input:focus, select:focus, textarea:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-ring); }
textarea { resize: vertical; min-height: 92px; line-height: 1.6; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b857f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 11px center;
  padding-right: 34px;
}
.help { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; line-height: 1.45; }

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

.check {
  display: flex; align-items: center; gap: 9px;
  font-size: 13.5px; font-weight: 550; cursor: pointer; user-select: none;
}
.check input { width: 17px; height: 17px; accent-color: var(--acc); cursor: pointer; }

.form-actions {
  display: flex; gap: 9px; flex-wrap: wrap; align-items: center;
  padding-top: 16px; margin-top: 4px; border-top: 1px solid var(--line);
}
.form-actions .spacer { flex: 1; }

/* ------------------------------------------------------------- platforms -- */

.plat-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.plat-pick {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px; cursor: pointer; user-select: none;
  border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--card); transition: border-color .13s, background .13s;
}
.plat-pick:hover { border-color: var(--ink-3); }
.plat-pick input { position: absolute; opacity: 0; pointer-events: none; }
.plat-pick:has(input:checked) {
  border-color: var(--brand, var(--acc));
  background: color-mix(in srgb, var(--brand, var(--acc)) 8%, var(--card));
}
.plat-dot {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--brand, var(--ink-3)); color: #fff;
  font: 800 12px/1 inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.plat-meta { min-width: 0; line-height: 1.3; }
.plat-meta strong { display: block; font-size: 13px; font-weight: 650; }
.plat-meta span   { display: block; font-size: 11px; color: var(--ink-3); }

/* Connection hub: left rail of platforms + right panel */
.conn-wrap { display: grid; grid-template-columns: 250px minmax(0,1fr); align-items: start; }
.conn-rail { padding: 10px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.conn-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px;
  border: 1px solid transparent; transition: background .13s;
}
.conn-item:hover  { background: var(--card-2); }
.conn-item.active { border-color: var(--acc); background: var(--acc-soft); }
.conn-state { font-size: 11px; font-weight: 700; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.conn-state.on   { color: var(--ok); }
.conn-state.off  { color: var(--ink-3); }
.conn-state.warn { color: var(--warn); }
.conn-panel { padding: 22px 24px; min-width: 0; }
.conn-head { display: flex; align-items: flex-start; gap: 13px; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.conn-head h2 { font-size: 17px; }
.conn-head .blurb { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; max-width: 62ch; }

/* Stepper */
.steps { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 650; color: var(--ink-3); }
.step-n {
  width: 25px; height: 25px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink-3);
}
.step.active { color: var(--ink); }
.step.active .step-n { border-color: transparent; background: linear-gradient(140deg, var(--acc), var(--acc-strong)); color: #fff; }
.step.done .step-n { border-color: var(--ok); color: var(--ok); }
.step-sep { flex: 1; min-width: 12px; height: 1px; background: var(--line-2); }

.guide { list-style: none; counter-reset: g; margin: 0 0 18px; padding: 0; }
.guide li {
  counter-increment: g; position: relative;
  padding: 9px 0 9px 36px; font-size: 13px; line-height: 1.55;
  border-bottom: 1px solid var(--line); color: var(--ink-2);
}
.guide li:last-child { border-bottom: 0; }
.guide li::before {
  content: counter(g); position: absolute; left: 0; top: 8px;
  width: 23px; height: 23px; border-radius: 50%;
  background: var(--acc-soft); color: var(--acc-strong);
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
html.theme-dark .guide li::before { color: var(--acc); }

.saved-tag { font-size: 11px; font-weight: 700; color: var(--ok); margin-left: 6px; }
.opt-tag   { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-left: 6px; }

/* ---------------------------------------------------------------- notes --- */

.note {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--r);
  font-size: 13px; line-height: 1.55;
  border: 1px solid var(--line); background: var(--card-2); color: var(--ink-2);
  margin-bottom: 16px;
}
.note .ic { margin-top: 1px; flex-shrink: 0; }
.note b { color: var(--ink); font-weight: 650; }
.note-warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.note-warn .ic { color: var(--warn); }
.note-ok   { background: var(--ok-bg);  border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.note-ok .ic { color: var(--ok); }
.note-err  { background: var(--err-bg); border-color: color-mix(in srgb, var(--err) 35%, transparent); }
.note-err .ic { color: var(--err); }

.flash {
  padding: 11px 15px; border-radius: var(--r); margin-bottom: 14px;
  font-size: 13.5px; font-weight: 600;
  border: 1px solid transparent;
}
.flash-success { background: var(--ok-bg);  color: var(--ok);  border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.flash-error   { background: var(--err-bg); color: var(--err); border-color: color-mix(in srgb, var(--err) 30%, transparent); }

/* -------------------------------------------------------------- timeline -- */

.timeline { list-style: none; margin: 0; padding: 4px 0 0; position: relative; }
.timeline::before {
  content: ''; position: absolute; left: 13px; top: 12px; bottom: 8px;
  width: 1px; background: var(--line);
}
.tl { display: flex; gap: 13px; padding: 0 0 18px; position: relative; }
.tl-dot {
  width: 27px; height: 27px; border-radius: 50%; flex-shrink: 0; z-index: 1;
  display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line-2); color: var(--ink-3);
}
.tl-body { min-width: 0; flex: 1; padding-top: 2px; }
.tl-body .txt { font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.tl-body .met { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.tl-kind { font-weight: 700; text-transform: capitalize; color: var(--ink-2); }

/* -------------------------------------------------------------- calendar -- */

.cal { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-dow {
  padding: 8px 10px; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--bg-sunk);
}
.cal-cell {
  min-height: 112px; padding: 7px 8px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 5px;
}
.cal-cell.out { background: var(--bg-sunk); }
.cal-cell.today .cal-n { background: var(--acc); color: #fff; }
.cal-n {
  font-size: 11.5px; font-weight: 700; color: var(--ink-3);
  width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center;
}
.cal-ev {
  font-size: 11.5px; line-height: 1.35; padding: 4px 7px; border-radius: 7px;
  background: var(--acc-soft); color: var(--ink);
  border-left: 2.5px solid var(--ev, var(--acc));
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.cal-ev:hover { filter: brightness(1.06); }

/* ------------------------------------------------------------ misc bits --- */

.usermenu { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 218px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-lg);
  padding: 6px; display: none; z-index: 60;
}
.menu.open { display: block; }
.menu a { display: flex; align-items: center; gap: 9px; padding: 8px 11px; border-radius: 8px; font-size: 13.5px; }
.menu a:hover { background: var(--card-2); }
.menu a.danger { color: var(--err); }
.menu-head { padding: 9px 11px 11px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.menu-head strong { display: block; font-size: 13.5px; }
.menu-head span   { display: block; font-size: 11.5px; color: var(--ink-3); }

.bar { height: 7px; border-radius: 99px; background: var(--bg-sunk); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--bc, var(--acc)); }

.funnel-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.funnel-row .fl { width: 128px; flex-shrink: 0; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.funnel-row .fb { flex: 1; }
.funnel-row .fn { width: 34px; text-align: right; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

.kv { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }
.kv .k { width: 120px; flex-shrink: 0; color: var(--ink-3); font-size: 12.5px; }
.kv .v { flex: 1; min-width: 0; word-break: break-word; }

.code {
  display: block; padding: 11px 13px; border-radius: 10px;
  background: var(--bg-sunk); border: 1px solid var(--line);
  font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink-2); white-space: pre-wrap; word-break: break-all;
}

.prose { font-size: 15px; line-height: 1.72; color: var(--ink); }
.prose h2 { font-size: 21px; margin: 26px 0 8px; }
.prose h3 { font-size: 17px; margin: 20px 0 6px; }
.prose img { max-width: 100%; border-radius: 10px; }
.prose blockquote { margin: 18px 0; padding-left: 16px; border-left: 3px solid var(--acc); color: var(--ink-2); font-style: italic; }
.prose a { color: var(--acc-strong); text-decoration: underline; }
html.theme-dark .prose a { color: var(--acc); }

/* --------------------------------------------------------------- login ---- */

.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr;
  background: var(--bg);
}
.auth-hero {
  background:
    radial-gradient(1000px 520px at 15% 8%, rgba(234,88,12,.24), transparent 62%),
    linear-gradient(155deg, #241e1a, #14100e 62%);
  color: #f5f1ee; padding: 52px 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-hero::after {
  content: ''; position: absolute; right: -140px; bottom: -140px;
  width: 460px; height: 460px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: inset 0 0 0 60px rgba(255,255,255,.02);
}
.auth-hero h1 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.1; max-width: 15ch; }
.auth-hero p  { color: #b9afa8; max-width: 46ch; margin-top: 14px; font-size: 15px; }
.auth-list { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 11px; }
.auth-list li { display: flex; align-items: center; gap: 11px; font-size: 14px; color: #d6cec8; }
.auth-list .ic { color: var(--acc); }
.auth-foot { font-size: 12.5px; color: #8b817a; position: relative; z-index: 1; }
.auth-form { display: grid; place-items: center; padding: 40px 30px; }
.auth-box { width: 100%; max-width: 372px; }
.auth-box h2 { font-size: 22px; margin-bottom: 5px; }
.auth-box .sub { color: var(--ink-2); font-size: 13.5px; margin-bottom: 26px; }
.auth-hint {
  margin-top: 20px; padding: 11px 13px; border-radius: 10px;
  background: var(--card-2); border: 1px dashed var(--line-2);
  font-size: 12.5px; color: var(--ink-2);
}

/* ------------------------------------------------------------- public --- */

.pub { max-width: 620px; margin: 0 auto; padding: 46px 22px 80px; }
.pub-head { text-align: center; margin-bottom: 30px; }
.pub-head .mark {
  width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 15px;
  display: grid; place-items: center; color: #fff; font: 800 17px/1 inherit;
  background: linear-gradient(140deg, var(--acc), var(--acc-strong));
}
.pub-head h1 { font-size: 27px; }
.pub-head p { color: var(--ink-2); margin-top: 8px; }

/* -------------------------------------------------------------- toasts --- */

.toast-wrap { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 9px; z-index: 90; }
.toast {
  padding: 11px 15px; border-radius: var(--r);
  background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 600;
  animation: toast-in .22s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-side { grid-template-columns: minmax(0,1fr); }
  .conn-wrap { grid-template-columns: 1fr; }
  .conn-rail { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .conn-item { flex-shrink: 0; }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 80;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .app.nav-open .sidebar { transform: none; }
  .mobile-menu { display: grid; }
  .sidebar-collapse { display: none; }
  .content { padding: 18px 15px 60px; }
  .topbar { padding: 10px 15px; }
  .grid-2, .grid-3, .grid-4, .row, .row-3 { grid-template-columns: minmax(0,1fr); }
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 34px 26px; }
  .auth-hero::after { display: none; }
  .cal-cell { min-height: 82px; }
}

@media (max-width: 560px) {
  .step-label { display: none; }
  .search { max-width: none; }
  .topbar .btn span { display: none; }
  .topbar .btn { padding: 0 11px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
