/* tds.css - Tratok Design System tokens shared by every property, plus the
   Constellation switcher (.tc-*) and the profile role chips (.t-rolechip*).
   Vendored verbatim into hospitality, Labs, Contributors and Corporate; the
   tokens are namespaced --tds-* so they never collide with a host sheet.
   Dark is the default everywhere; a host that runs light sets
   data-theme="light" on <html> and the switcher follows. */
:root {
  --tds-ember: #E85D3A; --tds-ember-glow: #FF7B5C; --tds-teal: #2ECDA7; --tds-amber: #F5A623; --tds-violet: #8B5CF6;
  --tds-void: #0B0E17; --tds-abyss: #111827; --tds-slate: #1E293B;
  --tds-snow: #F1F5F9; --tds-mist: #94A3B8; --tds-whisper: #64748B;
  --tds-glass: rgba(255,255,255,0.06); --tds-glass-border: rgba(255,255,255,0.10); --tds-glass-hover: rgba(255,255,255,0.10);
  --tds-panel-bg: #0F1422; --tds-panel-text: #F1F5F9; --tds-panel-muted: #94A3B8; --tds-panel-shadow: 0 18px 48px rgba(0,0,0,0.55);
  --tds-font-display: "Sora", "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tds-font-text: "DM Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tds-radius: 14px; --tds-radius-lg: 20px;
}
:root[data-theme="light"], :root[data-theme="boardroom"] {
  --tds-glass: rgba(15,20,34,0.05); --tds-glass-border: rgba(15,20,34,0.12); --tds-glass-hover: rgba(15,20,34,0.09);
  --tds-panel-bg: #FFFFFF; --tds-panel-text: #0F1422; --tds-panel-muted: #5B6578; --tds-panel-shadow: 0 18px 48px rgba(15,20,34,0.18);
}

/* Switcher button: the nine dots every property shares */
.tc-wrap { position: relative; display: inline-flex; align-items: center; }
.tc-btn { width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
          background: var(--tds-glass); border: 1px solid var(--tds-glass-border); color: inherit; padding: 0; transition: background .15s, border-color .15s; }
.tc-btn:hover, .tc-btn[aria-expanded="true"] { background: var(--tds-glass-hover); border-color: rgba(232,93,58,0.45); }
.tc-btn:focus-visible { outline: 2px solid var(--tds-teal); outline-offset: 2px; }
.tc-dots { display: grid; grid-template-columns: repeat(3, 4px); gap: 3px; }
.tc-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .85; display: block; }
.tc-btn[aria-expanded="true"] .tc-dots i:nth-child(5) { background: var(--tds-ember); }

/* Panel */
.tc-panel { position: absolute; top: calc(100% + 10px); inset-inline-end: 0; width: min(380px, calc(100vw - 24px)); z-index: 1200;
            background: var(--tds-panel-bg); color: var(--tds-panel-text); border: 1px solid var(--tds-glass-border); border-radius: var(--tds-radius-lg);
            box-shadow: var(--tds-panel-shadow); padding: 14px; font-family: var(--tds-font-text); text-align: start; }
.tc-panel[hidden] { display: none; }
.tc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 6px 12px; border-bottom: 1px solid var(--tds-glass-border); margin-bottom: 12px; }
.tc-head strong { display: block; font-family: var(--tds-font-display); font-size: 0.98rem; letter-spacing: -0.01em; }
.tc-head span { display: block; font-size: 0.74rem; color: var(--tds-panel-muted); margin-top: 2px; }
.tc-member { display: inline-flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--tds-panel-muted); max-width: 45%; }
.tc-member img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.tc-member span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-wallet { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 9px 12px; border-radius: var(--tds-radius);
             background: rgba(46,205,167,0.08); border: 1px solid rgba(46,205,167,0.25); font-size: 0.78rem; color: var(--tds-panel-muted); }
.tc-wallet i { color: var(--tds-teal); }
.tc-wallet strong { margin-inline-start: auto; color: var(--tds-panel-text); font-variant-numeric: tabular-nums; font-size: 0.92rem; }
.tc-wallet strong small { font-size: 0.7em; color: var(--tds-teal); font-weight: 800; }
/* Two columns everywhere; one only on the narrowest phones (rule order
   matters: the phone block above must not be undone by a later default). */
.tc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
@media (max-width: 340px) { .tc-grid { grid-template-columns: 1fr; } }
.tc-node { display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: start; text-decoration: none; color: inherit; padding: 10px; border-radius: var(--tds-radius);
           border: 1px solid transparent; background: var(--tds-glass); transition: border-color .15s, background .15s, transform .15s; position: relative; }
