/* Member tools + Premium (loaded after styles.css on /tools/ and /premium/) */
.tools-page { padding-bottom: 4rem; }
.tl-hero { padding-top: 2.25rem; padding-bottom: 1rem; }
.tl-back { margin: 0 0 0.75rem; font-size: 0.95rem; }
.tl-back a { color: var(--bone-soft); }
.tl-member {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised);
  padding: 0.75rem 1rem; margin: 0 0 1.5rem;
}
.tl-member__text { flex: 1 1 16rem; color: var(--bone-soft); }
.tl-member__text strong { color: var(--bone); }
.tl-badge {
  display: inline-flex; align-items: center; gap: 0.3rem; font-family: var(--font-label);
  font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.2rem 0.55rem;
  border-radius: 999px; border: 1px solid var(--line-strong); color: var(--bone-soft); white-space: nowrap;
}
.tl-badge--premium { border-color: #d6b668; color: #f2dc9b; background: rgba(214, 182, 104, 0.12); }
.tl-badge--free { border-color: rgba(108, 201, 138, 0.6); color: #afeac2; background: rgba(108, 201, 138, 0.1); }
.tl-badge--approx { border-color: rgba(230, 227, 222, 0.3); color: var(--bone-dim); }
.tl-badge--curated { border-color: rgba(108, 201, 138, 0.6); color: #afeac2; }
.tl-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr)); }
.tl-card {
  display: flex; flex-direction: column; gap: 0.5rem; padding: 1.1rem 1.15rem 1.2rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-card);
  color: inherit; text-decoration: none; transition: border-color 0.2s, transform 0.2s;
}
a.tl-card:hover, a.tl-card:focus-visible { border-color: var(--line-strong); transform: translateY(-2px); }
.tl-card__icon { width: 2.4rem; height: 2.4rem; border-radius: 0.7rem; display: grid; place-items: center; background: rgba(230, 227, 222, 0.06); font-size: 1.25rem; }
.tl-card__title { font-family: var(--font-display); font-size: 1.35rem; margin: 0; color: var(--bone); }
.tl-card__text { margin: 0; color: var(--bone-soft); font-size: 0.97rem; line-height: 1.5; }
.tl-card__foot { margin-top: auto; display: flex; gap: 0.4rem; flex-wrap: wrap; padding-top: 0.4rem; }
.tl-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-card); padding: 1.1rem 1.15rem; margin-bottom: 1rem; }
.tl-panel h2, .tl-panel h3 { font-family: var(--font-display); font-weight: 400; margin: 0 0 0.75rem; color: var(--bone); }
.tl-panel h2 { font-size: 1.45rem; }
.tl-panel h3 { font-size: 1.2rem; }
.tl-cols { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; }
.tl-cols--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 860px) { .tl-cols, .tl-cols--even { grid-template-columns: minmax(0, 1fr); } }
.tl-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-end; }
.tl-row > .field { flex: 1 1 10rem; min-width: 0; }
.tl-muted { color: var(--bone-dim); font-size: 0.92rem; }
.tl-note { color: var(--bone-dim); font-size: 0.85rem; margin: 0.5rem 0 0; }
.tl-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0 0 1rem; }
.tl-tab {
  border: 1px solid var(--line); background: transparent; color: var(--bone-soft); border-radius: 999px;
  padding: 0.45rem 0.95rem; font: inherit; cursor: pointer;
}
.tl-tab.is-active { background: var(--bone); color: var(--bg); border-color: var(--bone); }
.tl-swatch {
  display: inline-block; width: 1.6rem; height: 1.6rem; border-radius: 50%; flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.25); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35); vertical-align: middle;
}
.tl-swatch--lg { width: 3rem; height: 3rem; border-radius: 0.7rem; }
.tl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.tl-item {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.7rem; border: 1px solid var(--line);
  border-radius: 0.7rem; background: rgba(255, 255, 255, 0.015); min-width: 0;
}
.tl-item__body { flex: 1 1 auto; min-width: 0; }
.tl-item__name { color: var(--bone); font-weight: 600; overflow-wrap: anywhere; }
.tl-item__meta { color: var(--bone-dim); font-size: 0.85rem; }
.tl-item.is-done .tl-item__name { text-decoration: line-through; color: var(--bone-dim); }
.tl-item.is-missing { border-color: rgba(217, 142, 100, 0.6); background: rgba(217, 142, 100, 0.07); }
.tl-item.is-owned { border-color: rgba(108, 201, 138, 0.45); }
.tl-item button { flex: 0 0 auto; }
.tl-qty { display: inline-flex; align-items: center; gap: 0.3rem; }
.tl-qty button { width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; color: var(--bone); cursor: pointer; }
.tl-icon-btn { border: 1px solid var(--line); background: transparent; color: var(--bone-soft); border-radius: 0.5rem; padding: 0.3rem 0.55rem; cursor: pointer; font: inherit; font-size: 0.85rem; }
.tl-icon-btn:hover { border-color: var(--line-strong); color: var(--bone); }
.tl-picker__results { max-height: 18rem; overflow: auto; margin-top: 0.6rem; }
.tl-picker__results .tl-item { cursor: pointer; }
.tl-picker__results .tl-item:hover, .tl-picker__results .tl-item:focus-visible { border-color: var(--line-strong); }
.tl-meter { height: 0.55rem; border-radius: 999px; background: rgba(230, 227, 222, 0.1); overflow: hidden; }
.tl-meter > span { display: block; height: 100%; background: linear-gradient(90deg, #8fb996, #d6b668); border-radius: inherit; }
.tl-usage { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.9rem; color: var(--bone-soft); margin-bottom: 0.35rem; }
.tl-alert {
  border: 1px solid rgba(214, 182, 104, 0.55); background: rgba(214, 182, 104, 0.09); border-radius: 0.8rem;
  padding: 0.75rem 0.9rem; margin: 0.6rem 0; color: var(--bone);
}
.tl-alert--error { border-color: rgba(201, 115, 108, 0.6); background: rgba(201, 115, 108, 0.1); }
.tl-alert--ok { border-color: rgba(108, 201, 138, 0.55); background: rgba(108, 201, 138, 0.09); }
.tl-alert .inline-actions, .tl-alert .tl-row { margin-top: 0.5rem; }
.tl-gate { text-align: center; padding: 2rem 1.25rem; }
.tl-gate__lock { font-size: 2rem; }
.tl-gate h2 { margin-top: 0.4rem; }
.tl-gate p { color: var(--bone-soft); max-width: 34rem; margin: 0 auto 1rem; }
.tl-gate .inline-actions { justify-content: center; }
.tl-toggle { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; color: var(--bone-soft); font-size: 0.92rem; }
.tl-toggle input { width: 1.1rem; height: 1.1rem; accent-color: #d6b668; }
.tl-match { display: flex; align-items: center; gap: 0.6rem; }
.tl-brand-block { border-top: 1px solid var(--line); padding: 0.75rem 0 0.2rem; }
.tl-brand-block:first-child { border-top: 0; padding-top: 0; }
.tl-brand-block h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
/* Colour wheel */
.tl-wheel-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.9rem; }
.tl-wheel {
  position: relative; width: min(18rem, 78vw); aspect-ratio: 1; border-radius: 50%; cursor: crosshair; touch-action: none;
  background: radial-gradient(circle closest-side, #808080 0%, rgba(128, 128, 128, 0) 100%),
    conic-gradient(from 90deg, #ff0000, #ff00ff, #0000ff, #00ffff, #00ff00, #ffff00, #ff0000);
  box-shadow: 0 0 0 1px var(--line-strong), var(--shadow);
}
.tl-wheel__shade { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; }
.tl-wheel__dot {
  position: absolute; width: 1.1rem; height: 1.1rem; margin: -0.55rem 0 0 -0.55rem; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px #000; pointer-events: none;
}
.tl-wheel__dot--base { width: 1.5rem; height: 1.5rem; margin: -0.75rem 0 0 -0.75rem; border-width: 3px; }
.tl-range { width: min(18rem, 78vw); }
.tl-harmony { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); }
.tl-chip-colour { border: 1px solid var(--line); border-radius: 0.8rem; overflow: hidden; background: var(--bg-raised); }
.tl-chip-colour__fill { height: 3.6rem; }
.tl-chip-colour__body { padding: 0.5rem 0.6rem; font-size: 0.85rem; }
.tl-chip-colour__hex { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--bone); }
.tl-palette-row { display: flex; gap: 0.25rem; flex-wrap: wrap; }
/* Projects */
.tl-progress { display: flex; align-items: center; gap: 0.6rem; }
.tl-progress .tl-meter { flex: 1 1 auto; }
.tl-stat-grid { display: grid; gap: 0.7rem; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); margin-bottom: 1rem; }
.tl-stat { border: 1px solid var(--line); border-radius: 0.8rem; padding: 0.7rem 0.8rem; background: var(--bg-raised); }
.tl-stat__label { font-family: var(--font-label); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bone-dim); }
.tl-stat__value { font-family: var(--font-display); font-size: 1.6rem; color: var(--bone); }
.tl-stat--shame .tl-stat__value { color: #f7c2a3; }
.tl-stage-bar { display: flex; height: 0.8rem; border-radius: 999px; overflow: hidden; background: rgba(230, 227, 222, 0.08); margin: 0.3rem 0 0.4rem; }
.tl-stage-bar span { display: block; height: 100%; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; font-size: 0.8rem; color: var(--bone-dim); }
.tl-legend i { display: inline-block; width: 0.65rem; height: 0.65rem; border-radius: 2px; margin-right: 0.3rem; vertical-align: -1px; }
.tl-model { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.4rem 0.7rem; align-items: center; }
.tl-model select { max-width: 10rem; }
.tl-model__links { grid-column: 1 / -1; font-size: 0.85rem; color: var(--bone-dim); }
.tl-model__links a { color: var(--bone-soft); }
/* Scheme builder */
.tl-scheme { display: grid; gap: 1rem; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: start; }
@media (max-width: 860px) { .tl-scheme { grid-template-columns: minmax(0, 1fr); } }
.tl-figure { background: radial-gradient(circle at 50% 35%, #2a2622, #12100e 70%); border-radius: var(--radius); border: 1px solid var(--line); padding: 0.75rem; }
.tl-figure svg { display: block; width: 100%; height: auto; max-height: 34rem; }
@media (max-width: 860px) { .tl-figure svg { max-height: 24rem; } }
.tl-figure [data-zone] { cursor: pointer; }
.tl-figure [data-zone] .z-fill, .tl-figure [data-zone] .z-main { transition: filter 0.15s; }
.tl-figure [data-zone]:hover .z-fill, .tl-figure [data-zone]:hover .z-main { filter: brightness(1.14); }
.tl-figure [data-zone].is-selected .z-main { stroke: #f6f1e8; stroke-width: 2.4px; stroke-linejoin: round; }
.tl-fig-switch { display: flex; gap: 0.35rem; margin: 0 0 0.65rem; }
.tl-fig-switch__btn {
  flex: 1; appearance: none; border: 1px solid var(--line); background: transparent;
  color: var(--bone-soft, #c8c2b8); font: inherit; font-size: 0.78rem; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 0.45rem 0.5rem; border-radius: 999px; cursor: pointer;
}
.tl-fig-switch__btn.is-on { background: var(--bone); color: var(--bg); border-color: var(--bone); }
.tl-zone-list .tl-item { cursor: pointer; }
.tl-zone-list .tl-item.is-selected { border-color: var(--bone); }
/* Timeline */
.tl-photos { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }
.tl-photo { border: 1px solid var(--line); border-radius: 0.8rem; overflow: hidden; background: var(--bg-raised); }
.tl-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #000; }
.tl-photo__body { padding: 0.5rem 0.65rem 0.65rem; font-size: 0.88rem; }
.tl-ba { position: relative; width: 100%; max-width: 40rem; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: #000; border: 1px solid var(--line); user-select: none; touch-action: pan-y; }
.tl-ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tl-ba__after { clip-path: inset(0 0 0 50%); }
.tl-ba__handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, 0.6); pointer-events: none; }
.tl-ba__handle::after { content: "⇆"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 2.2rem; height: 2.2rem; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center; font-weight: 700; }
.tl-ba__label { position: absolute; top: 0.5rem; padding: 0.15rem 0.5rem; border-radius: 999px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 0.8rem; }
.tl-ba__label--l { left: 0.5rem; }
.tl-ba__label--r { right: 0.5rem; }
.tl-ba-range { width: 100%; max-width: 40rem; margin-top: 0.5rem; }
.tl-share { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.8rem; overflow-wrap: anywhere; }
/* Quote calculator */
.tl-qc-sizes { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.tl-qc-size { border: 1px solid var(--line); border-radius: 0.8rem; padding: 0.7rem 0.8rem; background: var(--bg-raised); }
.tl-qc-size input { width: 100%; }
.tl-choices { display: grid; gap: 0.45rem; }
.tl-choice { display: flex; gap: 0.6rem; align-items: flex-start; border: 1px solid var(--line); border-radius: 0.7rem; padding: 0.55rem 0.7rem; cursor: pointer; }
.tl-choice input { margin-top: 0.25rem; accent-color: #d6b668; }
.tl-choice:has(input:checked) { border-color: #d6b668; background: rgba(214, 182, 104, 0.08); }
.tl-estimate { position: sticky; top: calc(var(--header-h) + 1rem); }
.tl-estimate__total { font-family: var(--font-display); font-size: 2.4rem; color: var(--bone); margin: 0.2rem 0; }
.tl-estimate table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tl-estimate td { padding: 0.3rem 0; border-bottom: 1px solid var(--line); color: var(--bone-soft); }
.tl-estimate td:last-child { text-align: right; color: var(--bone); white-space: nowrap; }
/* Premium page */
.pm-plans { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin: 1.25rem 0; }
.pm-plan { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-card); padding: 1.3rem 1.2rem; display: flex; flex-direction: column; gap: 0.6rem; }
.pm-plan--featured { border-color: #d6b668; box-shadow: 0 0 0 1px rgba(214, 182, 104, 0.35), var(--shadow); }
.pm-plan__name { font-family: var(--font-label); letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.8rem; color: var(--bone-soft); }
.pm-plan__price { font-family: var(--font-display); font-size: 2.6rem; color: var(--bone); line-height: 1; }
.pm-plan__price small { font-size: 1rem; color: var(--bone-dim); }
.pm-plan ul { margin: 0.2rem 0 0.6rem; padding-left: 1.1rem; color: var(--bone-soft); }
.pm-plan li { margin: 0.25rem 0; }
.pm-plan .btn { margin-top: auto; text-align: center; }
.pm-compare { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.pm-compare th, .pm-compare td { padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.pm-compare th { font-family: var(--font-label); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bone-dim); }
.pm-compare td:nth-child(n+2) { white-space: nowrap; }
.pm-placeholder { border: 1px dashed #d6b668; color: #f2dc9b; padding: 0.5rem 0.8rem; border-radius: 0.6rem; font-size: 0.9rem; display: inline-block; }
.tl-table-wrap { overflow-x: auto; }
.tl-demo { border: 1px dashed var(--line-strong); border-radius: 0.8rem; padding: 0.6rem 0.8rem; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; font-size: 0.92rem; color: var(--bone-soft); }
@media (max-width: 560px) {
  .tl-panel { padding: 0.9rem 0.85rem; }
  .tl-item { gap: 0.5rem; padding: 0.5rem; }
  .tl-estimate { position: static; }
  .pm-plan__price { font-size: 2.2rem; }
}
.btn[hidden] { display: none !important; }
.recipe-step.is-missing-paint { box-shadow: inset 3px 0 0 #d98e64; }
.tools-page .field input[type="color"] { padding: 0.2rem; height: 2.7rem; min-width: 3.4rem; cursor: pointer; }
.tl-qc-size input, .tl-model select {
  background: #0d0c0b; color: var(--bone); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.55rem 0.7rem; font: inherit; line-height: 1.3;
}
.tl-model select { padding: 0.35rem 0.5rem; font-size: 0.9rem; }
.tl-range, .tl-ba-range { accent-color: #d6b668; }
.tools-page .field input[type="file"] { padding: 0.5rem; }
.field[hidden], .tl-panel [hidden] { display: none !important; }

/* Small-screen polish for member tools and Premium (no layout redesign) */
@media (max-width: 560px) {
  .tools-page input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="hidden"]):not([type="range"]),
  .tools-page select,
  .tools-page textarea {
    font-size: 16px;
    min-height: 44px;
  }

  .tools-page .btn,
  .pm-plan .btn {
    min-height: 44px;
  }

  /* "What you get" comparison becomes stacked cards so it doesn't scroll sideways */
  .pm-compare thead { display: none; }

  .pm-compare,
  .pm-compare tbody,
  .pm-compare tr,
  .pm-compare th,
  .pm-compare td {
    display: block;
    width: 100%;
  }

  .pm-compare tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.85rem 0.9rem;
    margin: 0 0 0.75rem;
    background: #0f0d0c;
  }

  .pm-compare td {
    border: 0;
    padding: 0.35rem 0;
    white-space: normal;
  }

  .pm-compare td:first-child {
    font-weight: 700;
    color: var(--bone);
    padding-top: 0;
    padding-bottom: 0.45rem;
  }

  .pm-compare td:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.15rem;
    font-family: var(--font-label);
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bone-dim);
  }

  .pm-compare td:not(:first-child) {
    border-top: 1px solid var(--line);
    padding-top: 0.5rem;
  }

  .tl-table-wrap { overflow: visible; }
}
