@font-face { font-family: "Inter"; src: url("vendor/fonts/InterVariable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Noto Sans Hebrew"; src: url("vendor/fonts/NotoSansHebrew-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Noto Sans Hebrew"; src: url("vendor/fonts/NotoSansHebrew-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }

:root {
  --bg: #eceef0;
  --surface: #f7f8f9;
  --surface-2: #eef1f4;
  --surface-3: #e2e7ec;
  --text: #28333f;
  --muted: #55616f;
  --faint: #616d79;
  --border: #ccd3da;
  --border-strong: #aab7c3;
  --accent: #3e6489;
  --accent-hover: #2e506f;
  --accent-soft: #e0e9f2;
  --gold: #9a7445;
  --gold-soft: #f1e7d7;
  --success: #4e7464;
  --warning: #926932;
  --danger: #a9453f;
  --danger-soft: #f8e7e4;
  --focus: #395f86;
  --ink-on-strong: #f6f8fa;
  --sidebar: 272px;
  --topbar: 78px;
  --shadow-sm: 0 1px 2px rgba(40,52,68, .08), 0 8px 22px rgba(40,52,68, .055);
  --shadow-md: 0 24px 58px rgba(40,52,68, .15);
  --r-sm: 10px;
  --r-md: 13px;
  --r-lg: 17px;
  --r-xl: 22px;
  --r-pill: 999px;
  --border-hover: #97a9bc;
  --ring: 0 0 0 4px rgba(62,100,137, .13);
  --ease: cubic-bezier(.2, .7, .2, 1);
  font-family: "Inter", "Noto Sans Hebrew", "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", "Noto Sans Hebrew", "Noto Sans Arabic", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; max-width: 100%; }
html { overflow-x: hidden; overflow-y: auto; background: var(--bg); -webkit-text-size-adjust: 100%; }
body { min-width: 0; min-height: 100dvh; margin: 0; overflow-x: hidden; overflow-y: visible; background: radial-gradient(circle at 86% -10%, rgba(153,174,197, .17), transparent 30rem), linear-gradient(145deg, #eceef0 0%, #e5e8ec 100%); color: var(--text); font-size: 15px; line-height: 1.56; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; touch-action: manipulation; -webkit-overflow-scrolling: touch; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: var(--ring); }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; z-index: 9999; left: 16px; top: -60px; background: var(--text); color: white; padding: 10px 16px; border-radius: var(--r-sm); text-decoration: none; }
.skip-link:focus { top: 12px; }

.app-shell { width: 100%; min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar); display: flex; min-height: 0; flex-direction: column; padding: 24px 15px 15px; background: linear-gradient(165deg, #3d4957 0%, #34404e 56%, #2e3947 100%); color: #edf1f5; border-right: 1px solid rgba(228,235,244, .18); box-shadow: 14px 0 42px rgba(31,43,59, .13); }
.brand { display: flex; gap: 12px; align-items: center; padding: 4px 9px 22px; }
.brand-mark { width: 43px; height: 43px; display: grid; place-items: center; flex: 0 0 auto; border-radius: var(--r-md); background: linear-gradient(145deg, #627e9c, #3e6489); box-shadow: inset 0 0 0 1px rgba(245,249,253, .26), 0 12px 26px rgba(27,42,62, .20); color: var(--ink-on-strong); font-weight: 820; letter-spacing: -.055em; }
.brand-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.brand-copy strong { font-size: 16px; font-weight: 760; letter-spacing: -.018em; white-space: nowrap; }
.brand-copy span { margin-top: 3px; color: #c6d1dd; font-size: 10px; font-weight: 650; letter-spacing: .075em; text-transform: uppercase; }
.nav-list { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; padding: 0 3px 10px; scrollbar-color: rgba(208,222,238, .42) transparent; scrollbar-width: thin; }
.nav-list::-webkit-scrollbar { width: 5px; }
.nav-list::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(208,222,238, .34); }
.nav-section-label { display: block; margin: 20px 8px 7px; color: #bfcbd7; font-size: 10px; font-weight: 780; letter-spacing: .13em; line-height: 1.2; text-transform: uppercase; }
.nav-section-label:first-child { margin-top: 1px; }
.nav-item { width: 100%; min-height: 44px; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: var(--r-md); padding: 8px 10px; background: transparent; color: #e0e6ed; cursor: pointer; font-size: 14px; font-weight: 650; letter-spacing: .002em; text-align: start; transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease; }
.nav-item:hover { border-color: rgba(229,239,249, .14); background: rgba(229,239,249, .10); color: #f7f9fc; }
.nav-item:active { transform: translateY(1px); }
.nav-item.is-active { border-color: rgba(194,217,239, .28); background: rgba(167,196,226, .17); color: #f7f9fc; box-shadow: inset 3px 0 #9cb9d6, 0 6px 16px rgba(24,39,58, .13); }
.nav-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: var(--r-sm); font-size: 17px; line-height: 1; color: #b7cde3; }
.nav-item.is-active .nav-icon { background: rgba(204,225,246, .15); color: #dfebf5; }
.nav-badge { min-width: 25px; padding: 2px 7px; border-radius: var(--r-pill); background: rgba(229,239,249, .12); color: #d6e2ef; font-size: 11px; font-weight: 750; text-align: center; }
.nav-divider { height: 1px; margin: 9px 10px; background: rgba(229,239,249, .12); }
.private-dot { width: 7px; height: 7px; border-radius: 50%; background: #aec4d9; box-shadow: 0 0 0 4px rgba(174,196,217, .11); }
.sidebar-footer { margin-top: auto; display: grid; gap: 8px; }
.local-card { display: flex; gap: 10px; align-items: center; margin: 0 4px 5px; padding: 12px; border: 1px solid rgba(229,239,249, .12); border-radius: var(--r-md); background: rgba(229,239,249, .07); }
.status-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #a9c1ac; box-shadow: 0 0 0 4px rgba(169, 193, 172, .12); }
.local-card div { display: flex; min-width: 0; flex-direction: column; }
.local-card strong { font-size: 11px; font-weight: 720; color: #ebf1f7; }
.local-card small { color: #c6d1dd; font-size: 10px; }
.nav-item.compact { min-height: 38px; }
.nav-scrim { display: none; }
.mobile-tabbar { display: none; }

.workspace { grid-column: 2; min-width: 0; min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 20; width: 100%; min-height: var(--topbar); display: flex; gap: 14px; align-items: center; padding: 14px clamp(20px, 3.2vw, 44px); background: rgba(236,238,240, .90); border-bottom: 1px solid rgba(196,206,217, .80); box-shadow: 0 8px 25px rgba(40,52,68, .04); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.global-search { position: relative; flex: 1; min-width: 0; max-width: 760px; height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; background: rgba(247,248,250, .78); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: inset 0 1px 0 rgba(251,253,255,.60), 0 2px 5px rgba(40,52,68,.03); }
.global-search:focus-within { border-color: #708caa; box-shadow: var(--ring), inset 0 1px 0 rgba(251,253,255,.60); }
.global-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }
.global-search input::placeholder { color: #616d79; }
.interface-language { flex: 0 0 auto; display: inline-flex; align-items: center; }
.interface-language select { min-width: 62px; height: 40px; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 0 9px; background: rgba(247,248,250, .84); color: var(--text); font-size: 12px; font-weight: 780; letter-spacing: .05em; cursor: pointer; }
.search-icon { color: var(--accent); font-size: 22px; transform: rotate(-16deg); }
kbd { padding: 3px 7px; border: 1px solid var(--border); border-bottom-color: var(--border-strong); border-radius: 6px; background: var(--surface-2); color: var(--faint); font: 11px/1.2 -apple-system, BlinkMacSystemFont, sans-serif; box-shadow: 0 1px 0 var(--border); }
.primary-button, .secondary-button, .danger-button, .text-button, .icon-button, .link-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: var(--r-sm); padding: 8px 14px; cursor: pointer; font-weight: 720; letter-spacing: .003em; text-decoration: none; transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease; white-space: nowrap; }
.primary-button { border: 1px solid var(--accent); background: linear-gradient(145deg, #4c7297, var(--accent)); color: var(--ink-on-strong); box-shadow: 0 7px 17px rgba(62,100,137, .20); }
.primary-button:hover { border-color: var(--accent-hover); background: linear-gradient(145deg, #3f658a, var(--accent-hover)); box-shadow: 0 9px 20px rgba(46,80,111, .23); transform: translateY(-1px); }
.primary-button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.secondary-button { border: 1px solid var(--border-strong); background: rgba(247,248,250, .70); color: var(--text); box-shadow: 0 2px 5px rgba(40,52,68, .03); }
.secondary-button:hover { border-color: var(--border-hover); background: #e5ebf1; }
.danger-button { border: 1px solid #efc0bc; background: var(--danger-soft); color: var(--danger); }
.danger-button:hover { background: #ffe5e2; }
.text-button { min-height: 34px; border: 0; background: transparent; color: var(--accent); padding-inline: 5px; }
.text-button:hover { color: var(--accent-hover); }
.icon-button { width: 40px; padding: 0; border: 1px solid var(--border); background: rgba(247,248,250, .78); font-size: 21px; }
.icon-button:hover { background: #e5ebf1; }
.mobile-menu { display: none; }
.full-width { width: 100%; }

.main-content { width: 100%; min-width: 0; max-width: 1680px; margin-inline: auto; overflow: visible; padding: 32px clamp(20px, 3.2vw, 48px) 64px; }
.view { display: none; animation: enter .28s var(--ease) both; }
.view.is-active { display: block; }
/* A view is a separate screen, never a section appended below another screen. */
.view:not(.is-active), .view[hidden] { display: none !important; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.eyebrow { display: block; margin-bottom: 5px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .105em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: "Inter", "Noto Sans Hebrew", "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", sans-serif; font-feature-settings: "cv11", "ss03"; }
h1 { margin-bottom: 8px; font-size: clamp(29px, 3vw, 40px); font-weight: 720; line-height: 1.12; letter-spacing: -.028em; }
h2 { margin-bottom: 7px; font-size: 21px; font-weight: 700; line-height: 1.25; letter-spacing: -.018em; }
h3 { font-size: 16px; font-weight: 720; letter-spacing: -.012em; }
p { color: var(--muted); line-height: 1.6; }
.page-header { min-height: 82px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-header p { margin-bottom: 0; }
.page-actions { display: flex; gap: 9px; align-items: center; }

.hero-panel { position: relative; min-width: 0; overflow: hidden; overflow: clip; min-height: 288px; display: grid; grid-template-columns: minmax(0, 1fr) 180px; align-items: center; gap: 35px; padding: clamp(28px, 3.1vw, 42px); border-radius: var(--r-xl); color: var(--ink-on-strong); background: radial-gradient(circle at 88% 20%, rgba(153,183,215, .17), transparent 28%), radial-gradient(circle at 12% 94%, rgba(135,166,201, .14), transparent 32%), linear-gradient(135deg, #3b4d62 0%, #49637f 62%, #526d86 140%); box-shadow: 0 26px 58px rgba(35,52,73, .20); }
.hero-panel::after { content: ""; position: absolute; inset: auto -70px -125px auto; width: 290px; height: 290px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 42px rgba(255,255,255,.018), 0 0 0 85px rgba(255,255,255,.012); }
.hero-copy { position: relative; z-index: 1; min-width: 0; max-width: 760px; }
.hero-copy .eyebrow { color: #d2e2f2; }
.hero-copy h1 { max-width: 640px; margin-bottom: 13px; overflow-wrap: anywhere; font-size: clamp(32px, 3.3vw, 46px); font-weight: 760; color: var(--ink-on-strong); }
.hero-copy > p { max-width: 680px; color: #e1e9f2; font-size: 16px; }
.hero-search { min-width: 0; height: 56px; display: flex; align-items: center; gap: 10px; margin-top: 24px; padding: 5px 5px 5px 17px; background: #f7f8fa; border: 1px solid rgba(232,241,250, .60); border-radius: var(--r-lg); box-shadow: 0 13px 34px rgba(30,48,71, .23); color: var(--text); }
.hero-search > span { color: var(--accent); font-size: 24px; }
.hero-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; }
.hero-search button { align-self: stretch; min-width: 90px; border: 0; border-radius: var(--r-sm); background: var(--accent); color: var(--ink-on-strong); cursor: pointer; font-weight: 750; }
.hero-search button:hover { background: var(--accent-hover); }
.example-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; color: #cbd9e7; font-size: 12px; }
.example-links button { border: 0; border-bottom: 1px dotted #b4c7da; padding: 0; background: transparent; color: #e5edf6; cursor: pointer; }
.hero-emblem { position: relative; z-index: 1; display: grid; place-items: center; align-self: center; }
.emblem-ring { width: 170px; height: 170px; display: grid; place-items: center; border: 1px solid rgba(233,243,253, .30); border-radius: 50%; box-shadow: inset 0 0 0 12px rgba(233,243,253, .03), 0 0 0 18px rgba(233,243,253, .03); }
.emblem-ring span { display: grid; place-items: center; width: 108px; height: 108px; border-radius: 50%; background: linear-gradient(145deg, rgba(168,197,228, .30), rgba(255,255,255,.04)); font-family: Georgia, serif; font-size: 58px; }
.hero-emblem small { margin-top: 23px; color: #ccdceb; font-size: 10px; letter-spacing: .1em; }

.section-block { margin-top: 33px; }
.public-read-only-banner { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 11px; align-items: start; margin-top: 20px; padding: 15px 17px; border: 1px solid #c4d0dc; border-radius: var(--r-lg); background: linear-gradient(135deg, #e6edf4, #f0f3f6); color: #36526e; box-shadow: var(--shadow-sm); }
.public-read-only-banner > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--accent); color: var(--ink-on-strong); font-size: 18px; }
.public-read-only-banner strong { display: block; font-size: 13px; font-weight: 760; }
.public-read-only-banner p { margin: 2px 0 0; color: #50657a; font-size: 12px; }
.section-heading { min-height: 50px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.section-heading h2 { margin-bottom: 0; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.quick-card { min-height: 100px; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; padding: 17px; border: 1px solid var(--border); border-radius: var(--r-lg); background: linear-gradient(145deg, rgba(247,248,250, .88), rgba(238,241,245, .90)); box-shadow: var(--shadow-sm); cursor: pointer; text-align: start; }
.quick-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: 0 14px 28px rgba(40,52,68, .11); }
.quick-card.accent { border-color: #b9cadd; background: linear-gradient(145deg, #eaf0f6, #dfe9f3); }
.quick-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent); font-size: 21px; }
.quick-card span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.quick-card strong { font-size: 15px; line-height: 1.35; }
.quick-card small { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.quick-card b { color: var(--accent); font-weight: 500; }
.language-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.language-card { position: relative; overflow: hidden; min-height: 134px; padding: 20px; border: 1px solid var(--border); border-radius: var(--r-lg); background: linear-gradient(145deg, #f7f8f9, #eef1f4); box-shadow: var(--shadow-sm); cursor: pointer; text-align: start; }
.language-card::after { content: attr(data-code); position: absolute; right: 10px; bottom: -18px; color: #e0e5eb; font-size: 66px; font-weight: 850; letter-spacing: -.08em; }
.language-card:hover { border-color: var(--border-hover); }
.language-card > * { position: relative; z-index: 1; }
.language-card strong { display: block; margin-top: 13px; font-size: 18px; }
.language-card p { margin: 3px 0 0; font-size: 12px; }
.language-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .05em; }
.dashboard-split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .6fr); gap: 18px; }
.compact-list { overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-lg); background: rgba(247,248,250, .84); box-shadow: var(--shadow-sm); }
.compact-row { min-height: 70px; display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; padding: 10px 15px; border-bottom: 1px solid #dce2e8; cursor: pointer; }
.compact-row:last-child { border-bottom: 0; }
.compact-row:hover { background: var(--surface-2); }
.file-icon { width: 39px; height: 45px; display: grid; place-items: center; border-radius: 8px; background: #e8eef5; color: var(--accent); font-size: 11px; font-weight: 800; border: 1px solid #c6d3e1; }
.file-icon.pdf { background: #fff0ef; border-color: #f1cfcc; color: #b4382f; }
.file-icon.video { background: #f1effb; border-color: #ddd7f4; color: #6854a5; }
.compact-row-copy { min-width: 0; }
.compact-row-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.compact-row-copy small { color: var(--muted); font-size: 11px; }
.compact-row time { color: var(--faint); font-size: 11px; }
.attention-panel { padding: 21px; border: 1px solid #ddcda9; border-radius: var(--r-lg); background: linear-gradient(155deg, #f5efe4, #eee5d6); }
.attention-panel.section-block { align-self: start; }
.check-list { display: grid; gap: 13px; margin: 2px 0 17px; padding: 0; list-style: none; }
.check-list li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; }
.check-list li > span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--gold-soft); color: #8d682d; font-size: 11px; font-weight: 800; }
.check-list li div { display: flex; flex-direction: column; }
.check-list strong { font-size: 12px; }
.check-list small { color: var(--muted); font-size: 11px; }

.knowledge-view.is-active { height: calc(100vh - var(--topbar) - 56px); display: flex; flex-direction: column; }
.compact-page-header { min-height: auto; align-items: center; margin-bottom: 14px; }
.compact-page-header h1 { font-size: 27px; }
.compact-page-header p { font-size: 12px; }
.knowledge-frame-wrap { min-height: 0; flex: 1; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-xl); background: #eef1f4; box-shadow: var(--shadow-sm); }
.knowledge-frame-wrap iframe { width: 100%; height: 100%; border: 0; background: #eef1f4; }

/* Atlas is a full-height workspace within the app, not a small document card.
   No Fullscreen API and no effects on Home, documents or their page scrolling. */
body:has(.atlas3d-view.is-active) .workspace { height: 100dvh; min-height: 360px; display: flex; flex-direction: column; }
body:has(.atlas3d-view.is-active) .topbar { flex: 0 0 auto; }
.main-content:has(> .atlas3d-view.is-active) { flex: 1 1 0; display: flex; flex-direction: column; min-height: 0; max-width: none; padding: 12px 16px 16px; scrollbar-gutter: auto; }
.atlas3d-view.is-active { flex: 1 1 0; display: flex; flex-direction: column; min-height: 0; animation: none; }
/* Keep the translated page title for landmarks; the scene already has a visible title. */
.atlas3d-view > .compact-page-header { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; min-height: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.atlas3d-view .knowledge-frame-wrap { flex: 1 1 0; min-height: 0; border-radius: var(--r-lg); }
.atlas3d-view .knowledge-frame-wrap iframe { display: block; width: 100%; height: 100%; min-height: 0; }
@media (max-width: 900px) {
  .main-content:has(> .atlas3d-view.is-active) { padding: 8px 8px 10px; }
  .atlas3d-view .knowledge-frame-wrap { min-height: 0; border-radius: var(--r-md); }
}
@media (max-width: 760px) {
  .main-content:has(> .atlas3d-view.is-active) { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}

.atlas-module-shell { position: relative; isolation: isolate; background: radial-gradient(circle at 72% 28%, rgba(154,178,206, .17), transparent 27rem), linear-gradient(145deg, #e9edf2, #dfe5ed); }
.atlas-module-loading { position: absolute; z-index: 2; inset: 0; display: grid; place-content: center; grid-template-columns: 42px minmax(0, 300px); gap: 14px; padding: 28px; background: linear-gradient(145deg, rgba(239,243,248, .96), rgba(223,232,241, .94)); color: #395773; transition: opacity .22s ease, visibility .22s ease; }
.atlas-module-loading strong { display: block; font-size: 14px; font-weight: 760; letter-spacing: -.01em; }
.atlas-module-loading p { margin: 3px 0 0; color: #546a7e; font-size: 12px; }
.atlas-loading-orb { width: 38px; height: 38px; display: block; border: 3px solid rgba(62,100,137, .18); border-top-color: var(--accent); border-radius: 50%; animation: atlas-spin .85s linear infinite; }
.atlas-module-shell iframe { position: relative; z-index: 1; opacity: 0; transition: opacity .2s ease; }
.atlas-module-shell.is-ready .atlas-module-loading { visibility: hidden; opacity: 0; pointer-events: none; }
.atlas-module-shell.is-ready iframe { opacity: 1; }
@keyframes atlas-spin { to { transform: rotate(360deg); } }

.library-toolbar { display: grid; grid-template-columns: auto minmax(220px, 1fr) auto; gap: 12px; align-items: center; margin-bottom: 14px; }
.scope-switch, .view-switch { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); }
.scope-switch button, .view-switch button { min-height: 44px; border: 1px solid transparent; border-radius: 8px; padding: 7px 11px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 650; line-height: 1.3; }
.scope-switch button.is-active, .view-switch button.is-active { background: var(--accent-soft); border-color: #bbcbdc; color: var(--accent-hover); box-shadow: 0 1px 3px #28333f12; }
.scope-switch button:hover, .view-switch button:hover { background: var(--surface-3); }
.inline-search { min-height: 42px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); }
.inline-search span { color: var(--accent); }
.inline-search input { width: 100%; height: 40px; border: 0; outline: 0; background: transparent; }
.inline-search { min-width: 0; min-height: 48px; padding-inline-end: 3px; }
.inline-search input { min-width: 0; height: 46px; }
.inline-search input::-webkit-search-cancel-button { display: none; }
.inline-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.clear-search { flex: 0 0 44px; width: 44px; min-height: 44px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font-size: 24px; cursor: pointer; }
.clear-search:hover { background: var(--surface-2); color: var(--text); }
.search-feedback { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 14px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); color: var(--muted); }
.search-feedback p { flex: 1 1 220px; margin: 0; font-size: 13px; line-height: 1.6; }
.search-feedback button { min-height: 44px; }
button.compact-row { width: 100%; border: 0; background: transparent; text-align: start; color: inherit; font: inherit; }
.view-switch button { width: 44px; padding: 0; font-size: 18px; }
.filters { display: grid; grid-template-columns: repeat(4, minmax(135px, 1fr)) auto; gap: 10px; align-items: end; margin-bottom: 16px; padding: 13px; border: 1px solid var(--border); border-radius: var(--r-md); background: rgba(245,247,250, .72); box-shadow: inset 0 1px 0 rgba(251,253,255,.45); }
.filters label, .upload-metadata label, .editor-sidebar label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: .01em; text-transform: none; }
.filters select, .upload-metadata select, .upload-metadata input, .editor-sidebar input, .editor-sidebar select { width: 100%; min-height: 38px; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 7px 9px; background: var(--surface); color: var(--text); font-size: 12px; text-transform: none; letter-spacing: 0; }
.filter-reset { min-height: 38px; border: 0; background: transparent; color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 650; }
.results-bar { min-height: 34px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
#activeFilterText { min-width: 0; overflow-wrap: anywhere; }
.results-bar strong { color: var(--text); }
.results-bar select { margin-left: auto; border: 0; background: transparent; color: var(--muted); }
.document-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; }
.document-grid.is-list { display: flex; flex-direction: column; gap: 7px; }
.document-card { position: relative; min-width: 0; min-height: 228px; display: flex; flex-direction: column; padding: 18px; border: 1px solid var(--border); border-radius: var(--r-lg); background: linear-gradient(145deg, rgba(247,248,250, .90), rgba(238,242,247, .92)); box-shadow: var(--shadow-sm); transition: border .16s ease, box-shadow .16s ease, transform .16s ease; }
.document-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: 0 15px 30px rgba(40,52,68, .12); }
.document-card.is-list { min-height: 100px; display: grid; grid-template-columns: 48px minmax(150px, 1fr) minmax(120px, .6fr) auto; align-items: center; gap: 14px; padding: 14px; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.document-card.is-list .card-top { position: relative; flex-direction: column; align-items: center; gap: 6px; }
.document-card.is-list .favorite-button { background: var(--surface); }
.doc-icon { position: relative; width: 43px; height: 50px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #edc9c6; border-radius: var(--r-sm); background: linear-gradient(145deg, #fff6f5, #fde9e7); color: #aa2e27; font-size: 10px; font-weight: 850; }
.doc-icon::after { content: ""; position: absolute; right: -1px; top: -1px; border-style: solid; border-width: 0 10px 10px 0; border-color: transparent var(--surface) #e8c4c0 transparent; }
.doc-icon.text { border-color: #c6d3e1; background: #edf2f7; color: var(--accent); }
.doc-icon.video { border-color: #dad3ef; background: #f2effa; color: #67509c; }
.favorite-button { width: 44px; height: 44px; flex-shrink: 0; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: #687b8e; cursor: pointer; font-size: 20px; }
.favorite-button.is-active { border-color: #dfc48e; background: #fff8e9; color: #9d6d11; }
.card-copy { min-width: 0; margin-top: 13px; }
.document-card.is-list .card-copy { margin: 0; }
.card-copy h3 { display: -webkit-box; overflow: hidden; margin: 0 0 6px; font-size: 14px; line-height: 1.37; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.document-card.is-list .card-copy h3 { display: block; overflow: hidden; margin-bottom: 3px; text-overflow: ellipsis; white-space: nowrap; }
.source-name { display: block; overflow: hidden; color: var(--faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.source-name.search-snippet { display: -webkit-box; overflow: hidden; white-space: normal; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
mark { border-radius: 3px; padding: 0 2px; background: #ffe59a; color: #3b2b09; }
.chip-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.meta-chip, .status-pill { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 7px; border-radius: var(--r-pill); background: #e7ecf1; color: #536679; font-size: 11px; font-weight: 650; letter-spacing: .015em; text-transform: none; }
.meta-chip.lang { background: var(--accent-soft); color: var(--accent); }
.meta-chip.personal { background: #f1effb; color: #68559a; }
.status-pill.gold { background: var(--gold-soft); color: #8b6527; }
.document-card.is-list .chip-row { margin: 0; }
.document-card.is-list .source-name { display: none; }
.card-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 16px; }
.card-footer small { color: var(--faint); font-size: 12px; }
.card-actions { display: flex; gap: 5px; }
.card-actions button, .card-actions a { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 9px 12px; background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; font-size: 13px; font-weight: 650; }
.card-actions button:hover, .card-actions a:hover { border-color: var(--accent); background: var(--accent-soft); }
.card-actions .open-card { border-color: var(--accent); background: linear-gradient(145deg, #4c7297, var(--accent)); color: var(--ink-on-strong); box-shadow: 0 4px 12px rgba(62,100,137, .18); }
.card-actions .open-card:hover { border-color: var(--accent-hover); background: linear-gradient(145deg, #3f658a, var(--accent-hover)); }
.document-card.is-list .card-footer { max-width: 220px; margin: 0; padding: 0; flex-direction: column; align-items: flex-start; gap: 8px; }
.empty-state { min-height: 310px; display: grid; place-items: center; align-content: center; padding: 45px; border: 1px dashed var(--border-strong); border-radius: var(--r-lg); background: rgba(241,246,251, .46); text-align: center; }
.empty-state h2 { margin: 12px 0 4px; }
.empty-state p { margin-bottom: 18px; }
.empty-state.is-search-empty { min-height: 0; padding: 22px 18px; margin-bottom: 14px; }
.empty-state.is-search-empty .empty-icon { display: none; }
.empty-state.is-search-empty h2 { margin-top: 0; font-size: 20px; }
.empty-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: var(--r-lg); background: var(--accent-soft); color: var(--accent); font-size: 27px; }

.training-hero { position: relative; overflow: hidden; min-height: 286px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: center; gap: 30px; padding: 38px 44px; border-radius: var(--r-xl); background: radial-gradient(circle at 87% 16%, rgba(163,186,213, .18), transparent 25%), linear-gradient(135deg, #3b4d62, #4a6380); color: var(--ink-on-strong); box-shadow: var(--shadow-md); }
.training-hero h2 { margin: 14px 0 9px; color: var(--ink-on-strong); font-size: 32px; }
.training-hero p { max-width: 680px; color: #dce6f2; }
.training-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.training-meta span { padding: 5px 9px; border: 1px solid rgba(255,255,255,.14); border-radius: var(--r-pill); color: #e1eaf4; font-size: 10px; }
.atlas-art { position: relative; width: 230px; height: 230px; display: grid; place-items: center; justify-self: center; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; }
.atlas-art span { font-family: Georgia, serif; font-size: 68px; color: #d9b879; }
.atlas-art i { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #afc6df; box-shadow: 0 0 0 6px rgba(175,198,223,.10); }
.atlas-art i:nth-of-type(1) { left: 27px; top: 76px; }.atlas-art i:nth-of-type(2) { right: 34px; top: 53px; }.atlas-art i:nth-of-type(3) { left: 53px; bottom: 39px; }.atlas-art i:nth-of-type(4) { right: 39px; bottom: 61px; }.atlas-art i:nth-of-type(5) { left: 50%; top: 14px; }
.future-card { display: grid; grid-template-columns: 50px 1fr auto; align-items: center; gap: 16px; margin-top: 18px; padding: 20px; border: 1px dashed #becad6; border-radius: var(--r-lg); background: rgba(245,247,250, .74); }
.future-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: var(--r-md); background: #f1effb; color: #67509c; }
.future-card p { margin-bottom: 0; }
.privacy-banner { display: grid; grid-template-columns: 38px 1fr; gap: 12px; margin-bottom: 19px; padding: 17px; border: 1px solid #e0cca2; border-radius: var(--r-md); background: #f6f0e2; }
.privacy-banner > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r-sm); background: #f7ead0; color: #8d641f; font-size: 19px; }
.privacy-banner p { margin: 2px 0 0; font-size: 12px; }

.editor-layout { min-height: 620px; display: grid; grid-template-columns: 220px minmax(340px, 1fr) minmax(300px, .8fr); overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.editor-sidebar { display: flex; flex-direction: column; gap: 13px; padding: 18px; border-right: 1px solid var(--border); background: var(--surface-2); }
.editor-rule { margin-top: 8px; padding: 12px; border-radius: var(--r-sm); background: var(--gold-soft); }
.editor-rule strong { color: #725421; font-size: 11px; }
.editor-rule p { margin: 4px 0 0; font-size: 10px; }
.editor-sidebar .full-width { margin-top: auto; }
.editor-main { min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.editor-toolbar { min-height: 47px; display: flex; align-items: center; gap: 5px; padding: 7px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.editor-toolbar button { min-height: 30px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; font-size: 10px; }
.editor-toolbar span { margin-left: auto; color: var(--faint); font-size: 9px; }
#editorBody { flex: 1; width: 100%; min-height: 560px; resize: none; border: 0; outline: 0; padding: 27px; color: var(--text); background: var(--surface); font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; }
.editor-preview { min-width: 0; overflow: auto; padding: 28px; background: #e0e5eb; }
.editor-preview > div { min-height: 500px; padding: 42px 38px; background: #f7f8fa; box-shadow: 0 4px 20px rgba(26,43,66,.12); font-size: 13px; }
.preview-label { display: block; margin-bottom: 10px; color: var(--faint); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.editor-preview h2 { border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.editor-preview ul { padding-left: 20px; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.settings-card { min-height: 210px; padding: 22px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.settings-card.danger-soft { border-color: #efc3be; background: var(--danger-soft); }
.settings-card dl { margin: 15px 0 0; }
.settings-card dl div { display: flex; justify-content: space-between; gap: 20px; padding: 9px 0; border-bottom: 1px solid #dde3e9; }
.settings-card dt { color: var(--muted); }
.settings-card dd { margin: 0; font-weight: 700; text-align: right; }

.modal { max-width: none; max-height: none; border: 0; padding: 0; background: transparent; color: var(--text); }
.modal::backdrop, .confirm-dialog::backdrop { background: rgba(21,31,45,.62); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.modal-shell { width: min(720px, calc(100vw - 28px)); max-height: calc(100dvh - 35px); overflow: auto; border-radius: var(--r-xl); background: #f2f4f7; box-shadow: 0 30px 90px rgba(29,42,60,.28); }
.modal-header, .modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 19px 22px; }
.modal-header { border-bottom: 1px solid var(--border); }
.modal-header h2 { margin: 0; }
.modal-footer { justify-content: flex-end; border-top: 1px solid var(--border); }
.upload-steps { display: flex; gap: 6px; padding: 15px 22px 0; }
.upload-steps span { flex: 1; padding: 7px; border-radius: 7px; background: #e7edf3; color: var(--faint); font-size: 9px; font-weight: 800; text-align: center; text-transform: uppercase; }
.upload-steps span.is-active { background: var(--accent-soft); color: var(--accent); }
.dropzone { margin: 15px 22px; padding: 30px; border: 2px dashed #b7c6d5; border-radius: var(--r-md); background: var(--surface-2); cursor: pointer; text-align: center; }
.dropzone.is-dragging { border-color: var(--accent); background: var(--accent-soft); }
.dropzone h3 { margin: 10px 0 3px; }
.dropzone p { margin-bottom: 5px; }
.dropzone small { color: var(--faint); }
.drop-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent); font-size: 24px; }
.selected-files { display: grid; gap: 6px; max-height: 150px; overflow: auto; margin: 0 22px; }
.selected-file { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); }
.selected-file strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.selected-file small { color: var(--faint); font-size: 9px; }
.upload-metadata { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; padding: 16px 22px; }
.upload-metadata .span-two { grid-column: 1 / -1; }
.upload-warning { margin: 0 22px 18px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--gold-soft); color: #6f5425; font-size: 11px; }

.document-modal { width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; overflow: hidden; }
.document-modal-shell { width: 100%; height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.document-modal-header { flex: 0 0 auto; min-height: 80px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 20px; align-items: center; padding: max(12px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 12px max(20px, env(safe-area-inset-left)); border-bottom: 1px solid var(--border); background: var(--surface); }
.document-modal-header > div:first-child { min-width: 0; display: flex; align-items: center; gap: 12px; }
.document-heading { flex: 1 1 370px; }
.document-heading > div { min-width: 0; }
.document-modal-header h2 { max-width: 780px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 2px 0 0; font-size: 17px; line-height: 1.4; letter-spacing: -.015em; overflow-wrap: anywhere; }
.document-modal-header span { color: var(--muted); font-size: 12px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.modal-actions > *, #closeDocument { min-height: 44px; min-width: 44px; font-size: 13px; }
#closeDocument { flex: 0 0 44px; font-size: 26px; }
#toggleDocumentDetails { display: none; }
.document-viewer-layout { min-height: 0; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 310px; }
.pdf-stage { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: #dde2e8; }
.reader-toolbar { flex: 0 0 auto; min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.reader-pagination { display: flex; align-items: center; gap: 8px; color: var(--muted); font-variant-numeric: tabular-nums; }
.reader-toolbar .icon-button { width: 44px; height: 44px; flex-shrink: 0; }
.reader-page-number { width: 56px; height: 42px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font-size: 16px; text-align: center; appearance: textfield; -moz-appearance: textfield; }
.reader-page-number::-webkit-inner-spin-button { appearance: none; }
.reader-scale { min-width: 0; }
.reader-scale select { max-width: 100%; height: 44px; padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font-size: 14px; }
.reader-scroll { min-width: 0; min-height: 0; flex: 1 1 0; overflow: auto; padding: 16px 16px max(20px, env(safe-area-inset-bottom)); overscroll-behavior: contain; direction: ltr; scrollbar-gutter: stable; }
.reader-paper { margin: 0 auto; background: white; box-shadow: 0 8px 30px #28333f25; }
.reader-paper canvas { display: block; }
.reader-text { max-width: 900px; margin: 18px auto 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); direction: ltr; }
html[dir="rtl"] .reader-text { direction: rtl; }
.reader-text summary { min-height: 30px; cursor: pointer; color: var(--accent); font-weight: 650; }
.reader-text p { margin-top: 12px; font-size: 13px; }
.reader-text-content { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.7; }
.reader-media { flex: 1 1 0; min-height: 0; overflow: auto; display: grid; place-items: center; }
.reader-media iframe { width: 100%; height: 100%; border: 0; background: var(--surface); }
.reader-media img, .reader-media video { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.preview-state { position: absolute; z-index: 2; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; background: #e7ebf0f5; text-align: center; overflow: auto; }
.reader-toolbar:not([hidden]) ~ .preview-state { top: 61px; }
.preview-state h3 { max-width: 540px; margin: 16px 0 6px; font-size: 20px; }
.preview-state p { max-width: 460px; margin-bottom: 16px; }
.reader-spinner { width: 32px; height: 32px; border: 3px solid #b8c7d7; border-top-color: var(--accent); border-radius: 50%; animation: atlas-spin 1s linear infinite; }
.reader-toolbar button:disabled { opacity: .38; cursor: default; }
.filter-disclosure { margin-bottom: 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.filter-disclosure > summary { min-height: 48px; padding: 12px 14px; cursor: pointer; color: var(--text); font-size: 14px; font-weight: 650; }
.filter-disclosure > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r-md); }
.filter-selection-count { margin-inline-start: 12px; font-size: 12px; font-weight: 600; color: var(--accent); }
.filter-disclosure .filters { margin-bottom: 0; border: 0; border-top: 1px solid var(--border); border-radius: 0 0 var(--r-md) var(--r-md); box-shadow: none; }
.module-language-note { flex: 0 0 auto; margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.document-open { overflow: hidden; }
.metadata-panel { overflow: auto; padding: 18px; border-left: 1px solid var(--border); background: var(--surface); }
.metadata-section { margin-bottom: 22px; }
.metadata-section dl { margin: 7px 0 0; }
.metadata-section dl div { display: grid; grid-template-columns: 82px 1fr; gap: 8px; padding: 9px 0; border-bottom: 1px solid #dce3eb; font-size: 13px; }
.metadata-section dt { color: var(--muted); }
.metadata-section dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-weight: 650; }
#documentNote { width: 100%; min-height: 115px; resize: vertical; margin: 7px 0 7px; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 9px; }
.safe-note { padding: 12px; border: 1px solid #b9cbdd; border-radius: var(--r-sm); background: var(--accent-soft); }
.safe-note p { margin: 6px 0 0; font-size: 13px; }
.preview-fallback { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; text-align: center; }
.preview-fallback > div { font-size: 48px; color: var(--accent); }
.confirm-dialog { width: min(430px, calc(100vw - 30px)); border: 0; border-radius: var(--r-lg); padding: 0; background: var(--surface); box-shadow: var(--shadow-md); }
.confirm-dialog form { padding: 28px; text-align: center; }
.confirm-dialog form > div:last-child { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }
.confirm-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 13px; border-radius: 50%; background: var(--gold-soft); color: var(--warning); font-size: 22px; font-weight: 900; }
.toast-region { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; gap: 9px; }
.toast { min-width: 280px; max-width: 420px; display: grid; grid-template-columns: 25px 1fr; gap: 9px; padding: 13px 15px; border: 1px solid #bfd0e1; border-radius: var(--r-md); background: #e9f1f8; box-shadow: var(--shadow-md); color: #355675; animation: toast-in .2s ease; }
.toast.is-error { border-color: #efb8b2; background: var(--danger-soft); color: var(--danger); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.offline-error { position: fixed; z-index: 110; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: var(--r-sm); background: #2c1715; color: white; box-shadow: var(--shadow-md); }
.offline-error span { color: #e8c6c2; font-size: 11px; }

/* ---------- 1.10.0: публичный вид без мелькания ---------- */
html.is-public-readonly [data-public-restricted] { display: none !important; }

/* ---------- 1.10.0: движение ---------- */
.nav-item, .mobile-tab, .quick-card, .language-card, .document-card, .compact-row, .card-actions button, .card-actions a, .favorite-button, .scope-switch button, .view-switch button, .hero-search button, .language-chip, .interface-language select { transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), box-shadow .24s var(--ease), transform .24s var(--ease); }
.quick-card, .language-card, .document-card, .compact-list, .settings-card, .attention-panel, .filters, .filter-disclosure { box-shadow: inset 0 1px 0 rgba(255,255,255, .62), var(--shadow-sm); }
.quick-card:hover, .language-card:hover, .document-card:hover { transform: translateY(-3px); box-shadow: inset 0 1px 0 rgba(255,255,255, .7), 0 16px 34px rgba(40,52,68, .13); }
.quick-card:active, .language-card:active, .document-card:active, .compact-row:active { transform: translateY(0) scale(.988); transition-duration: .08s; }
.primary-button:active, .secondary-button:active, .icon-button:active, .card-actions button:active, .hero-search button:active { transform: translateY(0) scale(.975); transition-duration: .08s; }
.nav-item:hover .nav-icon { transform: translateX(1px); }
.nav-icon { transition: transform .24s var(--ease), background .18s var(--ease), color .18s var(--ease); }
.quick-card b { transition: transform .24s var(--ease); }
.quick-card:hover b { transform: translateX(4px); }
.language-card::after { transition: color .3s var(--ease), transform .4s var(--ease); }
.language-card:hover::after { color: #d5dce4; transform: translateY(-3px); }
.hero-panel { animation: hero-in .5s var(--ease) both; }
@keyframes hero-in { from { opacity: 0; transform: translateY(8px) scale(.995); } }
.quick-grid > *, .language-grid > *, #homeRecent .compact-row, .public-read-only-banner { animation: rise .46s var(--ease) both; }
.quick-grid > :nth-child(2), .language-grid > :nth-child(2), #homeRecent .compact-row:nth-child(2) { animation-delay: .06s; }
.quick-grid > :nth-child(3), .language-grid > :nth-child(3), #homeRecent .compact-row:nth-child(3) { animation-delay: .12s; }
.language-grid > :nth-child(4), #homeRecent .compact-row:nth-child(4) { animation-delay: .18s; }
#homeRecent .compact-row:nth-child(5) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(9px); } }
.toast { animation: toast-in .28s var(--ease) both; }
@keyframes toast-in { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal-shell, .confirm-dialog { animation: modal-in .26s var(--ease) both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.modal::backdrop, .confirm-dialog::backdrop { animation: backdrop-in .3s ease both; }
@keyframes backdrop-in { from { opacity: 0; } }

/* ---------- 1.10.0: скелет, пока библиотека грузится ---------- */
body.is-loading #languageGrid:empty { display: grid; }
body.is-loading #languageGrid:empty::before, body.is-loading #languageGrid:empty::after, body.is-loading #homeRecent:empty::before { content: ""; display: block; min-height: 134px; border-radius: var(--r-lg); background: linear-gradient(100deg, #e4e9ee 30%, #eff2f5 45%, #e4e9ee 60%); background-size: 240% 100%; animation: shimmer 1.3s ease infinite; }
body.is-loading #homeRecent:empty::before { min-height: 210px; border-radius: 0; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.results-bar strong:empty::before { content: "…"; }

/* ---------- 1.10.0: типографика ---------- */
.nav-badge, time, .reader-pagination, dd, .results-bar strong, .compact-row time, .card-footer small, .training-meta span, .language-card p { font-variant-numeric: tabular-nums; }
.eyebrow { letter-spacing: .12em; font-weight: 740; }
kbd { font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif; }
::selection { background: rgba(62,100,137, .22); }
.main-content { scrollbar-gutter: stable; }
html { scroll-behavior: smooth; }

/* ---------- 1.10.0: рамки и кромки ---------- */
.sidebar { border-right-color: rgba(228,235,244, .14); }
.topbar { border-bottom-color: rgba(196,206,217, .70); }
.compact-row { border-bottom-color: #e2e7ec; }
.file-icon, .doc-icon, .quick-icon, .empty-icon, .drop-icon, .future-icon { box-shadow: inset 0 1px 0 rgba(255,255,255, .55); }
.hero-search { border-color: rgba(232,241,250, .72); }
.knowledge-frame-wrap { box-shadow: inset 0 0 0 1px rgba(255,255,255, .5), var(--shadow-sm); }

html[dir="rtl"] .sidebar { inset: 0 0 0 auto; border-right: 0; border-left: 1px solid rgba(255,255,255,.05); }
html[dir="rtl"] .nav-item.is-active { box-shadow: inset -3px 0 #9cb9d6; }
html[dir="rtl"] .language-card::after { right: auto; left: 10px; }
html[dir="rtl"] .results-bar select { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .metadata-panel { border-left: 0; border-right: 1px solid var(--border); }
html[dir="rtl"] .toast-region { right: auto; left: 20px; }

@media (max-width: 1180px) {
  :root { --sidebar: 78px; }
  .sidebar { padding-inline: 9px; }
  .brand { justify-content: center; padding-inline: 0; }
  .brand-copy, .nav-item > span:nth-child(2), .nav-badge, .local-card div, .private-dot { display: none; }
  .nav-item { grid-template-columns: 1fr; padding: 7px; text-align: center; }
  .nav-icon { margin: 0 auto; }
  .local-card { justify-content: center; padding: 12px; }
  .nav-section-label { display: none; }
  .editor-layout { grid-template-columns: 205px minmax(350px, 1fr); }
  .editor-preview { display: none; }
}

@media (max-width: 900px) {
  :root { --sidebar: 0px; }
  .app-shell { display: block; }
  .sidebar { width: min(84vw, 312px); padding-top: max(18px, env(safe-area-inset-top)); padding-bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow-md); }
  .sidebar.is-open { transform: translateX(0); }
  .nav-scrim:not([hidden]) { position: fixed; z-index: 25; inset: 0; display: block; width: 100%; height: 100%; border: 0; background: rgba(29,41,58, .44); cursor: pointer; }
  body.nav-open { overflow: hidden; }
  html[dir="rtl"] .sidebar { transform: translateX(105%); }
  html[dir="rtl"] .sidebar.is-open { transform: translateX(0); }
  .brand-copy, .nav-item > span:nth-child(2), .nav-badge, .local-card div, .private-dot { display: initial; }
  .nav-section-label { display: block; }
  .nav-item { grid-template-columns: 30px 1fr auto; text-align: start; }
  .nav-icon { margin: 0; }
  .local-card { justify-content: flex-start; }
  .workspace { width: 100%; }
  .mobile-menu { display: inline-flex; }
  .topbar { min-width: 0; padding-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right)); }
  .topbar .global-search { flex: 1 1 0; width: 0; }
  .topbar .primary-button { font-size: 0; width: 44px; padding: 0; }
  .topbar .primary-button span { font-size: 21px; }
  .hero-panel { grid-template-columns: 1fr; min-height: 0; }
  .hero-emblem { display: none; }
  .language-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-split { grid-template-columns: 1fr; }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .training-hero { grid-template-columns: 1fr; }
  .atlas-art { display: none; }
  .document-viewer-layout { grid-template-columns: 1fr; }
  .metadata-panel { display: none; }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-sidebar { display: grid; grid-template-columns: repeat(2, 1fr); border-right: 0; border-bottom: 1px solid var(--border); }
  .editor-sidebar .full-width, .editor-rule { display: none; }
  .editor-main { border-right: 0; }
  .knowledge-view.is-active { height: auto; min-height: calc(100dvh - var(--topbar) - 40px); }
  .knowledge-frame-wrap { min-height: 68dvh; flex: initial; }
}

@media (max-width: 760px) {
  .topbar { display: grid; grid-template-columns: 40px minmax(0, 1fr) 52px; gap: 8px; padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: 10px; }
  .topbar .global-search { width: auto; max-width: none; height: 44px; flex: none; padding-inline: 12px; }
  .interface-language select { min-width: 52px; width: 52px; height: 44px; padding-inline: 6px; }
  .topbar #addFileButton { display: none; }
  .main-content { min-width: 0; overflow: visible; padding: 18px 13px calc(88px + env(safe-area-inset-bottom)); }
  .global-search kbd { display: none; }
  .hero-panel { gap: 0; padding: 24px 18px; border-radius: var(--r-lg); }
  .hero-copy h1 { font-size: clamp(29px, 9vw, 34px); }
  input[type="search"] { font-size: 16px; }
  .hero-search { height: auto; min-height: 52px; }
  .hero-search button { min-width: 68px; }
  .example-links { display: none; }
  .section-block { margin-top: 26px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .quick-grid { grid-template-columns: 1fr; }
  .quick-card { min-height: 82px; padding: 14px; }
  .language-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .language-card { min-height: 112px; padding: 14px; }
  .language-card strong { margin-top: 10px; }
  .library-toolbar { grid-template-columns: 1fr auto; }
  .scope-switch { grid-column: 1 / -1; }
  .filters { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
  .page-actions { width: 100%; }
  .page-actions > * { flex: 1; }
  .document-grid { grid-template-columns: 1fr; }
  .document-card.is-list { display: flex; min-height: 210px; }
  .training-hero { padding: 25px 20px; }
  .training-hero h2 { font-size: 26px; }
  .future-card { grid-template-columns: 45px 1fr; }
  .future-card button { grid-column: 1 / -1; }
  .settings-grid { grid-template-columns: 1fr; }
  .editor-sidebar { grid-template-columns: 1fr; }
  .document-modal-header { gap: 10px; padding-inline: 12px; }
  .document-modal-header h2 { font-size: 15px; }
  .modal-actions { width: 100%; gap: 7px; }
  .modal-actions > * { flex: 1 1 auto; padding-inline: 10px; }
  .modal-actions #favoriteDocument { flex: 0 0 44px; }
  .reader-toolbar { padding-inline: 8px; gap: 6px; }
  .reader-pagination { gap: 4px; font-size: 13px; }
  .reader-scale select { font-size: 16px; width: 132px; padding-inline: 6px; }
  .toast-region { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); left: 14px; }
  html[dir="rtl"] .toast-region { right: 14px; left: 14px; }
  .toast { width: 100%; min-width: 0; max-width: none; }
  .modal-shell { max-height: calc(100dvh - 28px); }
  .document-modal, .document-modal-shell { height: 100dvh; }
  .mobile-tabbar { position: fixed; z-index: 21; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); min-height: calc(68px + env(safe-area-inset-bottom)); padding: 8px 9px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(192,204,217, .94); background: rgba(241,244,248, .95); box-shadow: 0 -12px 32px rgba(40,52,68,.11); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
  .mobile-tab { min-width: 0; min-height: 52px; display: grid; place-items: center; align-content: center; gap: 2px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--muted); font-size: 11px; font-weight: 760; line-height: 1.25; cursor: pointer; }
  .mobile-tab > span:first-child { color: var(--accent); font-size: 19px; line-height: 1; }
  .mobile-tab.is-active { background: var(--accent-soft); color: var(--accent); }
  .mobile-tab.is-active > span:first-child { color: var(--accent); }
  .mobile-tab-add { color: var(--accent); }
  .mobile-tab-add > span:first-child { width: 31px; height: 31px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--accent); color: var(--ink-on-strong); box-shadow: 0 5px 13px rgba(62,100,137,.24); }
  html.is-public-readonly .mobile-tabbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 380px) {
  .reader-page-number { width: 46px; }
  .reader-scale select { width: 110px; font-size: 14px; }
  .topbar { grid-template-columns: 40px minmax(0, 1fr) 46px; gap: 6px; padding-inline: 10px; }
  .interface-language select { min-width: 46px; width: 46px; }
  .language-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1180px) {
  #toggleDocumentDetails { display: inline-flex; }
  .show-document-details .document-viewer-layout { display: block; overflow: auto; }
  .show-document-details .pdf-stage { display: none; }
  .show-document-details .metadata-panel { display: block; max-width: 700px; margin-inline: auto; border: 0; }
}
@media (min-width: 761px) and (max-width: 1050px) {
  .library-toolbar { grid-template-columns: 1fr auto; }
  .scope-switch { grid-column: 1 / -1; width: fit-content; }
  .document-card.is-list { grid-template-columns: 45px minmax(130px, 1fr) auto; }
  .document-card.is-list .chip-row { grid-column: 2; }
  .document-card.is-list .card-footer { grid-column: 3; grid-row: 1 / 3; }
}
@media (max-width: 760px) {
  .document-card.is-list { align-items: stretch; gap: 0; }
  .document-card.is-list .card-top { display: flex; flex-direction: row; }
  .document-card.is-list .favorite-button { position: static; }
  .document-card.is-list .card-footer { max-width: none; margin-top: auto; padding-top: 16px; flex-direction: row; align-items: center; }
  .scope-switch { display: flex; }
  .scope-switch button { flex: 1; padding-inline: 6px; font-size: 12px; }
  .filters select, .editor-sidebar input, .editor-sidebar select, .upload-metadata input, .upload-metadata select { font-size: 16px; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .reader-spinner { animation-duration: 3s; }
}

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

@media print {
  .sidebar, .topbar, .page-header, .editor-sidebar, .editor-main { display: none !important; }
  .app-shell, .workspace, .main-content, .view, .editor-layout, .editor-preview { display: block !important; width: auto !important; margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: white !important; }
  .view:not(#view-editor) { display: none !important; }
  .editor-preview > div { min-height: 0; padding: 0; box-shadow: none; }
}