.tc-node:hover { background: var(--tds-glass-hover); border-color: rgba(232,93,58,0.35); transform: translateY(-1px); }
.tc-node:focus-visible { outline: 2px solid var(--tds-teal); outline-offset: 1px; }
.tc-node-icon { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 15px;
                background: rgba(148,163,184,0.12); color: var(--tds-panel-muted); }
.tc-node.is-lit .tc-node-icon { background: rgba(46,205,167,0.14); color: var(--tds-teal); }
.tc-node.is-here .tc-node-icon { background: rgba(232,93,58,0.16); color: var(--tds-ember); }
.tc-node-text { min-width: 0; }
.tc-node-text strong { display: block; font-size: 0.86rem; font-family: var(--tds-font-display); letter-spacing: -0.005em; }
.tc-node-text small { display: block; font-size: 0.7rem; color: var(--tds-panel-muted); line-height: 1.35; margin-top: 1px; }
.tc-count { display: inline-block; margin-top: 5px; font-size: 0.66rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: var(--tds-amber);
            background: rgba(245,166,35,0.12); border: 1px solid rgba(245,166,35,0.3); }
.tc-node-state { grid-column: 1 / -1; font-size: 0.64rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tds-panel-muted); }
.tc-node.is-lit .tc-node-state { color: var(--tds-teal); }
.tc-node.is-here .tc-node-state { color: var(--tds-ember); }
.tc-manage { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; padding: 10px; border-radius: var(--tds-radius);
             text-decoration: none; font-size: 0.8rem; font-weight: 700; color: var(--tds-teal); border: 1px dashed rgba(46,205,167,0.35); }
.tc-manage:hover { background: rgba(46,205,167,0.08); }
@media (prefers-reduced-motion: reduce) { .tc-node, .tc-btn { transition: none; } .tc-node:hover { transform: none; } }

/* Role chips on public profiles (tratok.net) */
.t-rolechips { display: inline-flex; flex-wrap: wrap; gap: 6px; vertical-align: middle; margin-inline-start: 6px; }
.t-rolechip { display: inline-flex; align-items: center; gap: 5px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
              padding: 3px 9px; border-radius: 999px; border: 1px solid; line-height: 1.4; }
.t-rolechip--hospitality  { color: #2ECDA7; border-color: rgba(46,205,167,0.4); background: rgba(46,205,167,0.1); }
.t-rolechip--labs         { color: #F5A623; border-color: rgba(245,166,35,0.4); background: rgba(245,166,35,0.1); }
.t-rolechip--contributors { color: #FF7B5C; border-color: rgba(232,93,58,0.4); background: rgba(232,93,58,0.1); }
.t-rolechip--corporate    { color: #A78BFA; border-color: rgba(139,92,246,0.4); background: rgba(139,92,246,0.12); }

/* "Sign in with Tratok" button used on every portal login page */
.tid-signin { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; box-sizing: border-box; text-decoration: none; cursor: pointer;
              font: inherit; font-weight: 800; font-size: 0.95rem; padding: 12px 18px; border-radius: 999px; color: #fff;
              background: linear-gradient(135deg, var(--tds-ember), #C43D1E); border: 1px solid rgba(255,255,255,0.12); box-shadow: 0 6px 18px rgba(232,93,58,0.25); }
.tid-signin:hover { filter: brightness(1.06); }
.tid-signin img { width: 20px; height: 20px; border-radius: 6px; background: #fff; padding: 2px; }
.tid-or { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--tds-mist); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em; }
.tid-or::before, .tid-or::after { content: ""; flex: 1; height: 1px; background: var(--tds-glass-border); }

/* Phones (kept last so nothing below undoes it): the button sits in a crowded header, so the panel leaves the
   button's box and docks under the header, full width, scrolling inside
   itself. Headers with backdrop-filter contain fixed children, which is
   fine here: the header spans the viewport width and sits at the top. */
@media (max-width: 600px) {
  .tc-panel { position: fixed; top: 64px; inset-inline: 10px; width: auto; max-height: calc(100vh - 84px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .tc-node { padding: 8px; gap: 8px; grid-template-columns: 32px 1fr; }
  .tc-node-icon { width: 32px; height: 32px; font-size: 13px; }
  .tc-node-text strong { font-size: 0.8rem; }
  .tc-node-text small { font-size: 0.66rem; }
}
