/* RoyalSonic Office — enterprise SaaS theme (Mailbox blue) */
:root {
  --accent: #5b7cff;
  --accent-deep: #3d5bd6;
  --accent-hover: #4a6af0;
  --ink: #1e293b;
  --muted: #64748b;
  --bg: #f4f6fb;
  --pane: #ffffff;
  --line: #e6eaf2;
  --selected: #eef2ff;
  --hover: #f5f7fc;
  --success: #0f766e;
  --warn: #b45309;
  --font: "Outfit", "Segoe UI", ui-sans-serif, sans-serif;
  --display: "Syne", "Outfit", ui-sans-serif, sans-serif;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body.rs-office {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow-x: hidden;
}
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 35% at 8% -5%, rgba(91, 124, 255, 0.12), transparent 55%),
    linear-gradient(180deg, #f4f6fb 0%, #eef1f8 100%);
}

.top {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1.1rem;
  margin: 0.65rem 0.85rem 0;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: barIn 0.4s ease both;
}
@keyframes barIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.brand .logo { height: 34px; width: auto; display: block; }
.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.wordmark .royal { color: var(--accent); }
.wordmark .sonic { color: var(--ink); }
.wordmark em {
  font-style: normal;
  font-weight: 700;
  color: var(--accent-deep);
  margin-left: 0.15rem;
}
.nav { display: flex; gap: 0.2rem; flex: 1; flex-wrap: wrap; }
.tab {
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 0.4rem 0.85rem;
  font: 650 0.8rem var(--font);
  color: var(--muted);
  cursor: pointer;
}
.tab:hover { color: var(--ink); background: var(--hover); }
.tab.active {
  background: var(--selected);
  color: var(--accent-deep);
  box-shadow: inset 3px 0 0 var(--accent);
}
.top-links { display: flex; gap: 0.85rem; }
.top-links a {
  color: var(--accent-deep);
  font-weight: 650;
  font-size: 0.8rem;
  text-decoration: none;
}
.top-links a:hover { text-decoration: underline; }

