/* ============================================================================
   Tidbits website — layout only.
   tokens.css and components.css do the looking; this file does the arranging.
   NO HEX HERE (nor anywhere but tokens.css) — every colour is a token.
   ========================================================================== */

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

/* ---- sign in -------------------------------------------------------------- */
.tb-auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--sp-5);
}

.tb-auth-card {
  width: min(380px, 100%);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.tb-auth-mascot {
  width: calc(96px * var(--ui-scale));
  height: auto;
  margin: 0 auto;
}

.tb-auth-card .page-title { margin: 0; }
.tb-auth-card form { gap: var(--sp-3); text-align: left; }

/* ---- chrome --------------------------------------------------------------- */
.tb-web-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.tb-web-head-in {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.tb-web-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
  color: var(--text);
  font-size: var(--fs-lg);
}

.tb-web-nav { margin-left: auto; gap: var(--sp-1); flex-wrap: wrap; }
.tb-inline-form { display: inline; margin: 0; }

.tb-web-main {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-4) var(--sp-8);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.tb-web-narrow { max-width: calc(620px * var(--ui-scale)); }

/* ---- controls ------------------------------------------------------------- */
.tb-web-bar {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  flex-wrap: wrap;
}

.tb-web-bar #q { flex: 1 1 240px; }
.tb-web-toggles { gap: var(--sp-2); }

.tb-web-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
}

/* ---- the list ------------------------------------------------------------- */
.tb-web-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.tb-web-item {
  display: flex;
  gap: var(--sp-3);
  align-items: stretch;
}

/* The importance spine, same idea as the extension's list view. */
.tb-web-rail {
  flex: 0 0 auto;
  width: calc(6px * var(--ui-scale));
  border-radius: var(--r-pill);
  background: var(--imp-3);
}

.tb-web-item[data-imp="1"] .tb-web-rail { background: var(--imp-1); }
.tb-web-item[data-imp="2"] .tb-web-rail { background: var(--imp-2); }
.tb-web-item[data-imp="3"] .tb-web-rail { background: var(--imp-3); }
.tb-web-item[data-imp="4"] .tb-web-rail { background: var(--imp-4); }
.tb-web-item[data-imp="5"] .tb-web-rail { background: var(--imp-5); }

.tb-web-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-2); }

.tb-web-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tb-web-why { margin: 0; }

.tb-web-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}

.tb-web-actions { display: flex; gap: var(--sp-1); margin-left: auto; }

.tb-web-src { color: var(--text-muted); text-decoration: none; overflow-wrap: anywhere; }
.tb-web-src:hover { text-decoration: underline; }

/* ---- tokens page ---------------------------------------------------------- */
.tb-token-new { gap: var(--sp-3); }
.tb-token-list { list-style: none; margin: 0; padding: 0; gap: var(--sp-2); }

.tb-token-row { display: flex; align-items: center; gap: var(--sp-3); }
.tb-token-dead { opacity: 0.55; }
.tb-token-label { margin: 0; font-family: var(--font-display); }

.tb-token-fresh { display: flex; flex-direction: column; gap: var(--sp-2); border-color: var(--primary); }

.tb-token-value {
  display: block;
  padding: var(--sp-3);
  background: var(--field-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  overflow-wrap: anywhere;
  user-select: all;
}

/* ---- toast ---------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: var(--sp-5);
  transform: translateX(-50%);
  z-index: 50;
}

@media (max-width: 560px) {
  .tb-web-head-in { flex-wrap: wrap; }
  .tb-web-nav { margin-left: 0; width: 100%; }
}
