/* office.HUGINOR — UI/UX system aligned to the live huginor.de visual language.
   Live audit: 30.09.2026. Verified source values: #16485d, #1c5166, #245e72,
   #90f0da and #ffffff; Avenir Next weights 400/600/700 were present in the
   page's font declarations. Font binaries are intentionally not copied. */

:root {
  --huginor-teal: #16485d;
  --huginor-teal-mid: #1c5166;
  --huginor-teal-light: #245e72;
  --huginor-mint: #90f0da;
  --huginor-white: #ffffff;

  --ink: #ffffff;
  --muted: rgba(255,255,255,.72);
  --line: #245e72;
  --line-strong: #90f0da;
  --surface: #1c5166;
  --surface-soft: #245e72;
  --canvas: #16485d;
  --brand: #90f0da;
  --brand-dark: #16485d;
  --brand-soft: rgba(144,240,218,.12);

  --success: #90f0da;
  --warning: #ffd166;
  --danger: #ffc1bb;
  --info: #90f0da;
  --focus: #90f0da;
  --shadow: none;
  --shadow-raised: none;

  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;
  --radius-xl: 0;
  --sidebar-width: 224px;
  --topbar-height: 68px;
  --content-width: 1180px;
  --motion: 160ms ease;
  --font-ui: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  --document-ink: #16485d;
  --document-muted: #245e72;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--canvas); }
body.office-ui {
  margin: 0;
  min-width: 320px;
  background: linear-gradient(115deg, #16485d 15%, #1c5166 65%, #245e72);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0;
}
body.office-ui::before { content: none; }

/* Application primitives are intentionally isolated from third-party UI chrome.
   TinyMCE owns everything below .tox and must not inherit our button/form reset. */
.office-ui :where(img, svg):where(:not(.tox *)) { max-width: 100%; }
.office-ui :where(a):where(:not(.tox *)) { color: inherit; text-decoration: none; }
.office-ui :where(a):where(:not(.tox *)):hover { text-decoration: none; }

.office-ui :where(button, .button):where(:not(.tox *)) {
  appearance: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--brand);
  border-radius: 0;
  padding: 10px 18px;
  background: var(--brand);
  color: var(--brand-dark);
  font: inherit;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  transition: background var(--motion), border-color var(--motion), color var(--motion), transform var(--motion);
}
.office-ui :where(button, .button):where(:not(.tox *)):hover { background: var(--huginor-white); border-color: var(--huginor-white); color: var(--brand-dark); transform: none; }
.office-ui :where(button:disabled, .button[aria-disabled="true"]):where(:not(.tox *)) { opacity: .5; cursor: not-allowed; transform: none; }
.button.secondary { background: transparent; color: var(--brand); border-color: var(--brand); }
.button.secondary:hover { background: var(--brand); color: var(--brand-dark); border-color: var(--brand); }
.button.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.button.ghost:hover { background: var(--surface-soft); border-color: var(--brand); color: var(--brand); }
.danger-button, .button.danger {
  color: var(--danger);
  border-color: var(--danger);
  background: transparent;
}
.danger-button:hover, .button.danger:hover { background: var(--danger); border-color: var(--danger); color: var(--brand-dark); }

.office-ui :where(button, .button, a, summary, input, textarea, select, [contenteditable="true"]):where(:not(.tox *)):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.office-ui :where(input, textarea, select):where(:not(.tox *)) {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--document-muted);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--huginor-white);
  color: var(--document-ink);
  font: inherit;
}
.office-ui :where(textarea):where(:not(.tox *)) { min-height: 100px; resize: vertical; }
.office-ui :where(input, textarea, select):where(:not(.tox *)):focus { border-color: var(--document-ink); }
.office-ui :where(input[type="checkbox"], input[type="radio"]):where(:not(.tox *)) { width: auto; min-height: auto; accent-color: var(--brand); }
.office-ui :where(label):where(:not(.tox *)) { display: block; margin: 12px 0 6px; color: var(--ink); font-weight: 600; }
.office-ui :where(label):where(:not(.tox *)):first-child { margin-top: 0; }

