/* Kula Equipment's page. The Kula Bright tokens are copied (not imported) from
   Kula's widget theme (kula-intelligence packages/kula-widgets/src/theme.css,
   itself from packages/kula-ui), so the page looks as the screen did inside
   Kula. Keep them in step when the brand changes. */

:root {
  color-scheme: light dark;

  /* --- SAND : warm neutral spine (paper → ink) --- */
  --sand-50: #fcfaf5;
  --sand-100: #f7f1e7;
  --sand-200: #eee5d5;
  --sand-300: #e1d3bc;
  --sand-400: #cbb897;
  --sand-500: #ae9a74;
  --sand-600: #8a7857;
  --sand-700: #685a42;
  --sand-800: #463d2e;
  --sand-900: #2b251c;

  /* --- LAGOON : turquoise primary --- */
  --lagoon-50: #e7f7f4;
  --lagoon-100: #c7ece6;
  --lagoon-300: #5fc8bb;
  --lagoon-500: #199386;
  --lagoon-600: #11786d;
  --lagoon-700: #0e5f57;

  /* --- CORAL : soft warm danger --- */
  --coral-100: #f8e2d9;
  --coral-300: #e0a38c;
  --coral-400: #cc7355;
  --coral-500: #b0573b;

  --white: #ffffff;

  /* --- Semantic aliases (light) --- */
  --surface-page: var(--sand-50);
  --surface-raised: #ffffff;
  --surface-sunk: var(--sand-100);
  --text-strong: var(--sand-900);
  --text-body: var(--sand-800);
  --text-muted: var(--sand-600);
  --brand: var(--lagoon-500);
  /* A filled action: white on lagoon-600 reads at 5.2:1 (lagoon-500 is 3.8:1). */
  --brand-fill: var(--lagoon-600);
  --brand-soft: var(--lagoon-50);
  --hairline: rgba(138, 120, 87, 0.16);
  --border-base: rgba(174, 154, 116, 0.46);
  /* A problem is coral, never lagoon. */
  --problem: var(--coral-500);
  --problem-fill: var(--coral-500);
  --problem-soft: var(--coral-100);

  --radius-sm: 10px;
  --radius-md: 14px;
  --shadow-sm: 0 1px 3px rgba(75, 61, 46, 0.07), 0 1px 2px rgba(75, 61, 46, 0.05);
}

/* Dark: only the surfaces and text flip; the brand stays. */
@media (prefers-color-scheme: dark) {
  :root {
    --surface-page: var(--sand-900);
    --surface-raised: var(--sand-800);
    --surface-sunk: #211c15;
    --text-strong: var(--sand-50);
    --text-body: var(--sand-100);
    --text-muted: var(--sand-300);
    --brand-soft: #13302d;
    --hairline: rgba(247, 241, 231, 0.1);
    --border-base: rgba(203, 184, 151, 0.28);
    --problem: var(--coral-300);
    --problem-soft: #3a241b;
    --shadow-sm: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-body);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}
a { color: var(--brand-fill); }
@media (prefers-color-scheme: dark) { a { color: var(--lagoon-300); } }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
h1, h2 { margin: 0; font: inherit; }

/* ---- the page: 16px gutters on a phone, about 960px wide on a laptop ---- */
.shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left));
}
.boot { padding-top: 32px; }
.boot .top-app { display: block; margin-bottom: 8px; }

