/* ============================================================================
   OpsWiki — Module styles
   Landing, auth, SOP runner, rich editor, sheet grid, vault, media.
   ========================================================================== */

/* ============================================================================
   LANDING / AUTH  — the public face, styled to match the Opsynth site
   ========================================================================== */
.landing {
  min-height: 100vh;
  background: var(--page-wash);
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column;
}

/* Diagonal panel seams, lifted from the company site's atmosphere */
.landing::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(115deg, transparent 0 34%, var(--line-soft) 34% 34.1%, transparent 34.1%),
    linear-gradient(115deg, transparent 0 62%, var(--line-soft) 62% 62.1%, transparent 62.1%);
  opacity: 0.85;
}
.landing::after {
  content: ''; position: absolute;
  top: -180px; left: 50%; transform: translateX(-50%);
  width: 760px; height: 460px;
  background: radial-gradient(ellipse, var(--red-glow), transparent 68%);
  pointer-events: none; filter: blur(30px);
}

.landing-nav {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 14px;
  padding: 18px 30px;
  max-width: var(--container); margin-inline: auto; width: 100%;
}
.landing-nav .wordmark { font-size: 1.16rem; }
.landing-nav .ow-logo { width: 30px; height: 30px; }

.landing-hero {
  position: relative; z-index: 2;
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 50px 24px 70px;
  max-width: 900px; margin-inline: auto;
}

.hero-logo {
  width: 92px; height: 92px;
  margin-bottom: 28px;
  filter: drop-shadow(0 18px 40px rgba(20, 20, 30, 0.22))
          drop-shadow(0 4px 12px var(--red-glow));
  animation: hero-rise 700ms var(--ease) both;
}

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(18px) scale(0.9); }
  to   { opacity: 1; transform: none; }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  font-weight: 300;
  letter-spacing: -0.045em;
  line-height: 1.03;
  color: var(--ink);
  margin-bottom: 20px;
}
.hero-title strong { font-weight: 800; color: var(--red); }

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.16rem);
  color: var(--ink-soft);
  max-width: 620px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.hero-kicker {
  font-size: 1rem;
  color: var(--ink-soft);
  margin-bottom: 32px;
}
.hero-kicker em { font-style: italic; font-weight: 700; color: var(--ink); }

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.landing-features {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 30px 60px;
  width: 100%;
}

.feature {
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--med);
}
.feature:hover { border-color: var(--red); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.feature-icon {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--red-mute); color: var(--red);
  margin-bottom: 12px;
}
.feature-icon svg { width: 18px; height: 18px; }
.feature h3 { font-size: 0.98rem; margin-bottom: 5px; }
.feature p { font-size: 0.85rem; color: var(--ink-mute); line-height: 1.55; }

.landing-foot {
  position: relative; z-index: 2;
  border-top: 1px solid var(--line);
  padding: 22px 30px;
  text-align: center;
  font-size: 0.83rem;
  color: var(--ink-mute);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.landing-foot strong { color: var(--ink-soft); font-weight: 700; }

/* ---- Auth card ---------------------------------------------------------- */
.auth-wrap {
  min-height: 100vh;
  background: var(--page-wash);
  display: grid; place-items: center;
  padding: 24px;
  position: relative;
}
.auth-card {
  width: 100%; max-width: 410px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  position: relative; z-index: 2;
  animation: modal-in 300ms var(--ease);
}
.auth-card .hero-logo { width: 52px; height: 52px; margin: 0 auto 18px; }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 22px; background: var(--surface-2);
             padding: 4px; border-radius: 999px; }
.auth-tabs button {
  flex: 1; padding: 8px; border: none; background: none;
  border-radius: 999px; cursor: pointer;
  font-family: inherit; font-size: 0.86rem; font-weight: 600;
  color: var(--ink-mute); transition: all var(--fast);
}
.auth-tabs button.on { background: var(--bg-pure); color: var(--ink); box-shadow: var(--shadow-sm); }


/* ============================================================================
   SOP — detail view
   ========================================================================== */
.sop-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.sop-hero::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--red), var(--red-bright), transparent);
}

.sop-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}
.sop-meta-item .k {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--ink-faint); margin-bottom: 3px;
}
.sop-meta-item .v { font-size: 0.88rem; color: var(--ink); font-weight: 500; }

