/* =====================================================================
   office2.css — Office workspace styling
   Powers the Overview, the docs / sheets / slides landings, and the editor
   chrome. It owns NO palette of its own: every colour, surface, shadow,
   radius and accent inherits the app design system (app.css tokens —
   --bg, --text, --primary, --surface, --blend, --shadow, --line, --ui-*),
   so the route looks native to the app and follows the active light/dark
   theme exactly like every other route. The only fixed colours left are the
   three brand hues (Docs/Sheets/Slides) and the deliberate slide themes.
   ===================================================================== */

.ov2,
.office-dash,
.office-wrap {
  /* Distinct brand hues for the three apps — tinted onto the app surface,
     never lightened with white (that read as a foreign light theme). */
  --o-doc:   #3b82f6;
  --o-sheet: #22c55e;
  --o-slide: #f59e0b;

  /* Everything structural inherits the app design system, so the office route
     matches every other route and follows the active light / dark theme. */
  --o-accent:  var(--primary);
  --o-bg:      var(--bg);
  --o-surface: var(--ui-surface-raised, var(--bg));   /* a real card FILL (the app's --surface is a noise image, not a colour) */
  --o-text:    var(--text);
  --o-muted:   var(--text-muted);
  --o-line:    var(--line);
  --o-soft:    var(--ui-surface-soft, color-mix(in oklab, var(--text) 5%, transparent));
  --o-radius:    var(--ui-card-radius, 18px);
  --o-radius-sm: var(--radius, 12px);
  --o-shadow:    var(--shadow);
  /* The app's signature card backdrop: noise texture blended over a faint
     raised fill. Use together with `background-blend-mode: var(--blend)`. */
  --o-card: var(--surface), linear-gradient(180deg,
              color-mix(in oklab, var(--text) 6%, var(--bg)),
              color-mix(in oklab, var(--text) 2%, var(--bg)));
}

/* ---------------------------------------------------------------------
   Overview shell
   --------------------------------------------------------------------- */
.ov2 {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 5px 10px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: var(--o-text);
  scroll-behavior: smooth;
}
.ov2 *,
.office-dash * { box-sizing: border-box; }

.ov2-inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Hero ---------------------------------------------------------------- */
.ov2-hero { display: flex; flex-direction: column; gap: 6px; }
.ov2-title {
  margin: 0;
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.ov2-title .wave { display: inline-block; }
.ov2-sub { margin: 0; color: var(--o-muted); font-size: 15px; font-weight: 500; }

/* App cards (Docs / Sheets / Slides) ---------------------------------- */
.ov2-apps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.ov2-app {
  position: relative;
  overflow: hidden;
  border: var(--line);
  border-radius: var(--o-radius);
  padding: 10px 15px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  background: var(--btrans);
}
.ov2-app:hover {transform: translateY(-3px);box-shadow: var(--o-shadow);border-color: var(--primary);}
.ov2-app:focus-visible { outline: 2px solid var(--app); outline-offset: 2px; }
.ov2-app--doc   { --app: var(--o-doc); }
.ov2-app--sheet { --app: var(--o-sheet); }
.ov2-app--slide { --app: var(--o-slide); }

.ov2-app-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 26px;
  color: var(--app);
  background: linear-gradient(160deg, color-mix(in oklab, var(--app) 86%, var(--bg)), var(--app));
  background: var(--btrans);
}
.ov2-app-title { margin: 6px 0 0; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.ov2-app-desc { margin: 0; color: var(--o-muted); font-size: 13.5px; font-weight: 500; max-width: 16em; }
.ov2-app-btn {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--strans);
  border: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 13.5px;
  cursor: pointer;
  transition: background .15s ease, transform .12s ease;
  z-index: 2;
}
.ov2-app-btn i { font-size: 12px; transition: transform .15s ease; }
.ov2-app-btn:hover {background: color-mix(in oklab, var(--app) 12%, var(--o-surface));}
.ov2-app-btn:hover i { transform: translateX(2px); }

/* faint decorative glyph bottom-right of each card */
.ov2-app-deco {
  position: absolute;
  right: -8px; bottom: -8px;
  width: 96px; height: 70px;
  opacity: .5;
  pointer-events: none;
  color: var(--app);
}
.ov2-app-deco .b { background: color-mix(in oklab, var(--app) 35%, transparent); border-radius: 4px; position: absolute; }

