/* ============================================================================
   Patram — पत्रम् · on-device document studio
   Concept: a digital palm-leaf scriptorium (tāla-patra). Palette named for the
   pigments of Indian manuscripts — haldi (turmeric), sindoor (vermilion),
   neel (indigo), mehendi (henna) — inked on an aged palm-leaf ground.
   Type: Rozha One (display) · Mukta / ITF (body) · JetBrains Mono (data)
   ========================================================================== */
:root {
  /* palm-leaf ground + inks */
  --paper: #e9d3a3;
  --folio: #f4e7c6;
  --surface: #fbf3dc;
  --surface-2: #f3e6c3;
  --inset: #efdfb8;
  --ink: #2c1e12;
  --ink-2: #6f5636;
  --ink-3: #a08961;
  --line: #ddc794;
  --line-2: #cbae72;

  /* pigments */
  --gold: #b6862c;
  --gold-2: #8f6717;
  --sindoor: #c0261d;
  --sindoor-press: #98170f;
  --sindoor-wash: #f7ddce;
  --haldi: #e79310;
  --haldi-2: #cf7d06;
  --haldi-wash: #fbe7bc;
  --neel: #1d3a63;
  --neel-ink: #122240;
  --mehendi: #4c7a2f;
  --mehendi-wash: #e6efc9;
  --maroon: #7c1512;
  --maroon-wash: #f4dbd2;

  --r-card: 12px;
  --r-ctrl: 9px;
  --shadow: 0 1px 2px rgba(70,44,10,.07), 0 8px 22px rgba(90,60,18,.10);
  --shadow-lg: 0 16px 44px rgba(70,44,10,.20);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Mukta", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --display: "Rozha One", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  /* subtle jaali (lattice) weave in gilt */
  background-image:
    repeating-linear-gradient(45deg,  rgba(143,103,23,.06) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(-45deg, rgba(143,103,23,.06) 0 1px, transparent 1px 24px);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--neel); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: var(--haldi); }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 400; letter-spacing: 0; }

.mono { font-family: var(--mono); }
.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-2);
}

/* ---- app shell ---------------------------------------------------------- */
.app { max-width: 1240px; margin: 0 auto; padding: 0 20px 60px; }

.topbar {
  position: relative;
  display: flex; align-items: center; gap: 20px;
  padding: 22px 4px 20px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
/* toran — a marigold-and-vermilion festoon strung beneath the header */
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 11px;
  background:
    linear-gradient(135deg, var(--sindoor) 25%, transparent 25%) -9px 0,
    linear-gradient(225deg, var(--sindoor) 25%, transparent 25%) -9px 0;
  background-size: 18px 11px; background-repeat: repeat-x;
  border-top: 2px solid var(--gold);
  filter: drop-shadow(0 2px 1px rgba(90,60,18,.18));
}

.wordmark { display: flex; align-items: center; gap: 12px; }
.glyph {
  width: 40px; height: 40px; border-radius: 11px;
  background: linear-gradient(150deg, var(--haldi), var(--sindoor));
  color: #fdf3d8;
  display: grid; place-items: center;
  font-family: var(--sans); font-weight: 700; font-size: 22px; line-height: 1;
  box-shadow: 0 0 0 1px var(--gold), inset 0 0 0 1px rgba(255,255,255,.28), 0 4px 12px rgba(192,38,29,.28);
}
.wordmark b { font-family: var(--display); font-weight: 400; font-size: 25px; letter-spacing: .01em; color: var(--ink); }
.wordmark .tld { color: var(--gold-2); font-size: 18px; }
.wordmark small { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--ink-3); text-transform: uppercase; margin-top: 1px; }