.ui-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-only, .ui-icon-button, .icon-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--brand);
  font-size: 0;
  cursor: pointer;
  vertical-align: middle;
  transition: background var(--motion), border-color var(--motion), color var(--motion);
}
.icon-only:hover, .ui-icon-button:hover, .icon-button:hover { background: var(--brand); border-color: var(--brand); color: var(--brand-dark); transform: none; }
.icon-only.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.icon-only.quiet:hover { background: var(--surface-soft); border-color: var(--line); color: var(--ink); }
.icon-button.is-favorite { color: var(--brand-dark); background: var(--brand); border-color: var(--brand); }
.icon-button.is-favorite .ui-icon { fill: currentColor; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  width: var(--sidebar-width);
  height: 100vh;
  flex: 0 0 var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  background: var(--huginor-teal);
  color: var(--huginor-white);
  border-right: 1px solid var(--huginor-teal-light);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 28px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 0;
  background: var(--huginor-mint);
  color: var(--huginor-teal);
  font-size: 12px;
  font-weight: 700;
}
.brand-name { white-space: nowrap; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 11px;
  border-radius: 0;
  color: rgba(255,255,255,.72);
  font-size: 15px;
  font-weight: 600;
  transition: background var(--motion), color var(--motion);
}
.sidebar nav a .ui-icon { width: 19px; height: 19px; }
.sidebar nav a:hover, .sidebar nav a.active { background: var(--huginor-teal-mid); color: var(--huginor-white); }
.sidebar nav a.active { box-shadow: inset 3px 0 0 var(--huginor-mint); }
.sidebar .spacer { flex: 1; }
.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 9px 0;
  border-top: 1px solid var(--huginor-teal-light);
  color: rgba(255,255,255,.65);
  font-size: 12px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--huginor-mint); box-shadow: none; }

.main { min-width: 0; flex: 1; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--huginor-teal);
  backdrop-filter: none;
  border-bottom: 1px solid var(--huginor-teal-light);
}
.topbar-leading, .topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-title { font-size: 15px; font-weight: 600; letter-spacing: 0; }
.sidebar-toggle { display: none; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 0; background: var(--huginor-mint); color: var(--huginor-teal); font-weight: 700; }

.page { width: 100%; max-width: var(--content-width); margin: 0 auto; padding: 48px clamp(18px,3vw,40px) 72px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading h1 { margin: 3px 0 8px; font-size: clamp(36px,4vw,56px); line-height: 1; letter-spacing: -.035em; font-weight: 700; }
.page-heading p { max-width: 700px; margin: 3px 0; }
.eyebrow { display: inline-block; color: var(--huginor-mint); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.muted { color: var(--muted); }
.heading-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.heading-actions form { margin: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: none;
}
.card h2, .card h3 { margin: 0 0 12px; letter-spacing: -.025em; }
.card-link { transition: transform var(--motion), border-color var(--motion); }
.card-link:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.stat-label { color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.stat-value { margin-top: 5px; font-size: 1.55rem; font-weight: 700; letter-spacing: -.04em; overflow-wrap: anywhere; }

.badge, .status-badge, .access-badge, .approval-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--success);
  border-radius: 0;
  background: var(--surface-soft);
  color: var(--success);
  font-size: .74rem;
  font-weight: 600;
  line-height: 1.1;
}
.badge.off { border-color: var(--line); background: var(--surface-soft); color: var(--muted); }
.status-badge .ui-icon { width: 14px; height: 14px; }
.status-draft { border-color: var(--line); background: var(--surface-soft); color: var(--muted); }
.status-review { border-color: var(--warning); background: var(--surface-soft); color: var(--warning); }
.status-approved { border-color: var(--success); background: var(--surface-soft); color: var(--success); }

.error, .success, .migration-notice {
  margin: 0 0 16px;
  padding: 11px 13px;
  border-radius: var(--radius-md);
  border: 1px solid;
}
.error { color: var(--danger); background: var(--surface-soft); border-color: var(--danger); }
.success { color: var(--success); background: var(--surface-soft); border-color: var(--success); }
.migration-notice { color: var(--warning); background: var(--surface-soft); border-color: var(--warning); }
.migration-notice code { font-weight: 700; }

.home-hero {
  padding: clamp(48px,7vw,88px);
  border: 1px solid var(--huginor-teal-light);
  border-radius: 0;
  background: linear-gradient(115deg, #16485d 15%, #1c5166 65%, #245e72);
}
.home-hero h1 { max-width: 820px; margin: 12px 0 20px; font-size: clamp(44px,6vw,68px); line-height: .96; letter-spacing: -.045em; font-weight: 700; }
.home-hero p { max-width: 660px; margin: 0; color: var(--huginor-white); font-size: 18px; line-height: 1.55; }
.home-hero .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.module-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-top: 18px; }
.module-card {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: transform var(--motion), border-color var(--motion);
}
.module-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.module-icon, .object-icon, .file-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 0;
  background: var(--surface-soft);
  color: var(--huginor-mint);
}
.module-card .module-icon { margin-bottom: auto; border-radius: 0; }
.module-card h2 { margin: 22px 0 4px; font-size: 1.16rem; letter-spacing: -.025em; }
.module-card p { margin: 0; color: var(--muted); font-size: .86rem; }
.module-card .arrow { align-self: flex-end; margin-top: 12px; color: var(--muted); }