/* The big red call to action */
.run-cta {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 22px;
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  border-radius: var(--radius-lg);
  color: #fff;
  margin-bottom: 20px;
  box-shadow: 0 14px 34px -12px var(--red-glow);
  flex-wrap: wrap;
}
.run-cta > svg { width: 24px; height: 24px; }
.run-cta h3 { color: #fff; font-size: 1.05rem; margin-bottom: 2px; }
.run-cta p { color: rgba(255,255,255,0.85); font-size: 0.85rem; }
.run-cta .btn {
  background: #fff; color: var(--red-deep); border-color: #fff; font-weight: 700;
}
.run-cta .btn:hover:not(:disabled) { background: #fff; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,0.2); }

/* Step list in read mode */
.step {
  display: flex; gap: 15px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
}
.step:last-child { border-bottom: none; }
.step-num {
  width: 30px; height: 30px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--red-mute); color: var(--red);
  font-family: var(--font-mono); font-weight: 600; font-size: 0.82rem;
}
.step-title { font-weight: 700; font-size: 0.98rem; color: var(--ink); margin-bottom: 6px; }
.step-body { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.65; }

.step-warning {
  display: flex; gap: 9px;
  margin-top: 11px;
  padding: 10px 13px;
  background: var(--warn-bg);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  color: var(--ink);
  line-height: 1.5;
}
.step-warning svg { width: 15px; height: 15px; flex: none; color: var(--warn); margin-top: 2px; }


/* ============================================================================
   SOP RUNNER  — "I'm going to do this now"
   Full-screen, focused, everything persists as you tick.
   ========================================================================== */
.runner {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 150;
  display: flex; flex-direction: column;
  animation: fade-in 200ms var(--ease);
}

.runner-top {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.runner-title { font-family: var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: -0.025em; }

.runner-timer {
  font-family: var(--font-mono);
  font-size: 0.94rem; font-weight: 600;
  color: var(--red);
  background: var(--red-mute);
  padding: 5px 12px;
  border-radius: 999px;
  display: flex; align-items: center; gap: 7px;
}
.runner-timer::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--red);
  animation: pulse 1.8s var(--ease) infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }

.runner-progress-wrap { padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.runner-progress-wrap .progress { border-radius: 0; border: none; height: 4px; }

.runner-body {
  flex: 1;
  overflow-y: auto;
  padding: 26px 20px 120px;
}
.runner-inner { max-width: 780px; margin-inline: auto; }

/* One checklist item */
.check-step {
  display: flex; gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  transition: all var(--med);
}
.check-step.current {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-mute), var(--shadow-md);
}
.check-step.done { opacity: 0.62; background: var(--surface-2); }
.check-step.done .check-step-title {
  text-decoration: line-through;
  text-decoration-color: var(--ink-faint);
  color: var(--ink-mute);
}

.check-box {
  width: 26px; height: 26px; flex: none;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: all var(--fast);
  background: var(--bg-pure);
  margin-top: 1px;
}
.check-box:hover { border-color: var(--red); background: var(--red-mute); }
.check-box svg { width: 15px; height: 15px; color: #fff; opacity: 0; transition: opacity var(--fast); stroke-width: 3; }
.check-box.on { background: var(--red); border-color: var(--red); }
.check-box.on svg { opacity: 1; }

.check-step-title { font-weight: 700; font-size: 0.96rem; color: var(--ink); }
.check-step-body {
  font-size: 0.89rem; color: var(--ink-soft); line-height: 1.65; margin-top: 7px;
}
.check-step-body img, .check-step-body video { border-radius: var(--radius-sm); margin: 10px 0; }

.step-note-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px;
  padding: 4px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  background: none; cursor: pointer;
  font-family: inherit; font-size: 0.76rem; font-weight: 600;
  color: var(--ink-mute);
  transition: all var(--fast);
}
.step-note-btn:hover { border-color: var(--red); color: var(--red); border-style: solid; }
.step-note-btn.has-note { border-style: solid; border-color: var(--info); color: var(--info); background: var(--info-bg); }

.step-note-text {
  margin-top: 9px; padding: 9px 12px;
  background: var(--info-bg);
  border-radius: var(--radius-sm);
  font-size: 0.83rem; color: var(--ink);
  border-left: 3px solid var(--info);
  line-height: 1.5;
}

