/* itotii TXT — cohesive editorial workspace redesign */
:root {
  --brand: #087f8c;
  --brand-dark: #066b75;
  --brand-soft: #e8f5f6;
  --brand-line: #c8e4e7;
  --accent: #d7875d;
  --bg: #f5f5f0;
  --surface: #fffefa;
  --surface-2: #edf1eb;
  --text: #18322e;
  --text-2: #5b6e67;
  --border: #d9e2db;
  --ok: #23795d;
  --radius: 18px;
  --radius-sm: 11px;
  --shadow: 0 16px 44px rgba(24, 50, 46, .08);
  --maxw: 1180px;
}

html[data-theme="dark"] {
  --brand: #61bec5;
  --brand-dark: #91d6da;
  --brand-soft: #17363a;
  --brand-line: #315a5f;
  --accent: #e6a17c;
  --bg: #101b19;
  --surface: #172521;
  --surface-2: #1d2e29;
  --text: #e9f0ec;
  --text-2: #a5b8af;
  --border: #31453d;
  --ok: #79d5ad;
  --shadow: 0 18px 48px rgba(0, 0, 0, .25);
}

html { scroll-padding-top: 88px; }
body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
::selection { color: var(--text); background: color-mix(in srgb, var(--brand) 22%, transparent); }
.container { width: 100%; max-width: var(--maxw); padding-inline: 28px; }
a { color: var(--brand-dark); text-underline-offset: 3px; }
a:hover { color: var(--brand); }

/* Header */
.site-header {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  backdrop-filter: blur(16px);
}
.header-inner { min-height: 72px; padding-block: 10px; }
.logo { gap: 11px; color: var(--text); font-size: 18px; letter-spacing: -.04em; }
.logo svg { width: 36px; height: 36px; border-radius: 11px; box-shadow: 0 4px 12px rgba(18, 109, 98, .18); }
.logo .brand-name { color: var(--brand); }
.site-header nav { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.header-nav { gap: 22px; }
.site-header nav a, .header-nav a { color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: none; transition: color .16s; }
.site-header nav a:hover, .header-nav a:hover { color: var(--brand); }
.lang-select, .theme-btn { min-height: 40px; border-color: var(--border); border-radius: 10px; background: var(--surface); }
.lang-select:focus-visible, .theme-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 38%, transparent); outline-offset: 2px; }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 66px 0 56px;
  background:
    radial-gradient(ellipse at 82% 18%, color-mix(in srgb, var(--brand-soft) 88%, transparent), transparent 42%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 68%, var(--bg)), var(--bg));
}
.hero::before {
  position: absolute;
  right: -130px;
  bottom: -300px;
  width: 520px;
  height: 520px;
  border: 1px solid color-mix(in srgb, var(--brand-line) 60%, transparent);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}