/* runtime readout — a quiet status line, no chrome */
.runtime {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
}
.led {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-3); flex: none;
  transition: background .3s;
}
.runtime[data-state="booting"] .led { background: var(--haldi); animation: pulse 1.1s ease-in-out infinite; }
.runtime[data-state="ready"] .led,
.runtime[data-state="busy"] .led { background: var(--mehendi); }
.runtime[data-state="busy"] .led { animation: pulse .9s ease-in-out infinite; }
.runtime[data-state="error"] .led { background: var(--sindoor); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.runtime .rt-msg { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40ch; }

/* ---- layout ------------------------------------------------------------- */
.studio { display: grid; grid-template-columns: 308px 1fr; gap: 24px; align-items: start; }
.main-col { min-width: 0; }

/* ---- hero / identity panel (persistent, sticky) ------------------------- */
.hero-panel {
  position: sticky; top: 16px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-card);
  box-shadow: var(--shadow), inset 0 0 0 4px var(--surface), inset 0 0 0 5px rgba(182,134,44,.28);
  padding: 26px 24px;
}
.hero-panel .seal { width: 104px; margin: 0 0 14px; }
.hero-panel h1 { font-size: clamp(25px, 2.1vw, 31px); line-height: 1.1; margin: 10px 0 0; color: var(--ink); }
.hero-panel h1 .u { color: var(--sindoor); position: relative; white-space: nowrap; }
.hero-panel h1 .u::after { content: ""; position: absolute; left: 0; right: 0; bottom: -.06em; height: 3px; background: linear-gradient(90deg, var(--haldi), var(--sindoor)); border-radius: 3px; }
.hero-panel .lede { color: var(--ink-2); font-size: 14.5px; line-height: 1.5; margin: 14px 0 0; }
.hero-panel .origin { margin: 14px 0 0; font-size: 12.5px; color: var(--ink-2); border-left: 2px solid var(--gold); padding-left: 12px; font-style: italic; }
.hero-panel .origin b { font-style: normal; font-family: var(--display); color: var(--sindoor-press); }

/* mandala seal — the signature */
.seal { width: 100%; max-width: 210px; }
.seal svg { width: 100%; height: auto; display: block; }
.seal .rot { transform-box: fill-box; transform-origin: center; animation: mandala 90s linear infinite; }
@keyframes mandala { to { transform: rotate(360deg); } }