.toolbar-compact, .create-strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.create-strip { justify-content: flex-end; margin-bottom: 16px; }
.search-wrap { position: relative; flex: 1; min-width: min(340px,100%); }
.search-wrap .ui-icon { position: absolute; left: 13px; top: 13px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search-wrap input { padding-left: 40px; }

.object-list, .file-list, .admin-list, .document-grid { display: grid; gap: 8px; }
.object-row, .file-row, .admin-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color var(--motion), background var(--motion);
}
.doc-card {
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  grid-template-rows: auto auto auto;
  align-items: center;
  gap: 2px 14px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color var(--motion), background var(--motion);
}
.object-row:hover, .file-row:hover, .admin-row:hover, .doc-card:hover { border-color: var(--line-strong); }
.object-title, .file-title, .doc-title { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.object-meta, .file-meta, .doc-meta { display: flex; gap: 5px 14px; flex-wrap: wrap; margin-top: 3px; color: var(--muted); font-size: .78rem; }
.object-meta span + span::before, .file-meta span + span::before, .doc-meta span + span::before { content: "·"; margin-right: 14px; color: #90f0da; }
.row-actions { display: flex; align-items: center; gap: 6px; }
.row-actions form { margin: 0; }
.doc-card-head { min-width: 0; grid-column: 1; grid-row: 1; }
.doc-card-head > div { min-width: 0; }
.doc-card > .doc-meta { grid-column: 1; grid-row: 2; }
.doc-card > .category-chips { grid-column: 1; grid-row: 3; }
.doc-preview { max-width: 690px; margin: 3px 0 0; color: var(--muted); font-size: .82rem; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; }
.category-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.category-chips span { padding: 2px 7px; border-radius: 0; background: var(--surface-soft); color: var(--muted); font-size: .7rem; }

.action-menu, .doc-actions, .create-strip details { position: relative; margin: 0; }
.action-menu > summary, .doc-actions > summary, .create-strip details > summary { list-style: none; }
.action-menu > summary::-webkit-details-marker, .doc-actions > summary::-webkit-details-marker, .create-strip details > summary::-webkit-details-marker { display: none; }
.action-menu[open] > summary, .doc-actions[open] > summary { background: var(--brand); border-color: var(--brand); color: var(--brand-dark); }
.action-menu-panel, .doc-actions .action-panel {
  position: absolute;
  top: 50px;
  right: 0;
  z-index: 40;
  width: min(340px,calc(100vw - 40px));
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-raised);
}
.doc-actions .action-panel { min-width: 330px; }
.action-menu-panel form, .doc-actions .action-panel form { display: grid; gap: 8px; margin: 0; padding: 8px; border-radius: 0; background: var(--surface-soft); }
.doc-card > .action-panel {
  position: static;
  grid-column: 2;
  grid-row: 1 / 4;
  align-self: center;
  min-width: 0;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.doc-card > .action-panel form { margin: 0; }
.action-menu-panel .menu-link { min-height: 42px; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 0; font-weight: 600; }
.action-menu-panel .menu-link:hover { background: var(--surface-soft); }
.action-menu-panel .menu-danger { padding-top: 10px; margin-top: 2px; border-top: 1px solid var(--line); }
.doc-actions { grid-column: 2; grid-row: 1 / 4; justify-self: end; align-self: center; }
.doc-actions > summary { display: inline-flex; }

.empty-state {
  padding: 44px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
}
.empty-state > .ui-icon { width: 34px; height: 34px; margin-bottom: 12px; color: #90f0da; }
.empty-state strong { display: block; font-size: 1.02rem; }
.empty-state p { max-width: 440px; margin: 5px auto 0; }

/* Roadmap: compact progressive disclosure instead of a long wall of cards. */
.roadmap-list { display: grid; gap: 10px; }
.roadmap-item { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.roadmap-item > summary { list-style: none; }
.roadmap-item > summary::-webkit-details-marker { display: none; }
.roadmap-summary { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 17px; cursor: pointer; }
.roadmap-summary > span:first-child { display: grid; gap: 3px; }
.roadmap-summary strong { font-size: 1rem; letter-spacing: -.02em; }
.roadmap-status { max-width: 48%; color: var(--muted); font-size: .72rem; font-weight: 600; text-align: right; }
.roadmap-card { padding: 0 18px 18px; }
.roadmap-card p { margin: 14px 0 0; }
.roadmap-card ul { margin: 12px 0 0; padding-left: 18px; }
.roadmap-card li + li { margin-top: 5px; }
.roadmap-item[open] .roadmap-summary { border-bottom: 1px solid var(--line); background: var(--surface-soft); }

/* Login */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1.08fr) minmax(420px,.92fr); background: var(--huginor-teal); }
.login-visual { min-height: 100vh; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(48px,7vw,96px); background: linear-gradient(115deg, #16485d 15%, #1c5166 65%, #245e72); color: var(--huginor-white); }
.login-visual .brand { padding: 0; }
.login-visual .login-kicker { color: var(--huginor-mint); }
.login-visual h1 { max-width: 620px; margin: 14px 0 20px; font-size: clamp(44px,6vw,68px); line-height: .96; letter-spacing: -.045em; font-weight: 700; }
.login-visual p { max-width: 540px; margin: 0; color: var(--huginor-white); font-size: 18px; line-height: 1.55; }
.login-visual small { color: rgba(255,255,255,.65); }
.login-form { display: grid; place-items: center; padding: 30px; background: var(--huginor-teal); }
.login-form-inner { width: min(390px,100%); }
.login-form .brand { padding: 0 0 38px; color: var(--ink); }
.login-form .brand-mark { background: var(--huginor-mint); color: var(--huginor-teal); }
.login-form h1 { margin: 4px 0 8px; font-size: 40px; line-height: 1; letter-spacing: -.03em; font-weight: 700; }
.login-form form { margin-top: 24px; }
.login-form button { width: 100%; margin-top: 18px; }
.login-help { margin-top: 22px; }

/* Document manager */
.document-manager { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 16px; align-items: start; }
.document-sidebar { position: sticky; top: calc(var(--topbar-height) + 18px); padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.doc-nav { display: grid; gap: 3px; }
.doc-nav h3 { margin: 14px 9px 5px; color: var(--muted); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; }
.doc-nav a { min-height: 40px; display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 0; color: var(--ink); font-size: .86rem; }
.doc-nav a .ui-icon, .doc-title .ui-icon { width: 17px; height: 17px; }
.doc-nav a:hover, .doc-nav a.active { background: var(--surface-soft); }
.doc-nav a.danger-link { color: var(--danger); }
.doc-admin { display: grid; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.doc-admin p { margin: 0; font-size: .76rem; }
.manage-item { border-top: 1px solid var(--line); padding-top: 8px; }
.manage-item summary { cursor: pointer; color: var(--muted); font-size: .78rem; }
.manage-item form { margin-top: 8px; }
.document-main { min-width: 0; }
.doc-toolbar { display: grid; grid-template-columns: minmax(220px,1fr) minmax(180px,220px); gap: 8px; margin-bottom: 14px; }
.doc-toolbar button { width: 44px; padding: 0; }

/* New document / templates */
.template-picker { margin-top: 18px; }
.template-picker > p { max-width: 720px; }
.template-picker .template-section-title { margin-top: 24px; }
.template-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 14px; }
.template-card { display: grid; gap: 9px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.template-card h3, .template-card p { margin: 0; }
.template-card p { color: var(--muted); min-height: 42px; }
.import-button { position: relative; overflow: hidden; cursor: pointer; margin: 0; }
.import-button input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* Editor */
.editor-workspace { overflow: hidden; padding: 0; border-radius: var(--radius-lg); background: #16485d; }
.editor-status { display: inline-flex; align-items: center; margin: 16px 20px 0; padding: 7px 11px; border: 1px solid var(--success); border-radius: 0; background: var(--surface-soft); color: var(--success); font-size: .78rem; }
.editor-status-error { color: var(--warning); background: var(--surface-soft); border-color: var(--warning); }
.editor-workspace #word-form { padding: 16px 20px 24px; }
.editor-workspace #document-title { max-width: 850px; margin: 0 auto 14px; }
.layout-panel { max-width: 850px; margin: 0 auto 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.layout-panel summary { cursor: pointer; font-weight: 600; }
.layout-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px 14px; padding: 12px 0 2px; }
.layout-grid label { font-size: .78rem; }
.editor-workspace .editor,
.editor-workspace .tox-tinymce-inline {
  width: min(100%,var(--page-width,210mm));
  max-width: none;
  min-height: var(--page-min-height,297mm);
  margin: 0 auto;
  border: 0;
  border-radius: 0;
  background: var(--huginor-white);
  color: var(--document-ink);
  box-shadow: none;
}
.editor-workspace .editor {
  color: var(--document-ink);
  padding: var(--margin-top,20mm) var(--margin-right,20mm) var(--margin-bottom,20mm) var(--margin-left,20mm);
  outline: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.7;
}
.editor-workspace .editor h1 { font-size: 2em; }
.editor-workspace .editor h2 { font-size: 1.5em; }
.editor-workspace .editor h3 { font-size: 1.2em; }
.editor-workspace .editor img { max-width: 100%; height: auto; }
.editor-workspace .editor blockquote { margin: 1rem 0; padding-left: 1rem; border-left: 3px solid var(--huginor-mint); color: var(--document-muted); }
.editor-workspace .editor table { width: 100%; border-collapse: collapse; }
.editor-workspace .editor th, .editor-workspace .editor td { padding: 8px; border: 1px solid var(--document-muted); color: var(--document-ink); text-align: left; }
.editor-workspace .editor:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* TinyMCE integration boundary: the editor skin controls .tox; only the editable page is sized here. */
.editor-workspace .tox-tinymce-inline { background: var(--huginor-white); color: var(--document-ink); }
.editor-workspace .tox-edit-area__iframe, .editor-workspace .tox-edit-area { min-height: 680px; }
.editor-workspace #editor.mce-content-body { min-height: 680px; padding: var(--margin-top,20mm) var(--margin-right,20mm) var(--margin-bottom,20mm) var(--margin-left,20mm); outline: 0; color: var(--document-ink); font-family: Georgia,"Times New Roman",serif; font-size: 16px; line-height: 1.7; }
.page-header-preview, .page-footer-preview { width: min(100%,var(--page-width,210mm)); max-width: 850px; min-height: 26px; margin: 0 auto; padding: 6px 24px; background: var(--huginor-white); color: var(--document-muted); font-size: 12px; }
.page-header-preview { border-bottom: 1px dashed var(--line); text-align: left; }
.page-footer-preview { border-top: 1px dashed var(--line); text-align: center; }
.editor .page-break { margin: 28px 0; border-top: 2px dashed var(--huginor-mint); color: var(--document-muted); text-align: center; break-before: page; page-break-before: always; }
.save-row { max-width: 850px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 16px auto 0; }
.save-hint { margin-right: auto; color: var(--muted); font-size: .78rem; }
.save-state { min-height: 28px; display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 0; font-size: .74rem; font-weight: 600; }
.save-state-clean { color: var(--success); background: var(--surface-soft); }
.save-state-dirty { color: var(--warning); background: var(--surface-soft); }
.save-state-saving { color: var(--info); background: var(--surface-soft); }
.save-state-error { color: var(--danger); background: var(--surface-soft); }
.template-save { max-width: 850px; display: flex; gap: 8px; margin: 14px auto 0; }
.editor-file-notice { margin-bottom: 16px; }
.inline-form { display: inline; }
.onlyoffice-host { height: 75vh; min-height: 520px; }
.autosave-settings { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.autosave-settings label { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.autosave-settings input[type="number"] { width: 84px; }

/* Collaboration, comments, history */
.utility-disclosure {
  margin: 16px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.section-summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: -.02em;
}
.section-summary::-webkit-details-marker { display: none; }
.section-summary span { color: var(--muted); font-size: .76rem; font-weight: 700; }
.utility-disclosure[open] > .section-summary,
.document-history[open] > .section-summary { border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.utility-body { padding: 0 16px 16px; }
.collaboration-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin: 16px 0; }
.collaboration-grid .card { min-width: 0; }
.collaboration-grid form, .comments-panel form { margin-top: 12px; }
.permission-list { display: grid; gap: 8px; margin: 16px 0; }
.permission-list form, .comment { padding-top: 12px; border-top: 1px solid var(--line); }
.comment.resolved { opacity: .72; }
.comment.resolved p { text-decoration: line-through; }
.comment-form textarea { min-height: 90px; }
.document-history { margin-top: 16px; }
.version-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.version-row:first-of-type { margin-top: 10px; }
.version-row > div { min-width: 0; flex: 1; }
.version-row form { flex: 0 0 auto; margin: 0; }
.version-label { display: inline-block; margin-right: 5px; padding: 2px 7px; border: 1px solid currentColor; border-radius: 0; font-size: .72rem; font-weight: 600; }
.document-history .version-label-form, .document-history .version-compare-form { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; padding: 0; background: transparent; }
.version-label-form input { min-width: 190px; }
.history-pagination { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; }
.diff-legend { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.diff-content { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.diff-content ins, .diff-legend ins { padding: 1px 3px; border-bottom: 2px solid var(--success); text-decoration: none; }
.diff-content del, .diff-legend del { padding: 1px 3px; border-bottom: 2px dashed var(--danger); text-decoration: line-through; }
.layout-diff { display: grid; gap: 7px; }

/* Files */
.create-strip details > .action-menu-panel { width: 320px; }
.file-preview-card { min-height: 60vh; overflow: hidden; padding: 0; background: var(--huginor-white); }
.file-preview-frame { display: block; width: 100%; height: 78vh; border: 0; background: var(--huginor-white); }
.file-preview-image-wrap { min-height: 60vh; display: flex; align-items: center; justify-content: center; overflow: auto; padding: 24px; background: var(--huginor-white); }
.file-preview-image { display: block; max-width: 100%; max-height: 78vh; height: auto; object-fit: contain; }

/* Admin and rare comparison tables. */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 0; background: var(--surface); }
.table-wrap table { width: 100%; min-width: 620px; border-collapse: collapse; }
.table-wrap th, .table-wrap td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.table-wrap th { background: var(--surface-soft); color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.table-wrap tr:last-child td { border-bottom: 0; }
.check-label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }

@media (max-width: 1020px) {
  .module-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .document-manager { grid-template-columns: 1fr; }
  .document-sidebar { position: static; }
  .doc-nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .doc-nav h3 { grid-column: 1 / -1; }
  .doc-admin { display: none; }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(280px,86vw);
    transform: translateX(-102%);
    box-shadow: var(--shadow-raised);
    transition: transform 180ms ease;
  }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-open::after { content: ""; position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.28); }
  .sidebar-toggle { display: inline-flex; }
  .topbar { padding: 0 14px; }
  .page { padding: 24px 14px 52px; }
  .module-grid, .grid-2, .stats, .template-grid, .collaboration-grid { grid-template-columns: 1fr; }
  .document-sidebar { overflow: auto; }
  .doc-nav { display: flex; min-width: max-content; }
  .doc-nav h3 { display: none; }
  .doc-nav a { white-space: nowrap; }
  .layout-grid { grid-template-columns: 1fr; }
  .editor-workspace .editor, .editor-workspace .tox-tinymce-inline { width: 100%; min-height: 70vh; }
  .editor-workspace #editor.mce-content-body { min-height: 480px; padding: 36px 24px; }
  .file-preview-frame { height: 70vh; }
  .file-preview-image-wrap { min-height: 45vh; padding: 10px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-form { min-height: 100vh; }
}

@media (max-width: 480px) {
  .topbar-title { max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions .status-badge, .avatar { display: none; }
  .page-heading { display: block; }
  .heading-actions { margin-top: 14px; }
  .heading-actions .button.icon-collapse { width: 44px; padding: 0; font-size: 0; }
  .home-hero { padding: 34px 22px; }
  .home-hero h1 { font-size: clamp(2.25rem,15vw,3.8rem); }
  .module-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 150px; }
  .object-row, .file-row, .admin-row { grid-template-columns: auto minmax(0,1fr); gap: 10px; }
  .doc-card { grid-template-columns: minmax(0,1fr) auto; gap: 2px 10px; }
  .row-actions { grid-column: 2; justify-self: end; }
  .doc-actions, .doc-card > .action-panel { grid-column: 2; grid-row: 1 / 4; justify-self: end; }
  .object-meta, .file-meta, .doc-meta { display: grid; gap: 2px; }
  .object-meta span + span::before, .file-meta span + span::before, .doc-meta span + span::before { content: none; }
  .doc-preview { -webkit-line-clamp: 2; }
  .create-strip { justify-content: stretch; }
  .create-strip > details { flex: 1; }
  .create-strip > details > summary { width: 100%; border-radius: 0; }
  .create-strip .action-menu-panel, .doc-actions .action-panel { left: auto; right: 0; width: min(340px,calc(100vw - 28px)); min-width: 0; }
  .doc-toolbar { grid-template-columns: 1fr; }
  .doc-toolbar select { grid-column: 1; grid-row: 2; }
  .save-row { align-items: stretch; flex-direction: column; }
  .save-row > * { width: 100%; }
  .save-hint { margin-right: 0; }
  .template-save { display: grid; }
  .version-row { flex-direction: column; }
  .version-row form, .version-label-form input { width: 100%; min-width: 0; }
  .roadmap-summary { align-items: flex-start; flex-direction: column; gap: 7px; }
  .roadmap-status { max-width: 100%; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media print {
  .sidebar, .topbar, .page-heading, .editor-status, .layout-panel, .save-row, .document-history, .template-save, .collaboration-grid, .comments-panel { display: none !important; }
  .page { max-width: none; padding: 0; }
  .editor-workspace { background: var(--huginor-white); color: var(--document-ink); }
  .editor-workspace .editor { box-shadow: none; }
  .page-break { break-before: page; page-break-before: always; }
}