/* Panels -------------------------------------------------------------- */
.ov2-panel {
  border: var(--o-line);
  border-radius: var(--o-radius);
  background: var(--o-card);
  background-blend-mode: var(--blend);
  padding: 22px 24px;
}
.ov2-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ov2-panel-title { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.ov2-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--o-accent); font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none; background: none; border: none;
}
.ov2-link:hover { text-decoration: underline; }

/* Middle row: quick actions + templates */
.ov2-mid {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) 2.1fr;
  gap: 28px;
}
.ov2-mid-sep { display: none; }

/* Quick actions */
.ov2-quick-list { display: flex; flex-direction: column; gap: 6px; }
.ov2-quick-item {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 10px;
  border-radius: var(--o-radius-sm);
  border: none; background: none; cursor: pointer;
  text-align: left; width: 100%;
  transition: background .14s ease;
}
.ov2-quick-item:hover { background: var(--o-soft); }
.ov2-quick-ic {
  width: 40px; height: 40px; flex: none;
  border-radius: 11px;
  display: grid; place-items: center;
  font-size: 18px;
  background: color-mix(in oklab, var(--o-accent) 12%, transparent);
  color: var(--o-accent);
}
.ov2-quick-item[data-action="upload"]   .ov2-quick-ic { background: color-mix(in oklab, var(--o-doc) 13%, transparent); color: var(--o-doc); }
.ov2-quick-item[data-action="template"] .ov2-quick-ic { background: color-mix(in oklab, var(--o-sheet) 13%, transparent); color: var(--o-sheet); }
.ov2-quick-item[data-action="invite"]   .ov2-quick-ic { background: color-mix(in oklab, var(--o-slide) 13%, transparent); color: var(--o-slide); }
.ov2-quick-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ov2-quick-name { font-weight: 650; font-size: 14px; }
.ov2-quick-desc { color: var(--o-muted); font-size: 12.5px; }