.view {
  margin: 0.75rem 0.85rem;
  padding: 0;
  background: transparent;
  border: 0;
  overflow: auto;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.view.in { opacity: 1; transform: none; }
.view-writer, .view-calc, .view-impress {
  background: var(--pane);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.15rem 1.25rem;
}

.office-home { display: grid; gap: 1.35rem; }
.hero-plane {
  position: relative;
  min-height: min(42vh, 380px);
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(125deg, #1e293b 0%, #334155 42%, #3d5bd6 100%);
  color: #fff;
  display: flex;
  align-items: flex-end;
  padding: clamp(1.35rem, 3.5vw, 2.35rem);
  animation: heroIn 0.5s ease both;
}
.hero-plane::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 70% at 92% 20%, rgba(124, 155, 255, 0.28), transparent 55%);
  pointer-events: none;
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 36rem;
  display: grid;
  gap: 0.75rem;
}
.hero-copy h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.75rem, 4vw, 2.55rem);
  letter-spacing: -0.04em;
  line-height: 1.08;
}
.hero-copy h1 .royal,
.hero-copy h1 .sonic { color: #fff; }
.hero-copy h1 em {
  font-style: normal;
  color: #c7d4ff;
}
.hero-copy p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.86);
  max-width: 30rem;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.btn.create-app {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 7.5rem;
  justify-content: center;
}
.btn.create-app .create-ico {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
}
.btn.create-app .create-ico svg {
  display: block;
}
.btn {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 10px;
  padding: 0.6rem 1.05rem;
  font: 650 0.85rem var(--font);
  cursor: pointer;
}
.btn:hover { background: rgba(255, 255, 255, 0.18); }
.btn.primary {
  background: #fff;
  color: var(--accent-deep);
  border-color: transparent;
}
.btn.primary:hover { background: #eef2ff; }
.btn.secondary {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.4);
}
.btn.gold {
  background: color-mix(in srgb, #fff 18%, transparent);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}
.recent-block .btn,
.files-view .btn,
.app-shell .btn {
  background: var(--hover);
  color: var(--ink);
  border-color: var(--line);
}
.recent-block .btn.primary,
.files-view .btn.primary,
.app-shell .btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
.recent-block .btn.gold,
.files-view .btn.gold,
.app-shell .btn.gold {
  background: var(--selected);
  color: var(--accent-deep);
  border-color: color-mix(in srgb, var(--accent) 25%, var(--line));
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.section-head h1, .section-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.section-head h2 { font-size: 1.1rem; }
.section-head h1 { font-size: 1.35rem; }
.linkish {
  border: 0;
  background: none;
  color: var(--accent-deep);
  font: 650 0.85rem var(--font);
  cursor: pointer;
  text-decoration: underline;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.65rem;
}
.file-tile {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.95rem;
  background: var(--pane);
  text-align: left;
  cursor: pointer;
  font: inherit;
  display: grid;
  gap: 0.35rem;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.file-tile::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}
.file-tile.type-calc::before { background: var(--success); }
.file-tile.type-impress::before { background: var(--warn); }
.file-tile:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
}
.ft-kind {
  font: 700 0.65rem var(--font);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-deep);
}
.file-tile.type-calc .ft-kind { color: var(--success); }
.file-tile.type-impress .ft-kind { color: var(--warn); }
.file-tile strong {
  font-family: var(--display);
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ft-meta { font-size: 0.75rem; color: var(--muted); }
.desktop-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.empty { color: var(--muted); padding: 1rem; }

.files-view {
  background: var(--pane);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
  box-shadow: var(--shadow);
}
.file-table-wrap { overflow: auto; }
.file-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.file-table th {
  text-align: left;
  font: 700 0.68rem var(--font);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--line);
}
.file-table td {
  padding: 0.65rem;
  border-bottom: 1px solid var(--line);
}
.file-name {
  border: 0;
  background: none;
  font: 650 0.9rem var(--font);
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  text-align: left;
}
.file-name:hover { color: var(--accent-deep); }
.pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font: 700 0.68rem var(--font);
  text-transform: uppercase;
  background: var(--hover);
  color: var(--muted);
}
.pill.type-writer { background: var(--selected); color: var(--accent-deep); }
.pill.type-calc { background: #ecfdf5; color: #065f46; }
.pill.type-impress { background: #fff7ed; color: #9a3412; }
.icon-btn {
  border: 0;
  background: var(--hover);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.icon-btn.danger:hover { background: #fee2e2; color: #b91c1c; }

.app-shell { display: grid; gap: 0.75rem; min-height: 70vh; }
.meta-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  color: var(--muted);
  font: 700 0.75rem var(--font);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.meta-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
#saveHint { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--muted); }
.title {
  border: 0;
  border-bottom: 1px solid var(--line);
  font: 800 1.35rem var(--display);
  letter-spacing: -0.03em;
  padding: 0.35rem 0;
  outline: none;
  background: transparent;
  width: 100%;
}
.title:focus { border-color: var(--accent); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
}
.toolbar button, .toolbar select {
  border: 1px solid var(--line);
  background: #fafafa;
  border-radius: 8px;
  min-height: 32px;
  padding: 0 0.45rem;
  cursor: pointer;
  font: 650 0.78rem var(--font);
}
.toolbar button { width: 34px; }
.toolbar select { width: auto; font-weight: 600; }
.toolbar button:hover, .toolbar select:hover { border-color: var(--accent); }
.tb-sep {
  width: 1px;
  height: 22px;
  background: var(--line);
  margin: 0 0.2rem;
}
.swatch {
  width: 34px !important;
  background: var(--c) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
}
.swatch.hi { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }

.page {
  background: #eef1f6;
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  justify-content: center;
}
.editor-body {
  width: min(100%, 720px);
  min-height: 62vh;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2.25rem 2.5rem;
  outline: none;
  line-height: 1.65;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
  font-size: 1rem;
}
.editor-body:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent), 0 8px 28px rgba(15, 23, 42, 0.06);
}
.editor-body h1, .editor-body h2 { font-family: var(--display); letter-spacing: -0.02em; }

.formula-bar {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0.45rem;
  align-items: center;
}
.cell-name {
  font: 800 0.85rem var(--font);
  text-align: center;
  padding: 0.45rem;
  background: var(--hover);
  border-radius: 8px;
  border: 1px solid var(--line);
}
#formulaInput {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font: 600 0.9rem var(--font);
  outline: none;
}
#formulaInput:focus { border-color: var(--accent); }
.sheet-scroll { overflow: auto; max-height: 58vh; border: 1px solid var(--line); border-radius: 10px; }
.sheet {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: #fff;
}
.sheet th, .sheet td {
  border: 1px solid var(--line);
  min-width: 92px;
  height: 28px;
  padding: 0.15rem 0.4rem;
}
.sheet th {
  background: #f8fafc;
  font: 700 0.7rem var(--font);
  color: var(--muted);
  position: sticky;
  top: 0;
  z-index: 1;
}
.sheet tbody th {
  left: 0;
  z-index: 2;
  min-width: 40px;
  text-align: center;
}
.sheet td.cell { cursor: cell; }
.sheet td.cell.active {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: var(--selected);
}
.hint-line { margin: 0; font-size: 0.75rem; color: var(--muted); }
.hint-line code { font-size: 0.72rem; background: var(--hover); padding: 0.1rem 0.35rem; border-radius: 4px; }

.slides {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0.85rem;
  min-height: 55vh;
}
.slide-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow: auto;
  max-height: 60vh;
}
.slide-thumb {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem;
  background: #fafafa;
  cursor: pointer;
  text-align: left;
  font: inherit;
  display: grid;
  gap: 0.15rem;
}
.slide-thumb .n {
  font: 700 0.65rem var(--font);
  color: var(--muted);
}
.slide-thumb strong {
  font-size: 0.78rem;
  font-family: var(--display);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slide-thumb small {
  color: var(--muted);
  font-size: 0.68rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slide-thumb.active {
  border-color: var(--accent);
  background: var(--selected);
}
.slide-editor { display: grid; gap: 0.55rem; }
.slide-title, .slide-body {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  outline: none;
}
.slide-title { font: 700 1rem var(--display); }
.slide-body { min-height: 5rem; resize: vertical; }
.slide-notes {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  outline: none;
  background: var(--hover);
}
.slide-notes:focus { border-color: var(--accent); background: #fff; }
.pv-grid {
  display: grid;
  gap: 0.75rem;
}
.pv-grid:not(:has(pre[hidden])) {
  grid-template-columns: 1fr 1fr;
}
.slide-image {
  max-width: 100%;
  max-height: 160px;
  object-fit: contain;
  border-radius: 8px;
  margin-top: 0.5rem;
}
.present-cols {
  display: grid;
  gap: 1rem;
}
.present-cols:not(:has(pre[hidden])) {
  grid-template-columns: 1fr 1fr;
}
.present-notes {
  margin: 0.5rem 0 0;
  opacity: 0.75;
  font-size: 0.95rem;
}
#presentOverlay img {
  max-width: min(720px, 100%);
  max-height: 40vh;
  object-fit: contain;
  border-radius: 10px;
  margin-top: 0.75rem;
}
.toolbar button[data-act],
.toolbar button[data-style],
.toolbar button[data-align],
.toolbar button[data-fmt] {
  width: auto;
  min-width: 34px;
  padding: 0 0.55rem;
}
.calc-shell .toolbar select,
.impress-shell .toolbar select {
  max-width: 9rem;
}
.slide-stage {
  border-radius: 12px;
  min-height: 36vh;
  padding: 2rem 2.25rem;
  display: grid;
  align-content: center;
  gap: 0.75rem;
  color: #fff;
}
.slide-stage h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.03em;
}
.slide-stage pre {
  margin: 0;
  font-family: var(--font);
  font-size: 1.05rem;
  white-space: pre-wrap;
  line-height: 1.5;
  opacity: 0.95;
}
.slide-stage.theme-royal,
.slide-stage.theme-suite {
  background: linear-gradient(135deg, #1e293b 0%, #3d5bd6 55%, #5b7cff 100%);
}
.slide-stage.theme-ink {
  background: linear-gradient(145deg, #0f172a, #334155);
}
.slide-stage.theme-gold {
  background: linear-gradient(135deg, #1e293b, #475569 50%, #94a3b8);
  color: #fff;
}

.present-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.present-overlay.theme-royal,
.present-overlay.theme-suite { background: #0f172a; }
.present-overlay.theme-ink { background: #020617; }
.present-overlay.theme-gold { background: #1e293b; }
.present-inner {
  width: min(960px, 100%);
  color: #fff;
  display: grid;
  gap: 1rem;
}
.present-inner h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.04em;
}
.present-inner pre {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  white-space: pre-wrap;
  line-height: 1.5;
  opacity: 0.92;
}
.present-nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1.5rem;
}
.present-nav button {
  border: 0;
  background: rgba(255, 255, 255, 0.15);
  color: inherit;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font: 650 0.8rem var(--font);
  cursor: pointer;
}
.present-nav span { margin: 0 0.5rem; font-size: 0.85rem; opacity: 0.7; }

.rs-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: #1e293b;
  color: #fff;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  font: 650 0.85rem var(--font);
  z-index: 80;
  opacity: 0;
  transition: 0.2s ease;
}
.rs-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.foot {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1.25rem 1.1rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}
.foot-logo { height: 26px; width: auto; opacity: 0.85; }
.foot p { margin: 0; max-width: 52rem; }

@media print {
  .top, .foot, .toolbar, .meta-bar, .atmosphere { display: none !important; }
  .view { margin: 0; box-shadow: none; border: 0; }
  .page { background: #fff; padding: 0; }
  .editor-body { box-shadow: none; border: 0; width: 100%; min-height: 0; }
}

@media (max-width: 800px) {
  .top { flex-wrap: wrap; }
  .wordmark { font-size: 0.95rem; }
  .hero-plane {
    min-height: 36vh;
    background: linear-gradient(160deg, #1e293b, #3d5bd6);
  }
  .slides { grid-template-columns: 1fr; }
  .slide-list { flex-direction: row; max-height: none; overflow-x: auto; }
  .slide-thumb { min-width: 120px; }
}


/* === Webmail-matched + professional ribbon (20260908) === */
:root {
  --font: "Plus Jakarta Sans", "Segoe UI", ui-sans-serif, sans-serif;
  --display: "Plus Jakarta Sans", "Segoe UI", ui-sans-serif, sans-serif;
  --accent: #111827;
  --accent-deep: #111827;
  --accent-hover: #1f2937;
  --ink: #111827;
  --muted: #6b7280;
  --bg: #f3f4f6;
  --pane: #ffffff;
  --line: #e8ecf1;
  --selected: #f3f4f6;
  --hover: #f9fafb;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
  --gold: #f5c518;
}
body.rs-office { font-family: var(--font); background: var(--bg); color: var(--ink); }
.atmosphere {
  background:
    radial-gradient(ellipse 50% 40% at 100% 0%, rgba(245, 197, 24, 0.12), transparent 55%),
    radial-gradient(ellipse 40% 30% at 0% 0%, rgba(17, 24, 39, 0.05), transparent 50%),
    var(--bg) !important;
}
.top {
  margin: 12px 12px 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.wordmark .royal, .wordmark .sonic, .wordmark em { color: inherit !important; }
.wordmark em { color: var(--muted) !important; font-weight: 600 !important; }
.tab.active {
  background: #111827 !important;
  color: #fff !important;
}
.btn.primary, .btn.gold {
  background: var(--gold) !important;
  color: #111827 !important;
  border: 0 !important;
  font-weight: 700;
}
.btn.secondary, .btn:not(.primary):not(.gold) {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
}

.toolbar.ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.75rem;
  align-items: flex-end;
  padding: 0.65rem 0.85rem 0.75rem;
  background: var(--pane);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 0 0 0.75rem;
}
.tb-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  padding-right: 0.75rem;
  border-right: 1px solid var(--line);
}
.tb-group:last-child { border-right: 0; padding-right: 0; }
.tb-label {
  display: block;
  width: 100%;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.toolbar.ribbon button,
.toolbar.ribbon select {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  color: var(--ink);
}
.toolbar.ribbon button:hover { background: #e5e7eb; }
.toolbar.ribbon .swatch {
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border-radius: 6px;
  background: var(--c) !important;
}

.rs-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  z-index: 80;
  padding: 1rem;
}
.rs-modal {
  width: min(720px, 100%);
  background: var(--pane);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
  padding: 1.15rem 1.25rem 1.35rem;
}
.rs-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.rs-modal-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.rs-modal-sub {
  margin: 0.35rem 0 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.rs-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.rs-template-card {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  padding: 1rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.rs-template-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  background: #fff;
}
.rs-template-card strong {
  font-size: 0.92rem;
  font-weight: 750;
}
.rs-template-card span {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.hero-plane {
  border-radius: var(--radius) !important;
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse 70% 80% at 100% 0%, rgba(245, 197, 24, 0.16), transparent 55%),
    var(--bg) !important;
}
.app-shell {
  background: var(--pane);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem 1.25rem;
}
.meta-bar .btn.primary { background: #111827 !important; color: #fff !important; }