/* boot readout — the inkwell */
.boot-readout {
  margin-top: 18px;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(230,147,16,.10), transparent 60%),
    var(--neel-ink);
  color: #e9dab6;
  border-radius: var(--r-ctrl);
  border: 1px solid #0c1730;
  box-shadow: inset 0 0 0 1px rgba(230,147,16,.14);
  font-family: var(--mono); font-size: 11.5px; line-height: 1.7;
  padding: 14px 16px;
  min-height: 118px;
}
.boot-readout .l { display: block; white-space: pre-wrap; }
.boot-readout .l .ok { color: #9fd07a; }
.boot-readout .l .dim { color: #7085a8; }
.boot-readout .caret { color: var(--haldi); }

.pledges { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.pledge { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: .03em; color: var(--ink-2); }
.pledge svg { width: 14px; height: 14px; color: var(--mehendi); flex: none; }

/* ---- index (illuminated tool discovery) --------------------------------- */
.index-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { font-size: 13px; font-weight: 700; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 9px 16px; white-space: nowrap; transition: color .12s, background .12s, border-color .12s, box-shadow .12s; }
.pill:hover { border-color: var(--gold); }
.pill[aria-current="true"] { color: #fff; background: linear-gradient(135deg, var(--haldi), var(--sindoor)); border-color: var(--gold); box-shadow: 0 4px 12px rgba(192,38,29,.22); }

.search { display: flex; align-items: center; gap: 10px; width: min(300px, 100%); flex: none; background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 16px; box-shadow: var(--shadow), inset 0 0 0 3px var(--surface), inset 0 0 0 4px rgba(182,134,44,.28); }
.search .si { color: var(--sindoor); display: grid; place-items: center; flex: none; }
.search .si svg { width: 17px; height: 17px; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font-family: var(--sans); font-size: 15px; color: var(--ink); outline: none; padding: 9px 0; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search .kbd { font-family: var(--mono); font-size: 11px; color: var(--ink-2); background: var(--inset); border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 7px; flex: none; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 14px; }
.tool-card { position: relative; text-align: left; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-card); padding: 16px; box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 5px rgba(182,134,44,.24); transition: transform .12s, box-shadow .12s; display: flex; flex-direction: column; gap: 10px; }
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow), inset 0 0 0 4px var(--surface), inset 0 0 0 5px var(--sindoor); }
.tool-card .fol { position: absolute; top: 12px; right: 14px; font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
.tool-card .ico { width: 38px; height: 38px; border-radius: 10px; background: var(--haldi-wash); color: var(--sindoor); display: grid; place-items: center; }
.tool-card .ico svg { width: 19px; height: 19px; }
.tool-card .nm { font-weight: 700; font-size: 15px; color: var(--ink); }
.tool-card .ds { font-size: 12.5px; color: var(--ink-2); line-height: 1.4; }

.empty { text-align: center; color: var(--ink-3); font-family: var(--mono); font-size: 13px; padding: 48px 0; }

.back { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 14px 7px 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 16px; transition: color .12s, border-color .12s; }
.back:hover { color: var(--sindoor); border-color: var(--sindoor); }
.back svg { width: 16px; height: 16px; }

/* ---- workbench ---------------------------------------------------------- */
.stage {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-card);
  box-shadow: var(--shadow), inset 0 0 0 5px var(--surface), inset 0 0 0 6px rgba(182,134,44,.32);
  min-height: 480px;
  padding: 32px 34px;
}

/* tool header */
.tool-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--line); padding-bottom: 18px; margin-bottom: 24px; }
.tool-head h2 { font-size: 27px; color: var(--ink); }
.tool-head p { margin: 6px 0 0; color: var(--ink-2); font-size: 14.5px; max-width: 56ch; font-family: var(--sans); }
.tool-head .badge { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--neel); background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 11px; white-space: nowrap; }
.tool-head .badge.local { color: var(--mehendi); background: var(--mehendi-wash); border-color: #bcd190; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

/* dropzone */
.drop {
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-ctrl);
  background: var(--surface-2);
  padding: 34px 22px;
  text-align: center;
  transition: border-color .15s, background .15s, transform .05s;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.drop:hover { border-color: var(--sindoor); background: var(--haldi-wash); }
.drop.drag { border-color: var(--sindoor); background: var(--haldi-wash); transform: scale(.995); }
.drop .di { width: 42px; height: 42px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--sindoor); box-shadow: 0 0 0 1px rgba(182,134,44,.22); }
.drop .di svg { width: 20px; height: 20px; }
.drop strong { font-size: 14.5px; font-weight: 600; }
.drop .hint { font-size: 12px; color: var(--ink-3); font-family: var(--mono); }

/* file chips / list */
.files { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.file {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-ctrl); padding: 10px 12px;
}
.file .fi { width: 30px; height: 30px; border-radius: 8px; background: var(--haldi-wash); color: var(--sindoor); display: grid; place-items: center; flex: none; }
.file .fi svg { width: 15px; height: 15px; }
.file .meta { min-width: 0; flex: 1; }
.file .name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file .sub { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.file .x { border: 1px solid var(--line-2); background: var(--surface); border-radius: 7px; color: var(--ink-2); width: 26px; height: 26px; display: grid; place-items: center; flex: none; }
.file .x:hover { color: var(--sindoor); border-color: var(--sindoor); }
.file .drag-h { color: var(--ink-3); cursor: grab; flex: none; }
.file[draggable="true"] { cursor: grab; }
.file.dragging { opacity: .5; }

/* controls */
.field { margin-top: 18px; }
.field > label { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-2); margin-bottom: 8px; }
.input, .textarea, select.input {
  width: 100%; font-family: var(--sans); font-size: 14.5px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-ctrl);
  padding: 10px 12px; transition: border-color .12s, box-shadow .12s;
}
.textarea { font-family: var(--mono); font-size: 13px; line-height: 1.6; min-height: 220px; resize: vertical; }
.input:focus, .textarea:focus, select.input:focus, .row-inputs input:focus { outline: none; border-color: var(--sindoor); box-shadow: 0 0 0 3px var(--sindoor-wash); }
.row-inputs { display: flex; gap: 10px; align-items: center; }
.row-inputs input { width: 100%; font-family: var(--mono); font-size: 14px; text-align: center; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-ctrl); padding: 10px; color: var(--ink); }
.row-inputs span { font-family: var(--mono); color: var(--ink-3); font-size: 12px; }