.runner-foot {
  position: fixed; bottom: 0; left: 0; right: 0;
  padding: 14px 20px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  z-index: 2;
}
.runner-count { font-family: var(--font-mono); font-size: 0.86rem; color: var(--ink-mute); }

/* Run history rows */
.run-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.86rem;
}
.run-row:last-child { border-bottom: none; }
.run-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.run-dot.completed   { background: var(--ok); }
.run-dot.in_progress { background: var(--warn); animation: pulse 1.8s infinite; }
.run-dot.abandoned   { background: var(--ink-faint); }


/* ============================================================================
   RICH TEXT EDITOR
   ========================================================================== */
.editor-toolbar {
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
  padding: 7px 9px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  position: sticky; top: var(--topbar-h); z-index: 10;
}
.editor-toolbar .sep { width: 1px; height: 20px; background: var(--line-strong); margin: 0 4px; }

.tb-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: none; background: none;
  border-radius: 6px;
  color: var(--ink-soft); cursor: pointer;
  transition: all var(--fast);
}
.tb-btn:hover { background: var(--surface-hover); color: var(--ink); }
.tb-btn.on { background: var(--red-mute); color: var(--red); }
.tb-btn svg { width: 15px; height: 15px; }
.tb-btn.wide { width: auto; padding: 0 9px; font-size: 0.78rem; font-weight: 700; }

.editor-area {
  min-height: 300px;
  padding: 18px 20px;
  background: var(--bg-pure);
  border: 1px solid var(--line-strong);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  outline: none;
  font-size: 0.94rem;
  line-height: 1.7;
  color: var(--ink);
}
.editor-area:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-mute); }
.editor-area:empty::before {
  content: attr(data-placeholder);
  color: var(--ink-faint);
  pointer-events: none;
}
.editor-area.compact { min-height: 110px; padding: 12px 14px; font-size: 0.89rem; }

/* Rendered rich content, both in the editor and read-only views */
.rich h1, .rich h2, .rich h3 { margin: 1.1em 0 0.45em; }
.rich h1 { font-size: 1.5rem; } .rich h2 { font-size: 1.25rem; } .rich h3 { font-size: 1.08rem; }
.rich p { margin: 0.65em 0; color: var(--ink-soft); }
.rich ul, .rich ol { margin: 0.65em 0; padding-left: 1.5em; }
.rich li { margin: 0.3em 0; color: var(--ink-soft); }
.rich img { border-radius: var(--radius-sm); margin: 12px 0; border: 1px solid var(--line); }
.rich a { color: var(--red); text-decoration: underline; text-underline-offset: 2px; }
.rich table { margin: 14px 0; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.rich th, .rich td { border: 1px solid var(--line); padding: 8px 11px; text-align: left; }
.rich th { background: var(--surface-2); font-weight: 700; font-size: 0.84rem; }
.rich hr { margin: 20px 0; }
.rich blockquote { margin: 14px 0; }

/* Callout blocks the editor can insert */
.rich .cb {
  display: block;
  padding: 12px 15px;
  border-radius: var(--radius);
  margin: 14px 0;
  font-size: 0.9rem;
  border-left: 3px solid var(--info);
  background: var(--info-bg);
}
.rich .cb-warn   { border-left-color: var(--warn);   background: var(--warn-bg); }
.rich .cb-danger { border-left-color: var(--danger); background: var(--danger-bg); }
.rich .cb-ok     { border-left-color: var(--ok);     background: var(--ok-bg); }

/* ---- Image selection & resizing inside the editor ---------------------- */
.editor-area img { cursor: pointer; }

.editor-area img.img-selected {
  outline: 2px solid var(--red);
  outline-offset: 2px;
  /* The bottom-right corner is the drag target. */
  cursor: nwse-resize;
}

.img-toolbar {
  display: flex; align-items: center; gap: 2px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-pop);
  z-index: 320;
}
.img-toolbar button {
  border: none; background: none;
  padding: 4px 9px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.74rem; font-weight: 700;
  color: var(--ink-soft); cursor: pointer;
  transition: all var(--fast);
  line-height: 1.4;
}
.img-toolbar button:hover { background: var(--red-mute); color: var(--red); }
.img-toolbar button[data-img-del]:hover { background: var(--danger-bg); color: var(--danger); }
.img-toolbar .sep { width: 1px; height: 16px; background: var(--line); margin: 0 3px; }