/* Templates grid */
.ov2-tpl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.ov2-tpl {
  border: none; background: none; cursor: pointer; padding: 0;
  display: flex; flex-direction: column; gap: 8px; text-align: left;
}
.ov2-tpl-thumb {
  aspect-ratio: 16 / 11;
  border-radius: var(--o-radius-sm);
  border: var(--o-line);
  background: var(--o-bg);
  overflow: hidden;
  position: relative;
  padding: 14px;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.ov2-tpl:hover .ov2-tpl-thumb { transform: translateY(-2px); box-shadow: var(--o-shadow); border-color: color-mix(in oklab, var(--tpl, var(--o-accent)) 45%, transparent); }
.ov2-tpl-name { font-weight: 650; font-size: 13.5px; }
.ov2-tpl-type { display: inline-flex; align-items: center; gap: 6px; color: var(--o-muted); font-size: 12px; }
.ov2-tpl-type i { font-size: 13px; }
.ov2-tpl--doc   { --tpl: var(--o-doc); }
.ov2-tpl--sheet { --tpl: var(--o-sheet); }
.ov2-tpl--slide { --tpl: var(--o-slide); }
.ov2-tpl-type--doc i   { color: var(--o-doc); }
.ov2-tpl-type--sheet i { color: var(--o-sheet); }
.ov2-tpl-type--slide i { color: var(--o-slide); }

/* lightweight thumbnail content */
.ov2-tline { height: 7px; border-radius: 4px; background: color-mix(in oklab, var(--tpl) 22%, transparent); margin-bottom: 8px; }
.ov2-tline--w1 { width: 55%; } .ov2-tline--w2 { width: 80%; } .ov2-tline--w3 { width: 68%; }
.ov2-tpl-thumb--sheet { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; }
.ov2-tpl-pie { width: 42px; height: 42px; border-radius: 50%; background: conic-gradient(var(--o-sheet) 0 35%, color-mix(in oklab,var(--o-sheet) 55%, var(--bg)) 35% 60%, color-mix(in oklab,var(--o-sheet) 25%, var(--bg)) 60% 100%); }
.ov2-tpl-rows { display: flex; flex-direction: column; gap: 6px; }
.ov2-tpl-thumb--slide { background: linear-gradient(135deg, color-mix(in oklab,var(--o-slide) 16%, var(--o-bg)), var(--o-bg)); }
.ov2-tpl-badge { font-weight: 800; font-size: 13px; color: var(--o-slide); letter-spacing: .08em; }
.ov2-tpl-blob { position: absolute; right: -10px; bottom: -14px; width: 64px; height: 64px; border-radius: 50%; background: color-mix(in oklab, var(--o-slide) 70%, var(--bg)); }

/* Recent -------------------------------------------------------------- */
.ov2-recent-list { display: flex; flex-direction: column; }
.ov2-recent-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 2.2fr) minmax(0, 1.3fr) 130px 28px;
  align-items: center;
  gap: 14px;
  padding: 12px 6px;
  border: none; background: none; cursor: pointer;
  text-align: left; width: 100%;
  border-top: var(--o-line);
  transition: background .14s ease;
}
.ov2-recent-row:first-child { border-top: none; }
.ov2-recent-row:hover { background: var(--o-soft); }
.ov2-recent-ic { font-size: 18px; display: grid; place-items: center; }
.ov2-recent-ic--doc { color: var(--o-doc); }
.ov2-recent-ic--sheet { color: var(--o-sheet); }
.ov2-recent-ic--slide { color: var(--o-slide); }
.ov2-recent-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov2-recent-kind { color: var(--o-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov2-recent-time { color: var(--o-muted); font-size: 13px; text-align: left; }
.ov2-recent-menu { color: var(--o-muted); display: grid; place-items: center; border-radius: 8px; padding: 4px; }
.ov2-recent-menu:hover { background: color-mix(in oklab, var(--o-text) 8%, transparent); }

.ov2-empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 28px; color: var(--o-muted); text-align: center;
}
.ov2-empty i { font-size: 28px; opacity: .6; }

/* Responsive ---------------------------------------------------------- */
@media (max-width: 1080px) {
  .ov2-tpl-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .ov2-apps { grid-template-columns: 1fr; }
  .ov2-mid { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 620px) {
  .ov2-tpl-grid { grid-template-columns: 1fr 1fr; }
  .ov2-recent-row { grid-template-columns: 24px 1fr 26px; }
  .ov2-recent-kind, .ov2-recent-time { display: none; }
}

/* =====================================================================
   Mini-route landings (docs / sheets / slides) — restyle of renderDashboard
   ===================================================================== */
.office-dash {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: var(--o-text);
}
.office-dash-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.office-dash-header > div:first-child { display: flex; align-items: center; gap: 14px; }
.office-dash-header i {
  width: 30px;
  height: 30px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--dash-accent);
  background: var(--strans);
}
.office-dash[data-kind="docs"]   { --dash-accent: var(--o-doc); }
.office-dash[data-kind="sheets"] { --dash-accent: var(--o-sheet); }
.office-dash[data-kind="slides"] { --dash-accent: var(--o-slide); }
.office-dash-header h1 { margin: 0; font-size: clamp(22px, 2.6vw, 28px); font-weight: 800; letter-spacing: -0.02em; }

.office-dash .btn-new {
  display: inline-flex;
  align-items: center;
  background: var(--bg);
  color: #fff;
  gap: 10px;
  border: none;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 14px;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease;
}
.office-dash .btn-new:hover {transform: translateY(-1px);box-shadow: 0 8px 7px -8px color-mix(in oklab, var(--dash-accent) 70%, transparent);}

.office-dash-controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.office-dash-controls > div { display: flex; align-items: center; gap: 10px; }
.office-dash .search-input-wrap,
.office-dash .search-wrap { position: relative; display: flex; align-items: center; }
.office-dash .search-input-wrap i,
.office-dash .search-wrap > i { position: absolute; left: 12px; color: var(--o-muted); font-size: 14px; pointer-events: none; }
.office-dash .search-input {
  border: var(--o-line); background: var(--o-bg); color: var(--o-text);
  padding: 9px 14px 9px 34px; border-radius: 999px; font-size: 13.5px; min-width: 240px;
}
.office-dash .search-input:focus { outline: 2px solid color-mix(in oklab, var(--dash-accent) 45%, transparent); outline-offset: 0; }

.office-dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.office-card {
  border: var(--o-line);
  border-radius: var(--o-radius-sm);
  background: var(--o-card);
  background-blend-mode: var(--blend);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.office-card:hover {transform: translateY(-3px);box-shadow: var(--shadow);border-color: var(--bgblur);}
.office-card-preview {
  height: 122px;
  padding: 16px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(180deg, color-mix(in oklab, var(--dash-accent) 4%, transparent), transparent);
  border-bottom: var(--o-line);
}
.office-card-body { padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.office-card-ic { color: var(--dash-accent); font-size: 18px; }
.office-card-meta { min-width: 0; flex: 1; }
.office-card-title { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.office-card-sub { color: var(--o-muted); font-size: 12px; }
.office-card .card-menu { border: none; background: none; color: var(--o-muted); cursor: pointer; padding: 4px; border-radius: 8px; }
.office-card .card-menu:hover { background: color-mix(in oklab, var(--o-text) 8%, transparent); }

/* list view rows */
.office-dash-list { display: flex; flex-direction: column; border: var(--o-line); border-radius: var(--o-radius-sm); overflow: hidden; }
.office-dash-list .office-row {
  display: grid; grid-template-columns: 26px 2fr 1fr 130px 28px; gap: 14px; align-items: center;
  padding: 12px 16px; cursor: pointer; border-top: var(--o-line); background: var(--o-surface);
}
.office-dash-list .office-row:first-child { border-top: none; }
.office-dash-list .office-row:hover { background: var(--o-soft); }

.office-dash-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 56px 20px; color: var(--o-muted); text-align: center; }
.office-dash-empty .ic { font-size: 40px; opacity: .5; color: var(--dash-accent, var(--o-accent)); }
.office-dash-empty .btn-new { margin-top: 6px; }

/* sort + view toggle */
.office-dash .sort-select {
  border: var(--o-line); background: var(--o-bg); color: var(--o-text);
  padding: 8px 12px; border-radius: 10px; font-size: 13px; cursor: pointer;
}
.office-viewtoggle {display: inline-flex;border: var(--o-line);border-radius: 16px;padding: 3px 4px;gap: 2px;overflow: hidden;background: var(--o-bg);}
.office-viewtoggle .btn-view-mode {
  border: none;
  background: none;
  color: var(--o-muted);
  cursor: pointer;
  padding: 4px 10px;
  font-size: 15px;
  line-height: 1;
  display: grid;
  place-items: center;
  border-radius: 12px;
}
.office-viewtoggle .btn-view-mode + .btn-view-mode { border-left: var(--o-line); }
.office-viewtoggle .btn-view-mode.active {background: var(--primary-faded);color: #fff;}

/* context menu (shared) */
.office-ctx-menu {
  position: fixed; z-index: 1000;
  min-width: 176px;
  background: var(--o-surface);
  border: var(--o-line);
  border-radius: 12px;
  box-shadow: var(--shadow), 0 12px 30px -10px rgba(0, 0, 0, 0.45);
  padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
}
.office-ctx-menu button {
  display: flex; align-items: center; gap: 10px;
  border: none; background: none; color: var(--o-text);
  padding: 9px 12px; border-radius: 8px; cursor: pointer;
  font-size: 13.5px; text-align: left; width: 100%;
}
.office-ctx-menu button i { font-size: 14px; width: 16px; color: var(--o-muted); }
.office-ctx-menu button:hover { background: var(--o-soft); }
.office-ctx-menu button.danger { color: var(--danger, #ef4444); }
.office-ctx-menu button.danger i { color: var(--danger, #ef4444); }

/* =====================================================================
   Slides editor
   ===================================================================== */
.slv { display: flex; flex-direction: column; height: 100%; min-height: 0; color: var(--o-text); }
.slv-missing { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; height: 100%; color: var(--o-muted); }
.slv-missing i { font-size: 44px; opacity: .5; }
.slv-missing h3 { margin: 0; }

.slv-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-bottom: var(--o-line); background: var(--o-surface); flex-wrap: wrap;
}
.slv-top-l, .slv-top-r { display: flex; align-items: center; gap: 10px; }
.slv-icobtn { border: var(--o-line); background: var(--o-bg); color: var(--o-text); width: 36px; height: 36px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.slv-icobtn:hover { background: var(--o-soft); }
.slv-title-input { border: 1px solid transparent; background: transparent; color: var(--o-text); font-weight: 700; font-size: 16px; padding: 6px 10px; border-radius: 8px; min-width: 220px; }
.slv-title-input:hover { background: var(--o-soft); }
.slv-title-input:focus { outline: none; border-color: color-mix(in oklab, var(--o-slide) 50%, transparent); background: var(--o-bg); }
.slv-savestate { color: var(--o-muted); font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px; }
.slv-select { border: var(--o-line); background: var(--o-bg); color: var(--o-text); padding: 7px 10px; border-radius: 9px; font-size: 13px; cursor: pointer; }
.slv-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: var(--o-line); background: var(--o-bg); color: var(--o-text);
  padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 13.5px; cursor: pointer;
}
.slv-btn:hover { background: var(--o-soft); }
.slv-btn.primary { border: none; color: #fff; background: linear-gradient(160deg, color-mix(in oklab, var(--o-slide) 92%, var(--bg)), var(--o-slide)); box-shadow: 0 8px 18px -8px color-mix(in oklab, var(--o-slide) 70%, transparent); }

.slv-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 220px 1fr; }
.slv-rail { border-right: var(--o-line); display: flex; flex-direction: column; min-height: 0; background: color-mix(in oklab, var(--o-text) 2%, var(--o-bg)); }
.slv-rail-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.slv-thumb { position: relative; border: 2px solid transparent; border-radius: 10px; cursor: pointer; background: var(--o-surface); padding: 4px; box-shadow: var(--o-shadow); }
.slv-thumb.active { border-color: var(--o-slide); }
.slv-thumb.dragging { opacity: .4; }
.slv-thumb-no { position: absolute; left: 8px; top: 8px; z-index: 2; font-size: 11px; font-weight: 700; color: var(--o-muted); }
.slv-thumb-canvas { aspect-ratio: 16 / 9; border-radius: 7px; overflow: hidden; pointer-events: none; font-size: 6px; padding: 8px; display: flex; flex-direction: column; }
.slv-thumb-canvas .slv-s-title { font-size: 9px; }
.slv-thumb-canvas .slv-s-body { font-size: 6px; }
.slv-add { margin: 10px; padding: 9px; border: 1px dashed color-mix(in oklab, var(--o-slide) 45%, var(--o-line)); border-radius: 10px; background: transparent; color: var(--o-text); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.slv-add:hover { background: color-mix(in oklab, var(--o-slide) 10%, transparent); }

.slv-stage { min-height: 0; overflow-y: auto; padding: clamp(16px, 3vw, 36px); display: flex; flex-direction: column; align-items: center; gap: 16px; }
.slv-canvas { width: min(100%, 880px); aspect-ratio: 16 / 9; border-radius: 14px; box-shadow: 0 12px 40px -16px rgba(15, 23, 42, .45); overflow: hidden; padding: 6%; display: flex; flex-direction: column; }
.slv-notes { width: min(100%, 880px); }
.slv-notes label { display: block; font-size: 12px; font-weight: 600; color: var(--o-muted); margin-bottom: 6px; }
.slv-notes textarea { width: 100%; min-height: 70px; resize: vertical; border: var(--o-line); border-radius: 10px; padding: 10px 12px; background: var(--o-bg); color: var(--o-text); font: inherit; font-size: 13.5px; }

/* slide layouts (inside any .slv-theme-*) */
.slv-s-title { font-weight: 800; font-size: 2.4em; line-height: 1.15; outline: none; }
.slv-s-body { font-size: 1.15em; line-height: 1.5; outline: none; white-space: pre-wrap; }
.slv-canvas .slv-s-title { font-size: 38px; }
.slv-canvas .slv-s-body { font-size: 19px; margin-top: 14px; }
.slv-l-title, .slv-l-section { justify-content: center; align-items: center; text-align: center; height: 100%; display: flex; flex-direction: column; gap: 10px; }
.slv-l-tc { display: flex; flex-direction: column; height: 100%; }
.slv-l-blank { height: 100%; }
[contenteditable]:empty:before { content: attr(data-ph); color: currentColor; opacity: .4; }

/* themes */
.slv-theme-classic  { background: #ffffff; color: #0f172a; }
.slv-theme-midnight { background: radial-gradient(120% 120% at 0% 0%, #1e293b, #0b1220); color: #f1f5f9; }
.slv-theme-sky      { background: linear-gradient(135deg, #e0f2fe, #bae6fd 60%, #93c5fd); color: #0c4a6e; }
.slv-theme-sunset   { background: linear-gradient(135deg, #fff7ed, #fed7aa 55%, #fdba74); color: #7c2d12; }
.slv-theme-mono     { background: #f8fafc; color: #111827; }

/* present mode */
.slv-present { position: fixed; inset: 0; z-index: 2000; background: #000; display: flex; align-items: center; justify-content: center; }
.slv-present-stage { width: 100vw; height: 100vh; padding: 8vmin; display: flex; flex-direction: column; justify-content: center; box-sizing: border-box; }
.slv-present-stage .slv-s-title { font-size: 7vmin; }
.slv-present-stage .slv-s-body { font-size: 3.4vmin; margin-top: 3vmin; }
.slv-present-bar { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; background: rgba(15,23,42,.8); color: #fff; padding: 8px 14px; border-radius: 999px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: .25; transition: opacity .2s; }
.slv-present:hover .slv-present-bar { opacity: 1; }
.slv-present-bar button { border: none; background: rgba(255,255,255,.12); color: #fff; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.slv-present-bar button:disabled { opacity: .35; cursor: default; }
.slv-present-bar span { font-size: 13px; font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  .slv-main { grid-template-columns: 1fr; }
  .slv-rail { flex-direction: row; border-right: none; border-bottom: var(--o-line); }
  .slv-rail-scroll { flex-direction: row; }
  .slv-thumb { width: 150px; flex: none; }
  .slv-add { margin: 10px; align-self: center; white-space: nowrap; }
}

/* =====================================================================
   Doc / Sheet editor chrome restyle (layers over office.css — same
   structure, modernized surfaces/controls to match the new design)
   ===================================================================== */
.office-wrap { --edit-accent: var(--primary); }
.office-wrap:has(#docView)   { --edit-accent: var(--o-doc); }
.office-wrap:has(#sheetView) { --edit-accent: var(--o-sheet); }

.office-main { gap: 12px; padding: 14px 14px 8px; }

.office-toolbar {
  padding: 8px 10px;
  border: var(--line);
  border-radius: var(--o-radius-sm);
  background: var(--o-card);
  background-blend-mode: var(--blend);
  box-shadow: var(--o-shadow);
  gap: 10px;
}

.office-main .title-input {
  border: 1px solid transparent;
  background: color-mix(in oklab, var(--text, #0f172a) 4%, transparent);
  transition: border-color .15s ease, background .15s ease;
}
.office-main .title-input:hover { background: color-mix(in oklab, var(--text, #0f172a) 7%, transparent); }
.office-main .title-input:focus { outline: none; border-color: color-mix(in oklab, var(--edit-accent) 55%, transparent); background: var(--bg); }

/* tab pills */
.office-main .tabs { padding: 3px; gap: 2px; border: var(--line); }
.office-main .tab { font-weight: 600; font-size: 13px; color: var(--text-muted, #64748b); }
.office-main .tab.active { background: var(--bg); color: var(--edit-accent); box-shadow: 0 1px 2px rgba(0,0,0,.18); }

/* ribbon */
.office-main .ribbon { border-radius: 12px; background: color-mix(in oklab, var(--text, #0f172a) 2.5%, var(--bg)); padding: 5px 6px; }
.office-main .ribbon button { border-radius: 9px; transition: background .12s ease, color .12s ease, outline-color .12s ease; }
.office-main .ribbon button:hover { outline: none; background: color-mix(in oklab, var(--edit-accent) 14%, transparent); color: var(--edit-accent); }
.office-main .ribbon button.active,
.office-main .ribbon button[aria-pressed="true"] { background: color-mix(in oklab, var(--edit-accent) 16%, transparent); color: var(--edit-accent); }

/* generic toolbar buttons */
.office-toolbar .btn,
.sheet-toolbar .btn {
  border-radius: 999px;
  transition: transform .12s ease, background .12s ease;
}
.office-toolbar .btn.primary,
.sheet-toolbar .btn.primary {
  border: none; color: #fff;
  background: linear-gradient(160deg, color-mix(in oklab, var(--edit-accent) 92%, var(--bg)), var(--edit-accent));
  box-shadow: 0 8px 18px -8px color-mix(in oklab, var(--edit-accent) 70%, transparent);
}
.office-toolbar .btn.primary:hover { transform: translateY(-1px); }

/* paper / doc surface */
.paper { background: color-mix(in oklab, var(--text, #0f172a) 3%, var(--bg)); padding-top: 12px; }
.doc-editor { border-radius: 6px; box-shadow: 0 6px 26px -10px rgba(15, 23, 42, .35); }

/* sheet grid */
.sheet-grid th { background: color-mix(in oklab, var(--edit-accent) 7%, var(--muted, var(--bg))); font-weight: 600; }
.sheet-grid tr th:first-child { background: color-mix(in oklab, var(--edit-accent) 7%, var(--muted, var(--bg))); }
.sheet-grid td.selected { background: color-mix(in oklab, var(--edit-accent) 16%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--edit-accent) 55%, transparent); }

/* sheet tabs */
.sheet-tab.active { color: var(--edit-accent); }
.sheet-tabs-bar { border-radius: 0 0 16px 16px; }

/* files flyout */
.office-files { border-radius: 18px; box-shadow: 0 16px 48px -20px rgba(15,23,42,.45); }
.file-block { border-radius: 12px; transition: outline-color .12s ease, transform .12s ease; }
.file-block:hover { transform: translateY(-1px); }