/* segmented / option cards */
.options { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 520px) { .options { grid-template-columns: 1fr; } }
.opt {
  text-align: left; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-ctrl); padding: 12px; transition: border-color .12s, background .12s, box-shadow .12s;
}
.opt:hover { border-color: var(--gold); background: var(--surface-2); }
.opt[aria-pressed="true"] { border-color: var(--sindoor); background: var(--haldi-wash); box-shadow: 0 0 0 1px var(--sindoor) inset; }
.opt .ot { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-2); }
.opt .on { font-weight: 700; font-size: 14.5px; margin-top: 3px; }
.opt .od { font-size: 12px; color: var(--ink-2); margin-top: 3px; line-height: 1.4; }

/* primary run button — a lit marigold-to-vermilion flame */
.run {
  margin-top: 22px; width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: linear-gradient(135deg, var(--haldi), var(--sindoor));
  color: #fdf3d8; border: 0;
  border-radius: var(--r-ctrl); padding: 13px 18px;
  font-size: 14.5px; font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 0 0 1px var(--gold), 0 1px 2px rgba(152,23,15,.35), 0 8px 20px rgba(192,38,29,.24);
  transition: filter .12s, transform .05s, opacity .12s;
}
.run:hover { filter: brightness(1.06) saturate(1.05); }
.run:active { transform: translateY(1px); }
.run:disabled { opacity: .45; cursor: not-allowed; box-shadow: 0 0 0 1px var(--line-2); filter: grayscale(.35); }
.run svg { width: 16px; height: 16px; }
.run .spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* result / output panel */
.panel-title { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-2); padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }
.placeholder { border: 1px dashed var(--line-2); background: var(--surface-2); border-radius: var(--r-ctrl); padding: 40px 20px; text-align: center; color: var(--ink-3); min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.placeholder svg { width: 26px; height: 26px; color: var(--line-2); }
.placeholder .pt { font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.placeholder .ps { font-family: var(--mono); font-size: 11px; max-width: 30ch; }

.result {
  border: 1px solid #bcd190; background: linear-gradient(180deg, var(--mehendi-wash), var(--surface));
  border-radius: var(--r-card); padding: 24px; text-align: center;
  box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 5px rgba(76,122,47,.3);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.result .ok-ring { width: 48px; height: 48px; border-radius: 50%; background: var(--surface); border: 1px solid #bcd190; color: var(--mehendi); display: grid; place-items: center; box-shadow: 0 0 0 4px var(--mehendi-wash); }
.result .ok-ring svg { width: 22px; height: 22px; }
.result h4 { font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--ink); }
.stat-row { display: flex; gap: 8px; width: 100%; max-width: 340px; }
.stat { flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px; }
.stat .k { font-family: var(--mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.stat .v { font-family: var(--mono); font-weight: 700; font-size: 13px; margin-top: 3px; color: var(--ink); }
.stat.hi .v { color: var(--mehendi); }
.btn-dl { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--neel); color: #f2e7c8; border: 0; border-radius: var(--r-ctrl); padding: 12px; font-weight: 700; font-size: 13.5px; box-shadow: 0 0 0 1px var(--neel-ink), 0 6px 16px rgba(18,34,64,.22); transition: filter .12s; }
.btn-dl:hover { filter: brightness(1.12); }
.btn-dl svg { width: 15px; height: 15px; }

/* text output */
.text-out { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-ctrl); padding: 14px; font-family: var(--mono); font-size: 12px; line-height: 1.6; white-space: pre-wrap; max-height: 360px; overflow: auto; color: var(--ink); text-align: left; }
.tool-actions { display: flex; gap: 8px; }
.tbtn { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10.5px; font-weight: 600; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; }
.tbtn:hover { color: var(--sindoor); border-color: var(--sindoor); }
.tbtn svg { width: 13px; height: 13px; }

/* gallery (pdf -> images) */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; max-height: 400px; overflow: auto; }
.gallery figure { margin: 0; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: var(--surface); }
.gallery img { display: block; width: 100%; height: auto; }
.gallery figcaption { font-family: var(--mono); font-size: 10px; color: var(--ink-3); padding: 5px 8px; text-align: center; }

/* thumbnails (organize) */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 12px; }
.thumb { position: relative; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.thumb.dragging { opacity: .4; }
.thumb canvas { display: block; width: 100%; height: auto; transition: transform .2s; }
.thumb .tnum { position: absolute; top: 5px; left: 5px; font-family: var(--mono); font-size: 10px; background: rgba(44,30,18,.82); color: #f2e7c8; padding: 2px 6px; border-radius: 5px; }
.thumb .tctl { position: absolute; top: 5px; right: 5px; display: flex; gap: 4px; }
.thumb .tctl button { width: 24px; height: 24px; border-radius: 6px; border: 0; background: rgba(251,243,220,.94); color: var(--ink); display: grid; place-items: center; box-shadow: var(--shadow); }
.thumb .tctl button:hover { background: #fff; color: var(--sindoor); }
.thumb .tctl button.del:hover { color: var(--maroon); }
.thumb .tctl button svg { width: 13px; height: 13px; }

/* progress console — inkwell */
.progress { background: var(--neel-ink); border: 1px solid #0c1730; border-radius: var(--r-ctrl); padding: 14px; margin-top: 16px; box-shadow: inset 0 0 0 1px rgba(230,147,16,.14); }
.progress .plog { font-family: var(--mono); font-size: 11px; line-height: 1.6; color: #e9dab6; height: 120px; overflow: auto; }
.progress .plog .dim { color: #7085a8; }
.bar { height: 5px; background: rgba(255,255,255,.12); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--haldi), var(--sindoor)); border-radius: 999px; transition: width .25s; }
.bar.indeterminate > i { width: 40%; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

/* alerts */
.alert { display: flex; gap: 10px; background: var(--maroon-wash); border: 1px solid #e0a99f; color: var(--maroon); border-radius: var(--r-ctrl); padding: 12px 14px; font-size: 13.5px; margin-top: 16px; }
.alert svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }

/* footer */
.foot { margin-top: 28px; padding: 18px 4px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; color: var(--ink-3); border-top: 1px solid var(--line); }

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

/* tablet & below: the hero folds from a sidebar into a full-width banner */
@media (max-width: 900px) {
  .studio { grid-template-columns: 1fr; gap: 20px; }
  .hero-panel {
    position: static;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 22px; align-items: start;
  }
  .hero-panel .seal { width: 108px; margin: 0; }
  .hero-copy { grid-column: 2; align-self: center; }
  .hero-panel .boot-readout { grid-column: 1 / -1; margin-top: 18px; }
  .hero-panel .pledges { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 8px 16px; }
  .topbar { gap: 14px; }
}

/* landscape phones: search takes the full row, grid drops to two columns */
@media (max-width: 640px) {
  .app { padding: 0 16px 48px; }
  .index-bar { gap: 12px; }
  .search { order: 2; flex: 1 1 100%; width: 100%; }
  .pills {
    order: 1; flex: 0 0 100%; flex-wrap: nowrap; overflow-x: auto;
    margin: 0 -16px; padding: 0 16px 4px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .pills::-webkit-scrollbar { display: none; }
  .tool-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tool-card { padding: 13px; box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 4px rgba(182,134,44,.24); }
  .tool-card .ico { width: 34px; height: 34px; }
  .tool-card .nm { font-size: 14px; }
  .tool-card .ds { font-size: 11.5px; }
  .runtime { margin-left: 0; }
  .grid2 { gap: 18px; }
  .tool-head h2 { font-size: 23px; }
}

/* portrait phones: hero stacks fully, single-column workbench */
@media (max-width: 520px) {
  .hero-panel { display: block; padding: 22px 18px; }
  .hero-panel .seal { width: 80px; margin-bottom: 12px; }
  .stage { padding: 24px 18px; min-height: 0; }
  .tool-grid { grid-template-columns: 1fr; }
}

/* a11y */
:focus-visible { outline: 2px solid var(--sindoor); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