/* Tables authored in the editor need visible edges while editing. */
.editor-area table { width: 100%; }
.editor-area td, .editor-area th { min-width: 42px; }
.editor-area td:empty::after { content: ''; display: inline-block; min-height: 1em; }

/* Embedded video players */
.embed-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin: 14px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-sunken);
}
.embed-wrap iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%; border: 0;
}


/* ============================================================================
   SHEET GRID
   ========================================================================== */
.sheet-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: none;
}

.formula-bar {
  display: flex; align-items: stretch;
  border: 1px solid var(--line);
  border-bottom: none;
  background: var(--surface-2);
}
.formula-cell-ref {
  width: 84px; flex: none;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600;
  color: var(--ink-soft);
  border-right: 1px solid var(--line);
  background: var(--surface);
}
.formula-input {
  flex: 1;
  border: none; outline: none;
  padding: 8px 12px;
  font-family: var(--font-mono); font-size: 0.84rem;
  background: var(--bg-pure); color: var(--ink);
}

.sheet-scroll {
  overflow: auto;
  max-height: calc(100vh - 260px);
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--bg-pure);
}

/* width:max-content stops the browser stretching 12 columns across the full
   panel, which made every cell absurdly wide on a large screen. */
.sheet-grid {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
}

.sheet-grid th, .sheet-grid td {
  border-right: 1px solid var(--grid-line);
  border-bottom: 1px solid var(--grid-line);
  padding: 0;
  height: 26px;
  font-size: 0.82rem;
}

/* Column and row headers stay put while you scroll */
.sheet-grid thead th {
  position: sticky; top: 0; z-index: 3;
  background: var(--grid-header-bg);
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600;
  color: var(--ink-mute);
  text-align: center;
  user-select: none;
  width: 110px;
  min-width: 110px;
}
.sheet-grid thead th.corner {
  position: sticky; left: 0; z-index: 4;
  width: 44px; min-width: 44px;
}

.sheet-grid tbody th {
  position: sticky; left: 0; z-index: 2;
  background: var(--grid-header-bg);
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600;
  color: var(--ink-mute);
  text-align: center;
  width: 44px; min-width: 44px;
  user-select: none;
}

.sheet-grid td { background: var(--bg-pure); position: relative; }
.sheet-grid td .cell {
  display: block;
  padding: 4px 7px;
  min-height: 26px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: cell;
  line-height: 19px;
  color: var(--ink);
}
.sheet-grid td.sel { box-shadow: inset 0 0 0 2px var(--red); z-index: 1; }
.sheet-grid td.in-range { background: var(--red-mute); }
.sheet-grid td.editing { box-shadow: inset 0 0 0 2px var(--red); }
.sheet-grid td input.cell-edit {
  width: 100%; height: 100%;
  border: none; outline: none;
  padding: 4px 7px;
  font-family: inherit; font-size: 0.83rem;
  background: var(--bg-pure); color: var(--ink);
}

.cell.num  { text-align: right; font-family: var(--font-mono); }
.cell.err  { color: var(--danger); font-family: var(--font-mono); font-size: 0.78rem; }
.cell.bold { font-weight: 700; }
.cell.ital { font-style: italic; }
.cell.a-left { text-align: left; } .cell.a-center { text-align: center; } .cell.a-right { text-align: right; }
.cell.formula-cell { color: var(--ink); }


/* ============================================================================
   VAULT
   ========================================================================== */
.vault-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  transition: background var(--fast);
}
.vault-row:last-child { border-bottom: none; }
.vault-row:hover { background: var(--surface-hover); }

.vault-icon {
  width: 36px; height: 36px; flex: none;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-mute);
  font-family: var(--font-display); font-weight: 700; font-size: 0.86rem;
}

.secret {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  background: var(--code-bg);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--line-soft);
  min-width: 130px;
  display: inline-flex; align-items: center;
}
.secret.masked { letter-spacing: 0.18em; color: var(--ink-faint); }