.top {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-page);
  border-bottom: 1px solid var(--hairline);
}
.top-in {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 8px 16px;
  flex-wrap: wrap;
}
.top-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1 1 auto; }
.top-app { font-size: 17px; font-weight: 700; color: var(--text-strong); white-space: nowrap; }
.top-studio, .top-person { color: var(--text-muted); font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-who { display: flex; align-items: center; gap: 4px; min-width: 0; margin-left: auto; }
.top-out { margin: 0; }

.eq-note {
  background: var(--surface-sunk);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 14px;
}

/* ---- the screens (the widget's own rules, at a page's sizes) ---- */
.eq { font-size: 14px; color: var(--text-body); }
.eq-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.eq-tab { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--hairline); background: var(--surface-raised); color: var(--text-body); font: inherit; font-size: 14px; cursor: pointer; }
.eq-tab[aria-selected="true"] { background: var(--brand-fill); border-color: var(--brand-fill); color: #fff; }
.eq-card { border: 1px solid var(--hairline); border-radius: var(--radius-md); background: var(--surface-raised); box-shadow: var(--shadow-sm); padding: 10px 12px; margin-bottom: 8px; }
.eq-card.out { border-left: 3px solid var(--coral-500); }
.eq-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.eq-row > * { min-width: 0; max-width: 100%; }
.eq-nowrap { flex-wrap: nowrap; }
.eq-between { justify-content: space-between; }
.eq-bar { margin-bottom: 10px; }
.eq-chips { margin-bottom: 6px; }
.eq-gap { margin-top: 8px; }
.eq-grow { flex: 1 1 160px; }
.eq-wide { flex: 1 1 100%; }
.eq-num { width: 72px; flex: 0 0 auto; }
.eq-line { padding: 6px 0; border-bottom: 1px solid var(--hairline); }
.eq-pager { margin-top: 10px; }
.eq-empty { padding: 12px 0; }
.eq-title { margin: 6px 0 2px; }
.eq-name { font-size: 15px; font-weight: 700; color: var(--text-strong); }
.eq-sub { font-size: 15px; display: block; }
.eq-big { font-size: 20px; line-height: 1.3; }
.eq-muted { color: var(--text-muted); font-size: 13px; }
.eq-pre { white-space: pre-wrap; }
.eq-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; background: var(--surface-sunk); color: var(--text-body); white-space: nowrap; }
.eq-pill.bad { background: var(--problem-fill); color: #fff; }

.eq-btn { padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-base); background: var(--surface-raised); color: var(--text-body); font: inherit; font-size: 14px; cursor: pointer; }
.eq-btn.primary { background: var(--brand-fill); border-color: var(--brand-fill); color: #fff; }
.eq-btn.danger { background: var(--problem-fill); border-color: var(--problem-fill); color: #fff; }
.eq-btn.quiet { border-color: transparent; background: transparent; color: var(--text-muted); }
.eq-btn:disabled { opacity: .5; cursor: default; }
.eq-link { padding: 0; border: 0; background: none; font: inherit; color: var(--brand-fill); cursor: pointer; text-align: left; }
.eq-link.eq-name { color: var(--text-strong); }
.eq-link:hover { text-decoration: underline; }
@media (prefers-color-scheme: dark) { .eq-link { color: var(--lagoon-300); } .eq-link.eq-name { color: var(--text-strong); } }
.eq-back { margin-bottom: 4px; font-size: 14px; }
.eq-confirm { background: var(--problem-soft); border-radius: var(--radius-sm); padding: 6px 10px; }

.eq-input, .eq-select, .eq-text { padding: 7px 10px; border: 1px solid var(--border-base); border-radius: var(--radius-sm); background: var(--surface-page); color: var(--text-body); font: inherit; font-size: 14px; }
.eq-input { min-width: 0; }
.eq-select { max-width: 100%; }
.eq-text { display: block; width: 100%; resize: vertical; }
.eq-file { max-width: 100%; }
.eq-file input[type="file"], input[type="file"].eq-file { max-width: 100%; font-size: 13px; }
.eq-check { width: 18px; height: 18px; margin: 0; accent-color: var(--brand-fill); }

.eq-chip { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--hairline); background: var(--surface-raised); color: var(--text-body); font: inherit; font-size: 13px; cursor: pointer; }
.eq-chip[aria-pressed="true"] { background: var(--brand-fill); border-color: var(--brand-fill); color: #fff; }
.eq-chip[aria-pressed="true"] .eq-muted { color: #fff; }

.eq-photos { display: flex; flex-wrap: wrap; gap: 10px; }
.eq-photo { margin: 0; flex: 1 1 220px; max-width: 100%; }
.eq-thumb { max-width: 100%; width: 240px; max-height: 180px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--hairline); display: block; margin-bottom: 4px; }

.eq-scroll { overflow-x: auto; margin-top: 8px; }
.eq-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.eq-table td, .eq-table th { border-bottom: 1px solid var(--hairline); padding: 4px 6px; text-align: left; }
.eq-err { color: var(--problem); font-size: 13px; margin: 4px 0; }
.eq-h { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin: 18px 0 6px; }
.eq-step { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.eq-step.done { color: var(--text-muted); }
.eq-tick { width: 20px; flex: 0 0 20px; text-align: center; }

/* On a touch screen: fields at 16px (iOS zooms the page on a smaller one) and
   targets a finger can hit. */
@media (pointer: coarse) {
  .eq-input, .eq-select, .eq-text { font-size: 16px; }
  .eq-btn, .eq-tab { min-height: 40px; }
  .eq-chip { min-height: 34px; }
}

/* A phone: a field that grows takes the whole line, so none pushes the page sideways. */
@media (max-width: 560px) {
  .eq-input.eq-grow { flex-basis: 100%; }
  .eq-tabs { gap: 4px; }
  .eq-tab { padding: 6px 10px; }
}