.hero-layout { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(330px, .9fr); align-items: center; gap: clamp(36px, 6vw, 78px); }
.hero-copy { max-width: 650px; }
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 13px;
  margin-bottom: 20px;
  color: var(--brand-dark);
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  background: var(--brand-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .025em;
}
.hero .eyebrow::before { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); content: ""; }
.hero h1 { max-width: 700px; margin: 0 0 18px; color: var(--text); font-size: clamp(36px, 4.8vw, 54px); font-weight: 720; line-height: 1.14; letter-spacing: -.055em; }
.hero h1 .hl { color: var(--brand); }
.hero .lead { max-width: 650px; margin: 0 0 17px; color: var(--text-2); font-size: 16px; line-height: 1.85; }
.hero .meta-line { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.7; }
.hero .meta-line strong { color: var(--text); }
.hero-preview { min-width: 0; perspective: 1200px; }
.preview-window {
  overflow: hidden;
  padding: 14px 17px 13px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 20px;
  background: #142823;
  box-shadow: 0 24px 64px rgba(19, 50, 42, .22), 0 0 0 8px color-mix(in srgb, var(--brand-soft) 70%, transparent);
  color: #eef6ef;
  transform: rotate(1deg);
}
.preview-top, .preview-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.preview-top { min-height: 38px; padding-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, .1); color: #c0d1c9; font-size: 11px; }
.preview-dots { display: inline-flex; gap: 5px; }
.preview-dots i { width: 7px; height: 7px; border-radius: 50%; background: #e58365; }
.preview-dots i:nth-child(2) { background: #e1b66e; }
.preview-dots i:nth-child(3) { background: #83c49b; }
.preview-file { margin-right: auto; margin-left: 8px; color: #edf4ee; font-weight: 650; }
.preview-encoding { padding: 3px 8px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; color: #c8d9d0; }
.preview-lines { display: grid; gap: 8px; padding: 27px 4px 30px; color: #d3e1d9; font: 13px/1.7 "Cascadia Code", Consolas, monospace; }
.preview-lines > div { display: flex; gap: 18px; }
.preview-lines > div > span { min-width: 20px; color: #71877d; text-align: right; }
.preview-lines strong { color: #f2c58a; font-weight: 600; }
.preview-lines em { color: #8bc7a7; font-style: normal; }
.preview-blank { min-height: 10px; }
.preview-bottom { padding-top: 11px; border-top: 1px solid rgba(255, 255, 255, .1); color: #9eb4a8; font-size: 10px; }
.preview-bottom span { display: inline-flex; align-items: center; gap: 7px; }
.preview-bottom i { width: 7px; height: 7px; border-radius: 50%; background: #82c99f; box-shadow: 0 0 0 4px rgba(130, 201, 159, .12); }
.preview-bottom b { color: #e5b27a; font-size: 14px; }

/* Editor workspace */
.editor-container { position: relative; z-index: 2; margin-top: -7px; margin-bottom: 34px; }
.editor-card { overflow: visible; margin: 0; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); box-shadow: 0 22px 68px rgba(24, 50, 46, .12); }
.editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 28px 30px 22px; }
.editor-eyebrow { display: block; margin-bottom: 8px; color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.editor-eyebrow span { padding-inline: 4px; color: var(--accent); }
.editor-title-group h2 { margin: 0; color: var(--text); font-size: 24px; line-height: 1.25; letter-spacing: -.04em; }
.editor-subtitle { margin: 7px 0 0; color: var(--text-2); font-size: 13px; }
.editor-head-meta { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding-top: 15px; flex-wrap: wrap; }
.privacy-badge, .shortcut-hint { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 5px 10px; border-radius: 999px; font-size: 11px; white-space: nowrap; }
.privacy-badge { color: var(--brand-dark); background: var(--brand-soft); font-weight: 700; }
.privacy-badge > span { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; color: #fff; background: var(--brand); font-size: 11px; }
.shortcut-hint { color: var(--text-2); border: 1px solid var(--border); background: var(--surface); }
kbd { padding: 1px 5px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); color: var(--text); font: 11px/1.5 system-ui, sans-serif; }
.toolbar { display: block; padding: 14px 22px; border-block: 1px solid var(--border); background: var(--surface-2); }
.toolbar-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.toolbar-primary { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.toolbar-tools { display: flex; align-items: flex-start; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.toolbar .group { gap: 7px; }
.tb-btn { min-height: 40px; padding: 8px 12px; border-color: var(--border); border-radius: 10px; background: var(--surface); font-size: 12px; font-weight: 650; transition: border-color .16s, background .16s, color .16s, box-shadow .16s, transform .16s; }
.tb-btn:hover { border-color: var(--brand-line); color: var(--brand-dark); background: var(--brand-soft); transform: translateY(-1px); }
.tb-btn:active { transform: translateY(0); }
.tb-btn.primary { color: #fff; background: var(--brand); border-color: var(--brand); box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 20%, transparent); }
.tb-btn.primary:hover { color: #fff; background: var(--brand-dark); }
.tb-btn.danger { color: #a54f46; }
.tb-btn.danger:hover { border-color: #e7c9c2; color: #8f3a32; background: #fff3f0; }
html[data-theme="dark"] .tb-btn.danger:hover { color: #ffb5a9; border-color: #65443e; background: #382723; }
.find-trigger { color: var(--brand-dark); }
.advanced-tools { margin-top: 13px; padding: 14px 16px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.advanced-tools-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.advanced-tools-head h3 { margin: 0; color: var(--text); font-size: 12px; font-weight: 750; letter-spacing: -.01em; }
.tools-count { display: inline-grid; min-width: 24px; height: 21px; place-items: center; padding-inline: 7px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 10px; font-weight: 750; }
.advanced-tools-panel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 18px; }
.tool-cluster h4 { margin: 0 0 8px; color: var(--text-2); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.tool-cluster .group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tool-cluster .tb-btn { min-height: 36px; padding: 6px 9px; font-size: 11px; }
.tool-cluster-display { align-self: start; }
.font-size-ctl { gap: 6px; }
.font-size-ctl button { width: 40px; min-height: 38px; padding: 5px; }
.drop-hint { padding: 12px 22px; color: var(--brand-dark); background: var(--brand-soft); border-bottom: 1px dashed var(--brand-line); font-size: 13px; font-weight: 650; }
.editor-card.dragover { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent), var(--shadow); }
.find-panel { display: none; align-items: center; gap: 9px; padding: 14px 22px; border-bottom: 1px solid var(--border); background: var(--surface); }
.find-panel.show { display: flex; }
.find-panel input[type="text"] { max-width: none; min-width: 160px; min-height: 42px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.find-panel input[type="text"]:focus { border-color: var(--brand); outline: 3px solid color-mix(in srgb, var(--brand) 16%, transparent); }
.find-panel .check-option { display: inline-flex; min-height: 38px; align-items: center; gap: 6px; color: var(--text-2); font-size: 11px; white-space: nowrap; }
.find-panel .check-option input { accent-color: var(--brand); width: 16px; height: 16px; }
.find-panel .result-count { min-width: 0; color: var(--brand-dark); font-size: 11px; white-space: nowrap; }
.find-close { margin-left: auto; min-width: 38px; font-size: 18px; }
.editor-surface { margin: 20px 22px 0; overflow: hidden; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.editor-surface:focus-within { border-color: color-mix(in srgb, var(--brand) 55%, var(--border)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 11%, transparent); }
.editor-surface-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; padding: 9px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.editor-surface-head > div { display: flex; align-items: center; gap: 10px; }
.editor-surface-head strong { color: var(--text); font-size: 12px; }
.surface-format, .surface-hint { color: var(--text-2); font-size: 10px; }
.surface-format { padding: 3px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.surface-hint { text-align: right; }
#editor { width: 100%; height: clamp(420px, 54vh, 680px); min-height: 360px; padding: 22px 24px; border: 0; background: var(--surface); color: var(--text); font: var(--editor-font)/1.8 "Cascadia Code", Consolas, "Sarasa Mono SC", monospace; letter-spacing: .005em; resize: vertical; tab-size: 4; }
#editor::placeholder { color: color-mix(in srgb, var(--text-2) 62%, transparent); }
#editor:focus { outline: none; }
.editor-help { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 16px; border-top: 1px solid var(--border); color: var(--text-2); background: var(--surface); font-size: 10px; }
.editor-help > span:first-child { color: var(--brand-dark); }
.statusbar { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 14px 22px 18px; border: 0; background: var(--surface); color: var(--text-2); font-size: 10px; }
.statusbar .stat { display: inline-flex; align-items: baseline; gap: 6px; min-height: 30px; padding: 5px 9px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.statusbar .stat b { color: var(--text); font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; }
.statusbar .save-dot { margin-left: auto; color: var(--brand-dark); border-color: var(--brand-line); background: var(--brand-soft); }

/* Supporting content */
.section { padding: 72px 0; }
.section > .container > h2 { display: flex; align-items: center; gap: 13px; margin: 0 0 10px; color: var(--text); font-size: clamp(24px, 2.8vw, 32px); font-weight: 720; letter-spacing: -.045em; }
.section > .container > h2::before { width: 4px; height: 27px; border-radius: 4px; background: var(--accent); content: ""; }
.section .sub { max-width: 740px; margin: 0 0 26px; color: var(--text-2); font-size: 14px; line-height: 1.75; }
#facts, #compare { background: var(--surface-2); }
.grid { gap: 16px; }
.card { padding: 23px; border-color: var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 5px 18px rgba(24, 50, 46, .035); transition: border-color .16s, box-shadow .16s, transform .16s; }
.card:hover { border-color: var(--brand-line); box-shadow: var(--shadow); transform: translateY(-2px); }
.card h3 { color: var(--text); font-size: 15px; letter-spacing: -.02em; }
.card p { color: var(--text-2); font-size: 13px; line-height: 1.75; }
.card .icon { width: 42px; height: 42px; margin-bottom: 16px; border: 1px solid var(--brand-line); border-radius: 13px; background: var(--brand-soft); color: var(--brand); }
.facts { gap: 12px; }
.fact { padding: 15px 16px; border: 1px solid var(--border); border-left: 3px solid var(--brand); border-radius: 12px; background: var(--surface); }
.fact .k { color: var(--text-2); font-size: 11px; }
.fact .v { margin-top: 4px; color: var(--text); font-size: 13px; font-weight: 700; }
.steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.step { display: block; min-height: 178px; padding: 22px; border-color: var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 5px 18px rgba(24, 50, 46, .035); }
.step::before { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 16px; border-radius: 12px; background: var(--brand); color: #fff; font-size: 14px; }
.step h3 { margin: 0 0 6px; color: var(--text); font-size: 14px; }
.step p { color: var(--text-2); font-size: 12px; line-height: 1.75; }
.table-wrap { border-color: var(--border); border-radius: 15px; background: var(--surface); box-shadow: 0 8px 28px rgba(24, 50, 46, .05); }
table { font-size: 13px; }
th, td { padding: 13px 16px; border-color: var(--border); }
thead th { background: var(--surface-2); color: var(--text-2); font-size: 11px; letter-spacing: .02em; }
tbody tr:hover { background: color-mix(in srgb, var(--brand-soft) 58%, var(--surface)); }
td.yes { color: var(--ok); }
.faq { max-width: 900px; gap: 9px; }
.faq details { border-color: var(--border); border-radius: 13px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.faq details[open] { border-color: var(--brand-line); box-shadow: 0 7px 20px rgba(24, 50, 46, .045); }
.faq summary { display: flex; min-height: 54px; align-items: center; padding: 13px 48px 13px 18px; color: var(--text); font-size: 13px; }
.faq summary::after { color: var(--brand); }
.faq .faq-a { padding: 0 18px 17px; color: var(--text-2); font-size: 12px; line-height: 1.8; }
.notice { padding: 13px 15px; border: 1px solid var(--brand-line); border-radius: 12px; background: var(--brand-soft); color: var(--text-2); font-size: 12px; }
#about .container { max-width: 1124px; padding: 31px 34px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: 0 8px 26px rgba(24, 50, 46, .045); }
#about .container > p:not(.notice) { max-width: 950px; color: var(--text-2); font-size: 13px; line-height: 1.85; }

/* Privacy pages */
.policy-main { min-height: calc(100vh - 155px); }
.policy-section { padding: 58px 0 76px; }
.policy-card { max-width: 850px; padding: clamp(26px, 5vw, 54px); border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.policy-card h1 { margin: 0 0 7px; color: var(--text); font-size: clamp(34px, 5vw, 46px); font-weight: 730; line-height: 1.2; letter-spacing: -.05em; }
.policy-card .sub { padding-bottom: 20px; border-bottom: 1px solid var(--border); color: var(--text-2); font-size: 12px; }
.policy-card h2 { margin: 30px 0 8px; color: var(--text); font-size: 18px; letter-spacing: -.025em; }
.policy-card p { color: var(--text-2); font-size: 14px; line-height: 1.85; }
.policy-card a { font-weight: 650; }

/* Footer and keyboard focus */
.site-footer { margin-top: 0; border-top: 1px solid var(--border); background: var(--surface); }
.footer-grid { padding: 38px 0 28px; }
.footer-grid h4 { color: var(--text); font-size: 13px; }
.footer-grid p, .footer-links a { color: var(--text-2); font-size: 12px; }
.footer-links a:hover { color: var(--brand); }
.footer-bottom { padding-block: 15px; border-color: var(--border); color: var(--text-2); font-size: 11px; }
button:focus-visible, summary:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 3px; }

@media (max-width: 920px) {
  .hero-layout { grid-template-columns: minmax(0, 1fr) minmax(280px, .82fr); gap: 30px; }
  .hero h1 { font-size: clamp(34px, 5vw, 46px); }
  .editor-head { padding: 24px 22px 19px; }
  .toolbar-tools { margin-left: 0; }
  .advanced-tools-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .find-panel { flex-wrap: wrap; }
  .find-panel input[type="text"] { flex: 1 1 210px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .container { padding-inline: 20px; }
  .header-inner { gap: 8px 14px; }
  .header-nav { width: 100%; margin-left: 0; justify-content: space-between; gap: 10px; }
  .header-nav a { font-size: 11px; }
  .site-header nav { gap: 13px; }
  .hero { padding: 46px 0 35px; }
  .hero-layout { grid-template-columns: 1fr; gap: 25px; }
  .hero-preview { max-width: 520px; }
  .preview-window { transform: none; }
  .editor-container { padding-inline: 12px; }
  .editor-card { border-radius: 17px; }
  .editor-head { display: block; padding: 21px 18px 16px; }
  .editor-title-group h2 { font-size: 21px; }
  .editor-head-meta { justify-content: flex-start; padding-top: 13px; }
  .toolbar { padding: 12px; }
  .toolbar-main { display: block; }
  .toolbar-primary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar-primary .tb-btn { width: 100%; justify-content: center; }
  .toolbar-primary #btn-download { grid-column: span 2; }
  .toolbar-tools { display: grid; grid-template-columns: 1fr 1fr; margin-top: 9px; }
  .toolbar-tools > * { width: 100%; }
  .toolbar-tools .tb-btn { width: 100%; justify-content: center; }
  .advanced-tools { padding: 13px; }
  .advanced-tools-panel { grid-template-columns: 1fr; gap: 13px; }
  .tool-cluster .tb-btn { min-height: 40px; }
  .find-panel { gap: 8px; padding: 12px; }
  .find-panel input[type="text"] { flex-basis: 100%; }
  .find-panel .check-option { min-height: 40px; }
  .find-close { margin-left: auto; }
  .editor-surface { margin: 14px 12px 0; border-radius: 13px; }
  .editor-surface-head { align-items: flex-start; padding: 10px 12px; }
  .surface-hint { max-width: 45%; }
  #editor { height: 52vh; min-height: 310px; padding: 15px 14px; font-size: max(14px, var(--editor-font)); }
  .editor-help { align-items: flex-start; flex-direction: column; gap: 2px; padding: 9px 12px; }
  .statusbar { gap: 6px; padding: 12px; }
  .statusbar .stat { min-height: 29px; padding: 5px 8px; }
  .statusbar .save-dot { margin-left: 0; }
  .section { padding: 50px 0; }
  .card { padding: 18px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact { padding: 12px; }
  .fact .v { font-size: 12px; }
  .steps { grid-template-columns: 1fr; }
  .step { min-height: 0; }
  #about .container { padding: 23px 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .footer-bottom { display: grid; }
  .policy-section { padding: 32px 0 48px; }
  .policy-card { padding: 25px 22px; border-radius: 16px; }
}

@media (max-width: 420px) {
  .container { padding-inline: 15px; }
  .editor-container { padding-inline: 8px; }
  .header-nav { gap: 7px; }
  .header-nav a { font-size: 10px; }
  .site-header nav { gap: 10px; }
  .lang-select { max-width: 106px; padding-inline: 7px; font-size: 12px; }
  .hero { padding-top: 36px; }
  .hero h1 { font-size: 34px; }
  .hero .lead { font-size: 14px; }
  .preview-lines { padding-block: 21px; font-size: 11px; }
  .privacy-badge, .shortcut-hint { font-size: 10px; }
  .shortcut-hint { display: none; }
  .toolbar-primary .tb-btn { padding-inline: 8px; font-size: 11px; }
  .statusbar .stat { font-size: 9px; }
  .section > .container > h2 { font-size: 23px; }
  .facts { gap: 8px; }
  .fact { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Fullscreen editing */
.editor-card:fullscreen,
.editor-card.editor-fallback-fullscreen {
  display: flex;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}
.editor-card:fullscreen::backdrop { background: var(--bg); }
body.editor-fullscreen-fallback { overflow: hidden; }
body.editor-fullscreen-fallback .editor-container { position: static; z-index: auto; max-width: none; margin: 0; padding: 0; }
.editor-card:fullscreen .editor-head,
.editor-card.editor-fallback-fullscreen .editor-head { flex: none; padding: 14px 22px 10px; }
.editor-card:fullscreen .editor-head-meta,
.editor-card.editor-fallback-fullscreen .editor-head-meta { padding-top: 5px; }
.editor-card:fullscreen .toolbar,
.editor-card.editor-fallback-fullscreen .toolbar { max-height: min(38vh, 340px); flex: none; overflow-y: auto; }
.editor-card:fullscreen .editor-surface,
.editor-card.editor-fallback-fullscreen .editor-surface { display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; margin: 12px 16px 0; }
.editor-card:fullscreen .editor-surface-head,
.editor-card.editor-fallback-fullscreen .editor-surface-head,
.editor-card:fullscreen .editor-help,
.editor-card.editor-fallback-fullscreen .editor-help { flex: none; }
.editor-card:fullscreen #editor,
.editor-card.editor-fallback-fullscreen #editor { height: auto; min-height: 0; flex: 1 1 auto; resize: none; }
.editor-card:fullscreen .statusbar,
.editor-card.editor-fallback-fullscreen .statusbar { flex: none; padding-block: 10px; }

/* Keep every editor action in one compact, left-aligned toolbar */
.toolbar { padding: 10px 16px 12px; }
.toolbar-main { justify-content: flex-start; gap: 7px; }
.toolbar-primary { gap: 5px; }
.toolbar-tools { gap: 5px; margin-left: 3px; padding-left: 11px; border-left: 1px solid var(--border); }
.advanced-tools { margin-top: 9px; padding: 9px 3px 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; }
.advanced-tools-head { gap: 7px; margin-bottom: 7px; }
.advanced-tools-head h3 { font-size: 11px; }
.tools-count { min-width: 22px; height: 18px; padding-inline: 6px; font-size: 9px; }
.advanced-tools-panel { gap: 8px 14px; }
.tool-cluster h4 { margin-bottom: 5px; font-size: 9px; }
.tool-cluster .tb-btn { min-height: 32px; padding: 4px 7px; border-radius: 8px; font-size: 10px; }
.font-size-ctl button { width: 34px; min-height: 32px; }

@media (max-width: 760px) {
  .toolbar { padding: 10px 12px 12px; }
  .toolbar-main { gap: 0; }
  .toolbar-tools { gap: 6px; margin-left: 0; padding-left: 0; border-left: 0; }
  .advanced-tools { margin-top: 9px; padding: 9px 0 0; }
  .advanced-tools-panel { gap: 10px 12px; }
  .tool-cluster .tb-btn { min-height: 36px; }
}

@media (max-width: 420px) {
  .advanced-tools { padding-top: 8px; }
  .advanced-tools-panel { gap: 9px; }
  .tool-cluster .tb-btn { padding-inline: 6px; font-size: 9px; }
}

/* Unified action strip: file, editor, and text tools share the same flow */
.toolbar { padding: 11px 14px; background: var(--surface-2); }
.toolbar-flow { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; }
.toolbar-primary, .toolbar-tools { display: flex; min-width: 0; align-items: center; gap: 4px; margin: 0; padding: 0 8px 0 0; border: 0; border-right: 1px solid var(--border); flex-wrap: wrap; }
.toolbar-primary .tb-btn, .toolbar-tools .tb-btn { min-height: 36px; padding: 6px 10px; font-size: 11px; }
.tool-cluster { display: flex; min-width: 0; max-width: 100%; align-items: center; gap: 6px; padding: 0 2px; }
.tool-label { flex: none; color: var(--text-2); font-size: 9px; font-weight: 750; letter-spacing: .015em; white-space: nowrap; }
.tool-cluster .group { display: flex; min-width: 0; align-items: center; gap: 4px; flex-wrap: wrap; }
.tool-cluster .tb-btn { min-height: 30px; padding: 4px 7px; border-radius: 8px; font-size: 9px; }
.font-size-ctl button { width: 32px; min-height: 30px; }

@media (max-width: 760px) {
  .toolbar { padding: 10px 12px; }
  .toolbar-flow { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .toolbar-primary { display: grid; grid-column: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 0 7px; border-right: 0; border-bottom: 1px solid var(--border); }
  .toolbar-primary .tb-btn { width: 100%; justify-content: center; }
  .toolbar-primary #btn-download { grid-column: span 2; }
  .toolbar-tools { display: grid; grid-column: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 0 7px; border-right: 0; border-bottom: 1px solid var(--border); }
  .toolbar-tools .tb-btn { width: 100%; justify-content: center; }
  .tool-cluster { width: 100%; align-items: flex-start; gap: 7px; padding: 3px 0; }
  .tool-label { min-width: 68px; padding-top: 8px; }
  .tool-cluster .group { flex: 1; }
  .tool-cluster .tb-btn { min-height: 34px; }
}

@media (max-width: 420px) {
  .toolbar-primary .tb-btn, .toolbar-tools .tb-btn { padding-inline: 7px; font-size: 10px; }
  .tool-label { min-width: 58px; font-size: 8px; }
  .tool-cluster .tb-btn { padding-inline: 6px; font-size: 9px; }
}