.pw-strength { height: 4px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.pw-strength div { height: 100%; transition: all var(--med); border-radius: 999px; }
.pw-weak   { width: 33%; background: var(--danger); }
.pw-medium { width: 66%; background: var(--warn); }
.pw-strong { width: 100%; background: var(--ok); }


/* ============================================================================
   MEDIA LIBRARY
   ========================================================================== */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.media-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  transition: all var(--med);
}
.media-card:hover { border-color: var(--red); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.media-thumb {
  aspect-ratio: 16 / 10;
  background: var(--bg-sunken);
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-thumb .ph { color: var(--ink-faint); }
.media-thumb .ph svg { width: 30px; height: 30px; }
.media-kind {
  position: absolute; top: 7px; left: 7px;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(10,10,18,0.72); color: #fff;
  font-size: 0.66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  backdrop-filter: blur(4px);
}
.media-info { padding: 11px 13px; }
.media-info .t { font-weight: 600; font-size: 0.87rem; color: var(--ink); }
.media-info .m { font-size: 0.74rem; color: var(--ink-mute); margin-top: 2px; }

/* Drop zone */
.dropzone {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 34px 22px;
  text-align: center;
  transition: all var(--fast);
  cursor: pointer;
  background: var(--surface-2);
}
.dropzone:hover, .dropzone.over {
  border-color: var(--red);
  background: var(--red-mute);
}
.dropzone svg { width: 28px; height: 28px; color: var(--ink-faint); margin-bottom: 9px; }
.dropzone.over svg { color: var(--red); }

.upload-row {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  font-size: 0.83rem;
  background: var(--surface);
}


/* ============================================================================
   SEARCH PALETTE  (Ctrl+K)
   ========================================================================== */
.palette-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 10, 18, 0.45);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 250;
  display: flex; justify-content: center;
  padding: 12vh 20px 20px;
  animation: fade-in 140ms var(--ease);
}
.palette {
  width: 100%; max-width: 620px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  height: fit-content;
  max-height: 70vh;
  display: flex; flex-direction: column;
  animation: modal-in 180ms var(--ease);
}
.palette-input {
  width: 100%;
  padding: 16px 18px;
  border: none; outline: none;
  border-bottom: 1px solid var(--line);
  font-family: inherit; font-size: 1rem;
  background: none; color: var(--ink);
}
.palette-results { overflow-y: auto; padding: 6px; }
.palette-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--fast);
}
.palette-item:hover, .palette-item.on { background: var(--surface-active); }
.palette-item .pi-icon {
  width: 30px; height: 30px; flex: none;
  border-radius: 9px; display: grid; place-items: center;
  background: var(--red-mute); color: var(--red);
}
.palette-item .pi-icon svg { width: 15px; height: 15px; }
.palette-item .pi-title { font-weight: 600; font-size: 0.89rem; color: var(--ink); }
.palette-item .pi-sub { font-size: 0.76rem; color: var(--ink-mute); }


/* ============================================================================
   PEOPLE / PERMISSIONS
   ========================================================================== */
.perm-table { width: 100%; font-size: 0.85rem; }
.perm-table th {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-mute); font-weight: 700;
  padding: 9px 10px; text-align: center; white-space: nowrap;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.perm-table th:first-child { text-align: left; }
.perm-table td {
  padding: 10px; border-bottom: 1px solid var(--line-soft);
  text-align: center; vertical-align: middle;
}
.perm-table td:first-child { text-align: left; }
.perm-table tbody tr:hover { background: var(--surface-hover); }

.perm-cycle {
  min-width: 62px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-family: inherit; font-size: 0.74rem; font-weight: 700;
  cursor: pointer;
  transition: all var(--fast);
  color: var(--ink-mute);
}
.perm-cycle:hover { border-color: var(--red); }
.perm-cycle[data-v="view"] { background: var(--info-bg); color: var(--info); border-color: transparent; }
.perm-cycle[data-v="edit"] { background: var(--red-mute); color: var(--red); border-color: transparent; }
.perm-cycle:disabled { opacity: 0.55; cursor: not-allowed; }

.handover-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}
.handover-group-head {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-weight: 700; font-size: 0.86rem;
}


/* ============================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  .editor-toolbar { top: 0; }
  .sheet-scroll { max-height: calc(100vh - 300px); }
  .runner-top { padding: 11px 14px; }
  .runner-body { padding: 18px 14px 130px; }
  .landing-nav, .landing-features { padding-inline: 18px; }
}

@media (max-width: 560px) {
  .hero-logo { width: 68px; height: 68px; }
  .run-cta { flex-direction: column; align-items: stretch; text-align: left; }
  .run-cta .btn { width: 100%; }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
