:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #fff;
  --surface-soft: #f8f9fb;
  --surface-strong: #eef0f3;
  --ink: #20242b;
  --ink-soft: #505967;
  --muted: #68717d;
  --line: #e1e5ea;
  --line-strong: #cbd1d9;
  --sidebar: #1b1f26;
  --accent: #faa21b;
  --accent-hover: #ed9306;
  --accent-soft: #fff5e5;
  --green: #168549;
  --green-soft: #ebf8f0;
  --blue: #3b73e9;
  --blue-soft: #edf3ff;
  --purple: #7c5ce6;
  --red: #d83b3b;
  --red-soft: #fff0f0;
  --shadow-xs: none;
  --shadow-sm: 0 4px 16px rgb(0 0 0 / 5%);
  --shadow-lg: 0 30px 100px rgb(0 0 0 / 20%);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-width: 246px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); text-rendering: optimizeLegibility; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: "Segoe UI", Arial, sans-serif; font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body.modal-open, body.editor-open { overflow: hidden; }
button, input, select, textarea { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid rgb(250 162 27 / 24%); outline-offset: 2px; }
svg { display: block; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; }
.sr-only { width: 1px; height: 1px; padding: 0; position: absolute; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.mobile-only { display: none; }
.muted { color: var(--muted); }

.app-loading { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; color: var(--muted); }
.boot-brand img { width: 150px; max-height: 42px; }
.boot-progress { width: 170px; height: 3px; overflow: hidden; background: #e5e5e3; border-radius: 99px; }
.boot-progress i { width: 45%; height: 100%; display: block; background: var(--accent); border-radius: inherit; animation: boot 1.2s var(--ease) infinite alternate; }
.app-loading p { margin: 0; font-size: 12px; }
@keyframes boot { from { transform: translateX(-65%); } to { transform: translateX(185%); } }

.auth-shell {
  min-height: 100vh;
  min-height: 100svh;
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  background:
    radial-gradient(820px 680px at 105% 18%, rgb(250 162 27 / 14%), transparent 58%),
    radial-gradient(760px 620px at -8% 91%, rgb(250 162 27 / 11%), transparent 60%),
    #0d0d0c;
}
.auth-shell::after { display: none; }
.auth-logo { width: 146px; height: auto; position: absolute; z-index: 2; top: 42px; left: 48px; }
.auth-form-wrap { min-height: 100vh; min-height: 100svh; padding: 32px 32px 56px; position: relative; z-index: 1; display: grid; place-items: center; }
.auth-card { width: min(448px, 100%); padding: 49px 48px 48px; background: #fff; border: 1px solid rgb(255 255 255 / 65%); border-radius: 20px; box-shadow: 0 24px 80px rgb(0 0 0 / 28%); animation: rise .45s var(--ease) both; }
.auth-card h1 { margin: 0; color: #171717; font-size: 31px; font-weight: 700; line-height: 1.16; letter-spacing: -.02em; }
.auth-card > p { margin: 8px 0 28px; color: #7b7b78; font-size: 14px; line-height: 1.55; }
.auth-card .form-group { margin: 0 0 18px; gap: 8px; }
.auth-card .form-group:last-of-type { margin-bottom: 26px; }
.auth-card .form-group label { color: #252525; font-size: 12px; font-weight: 500; line-height: 1.4; }
.auth-card .field { min-height: 54px; padding: 0 15px; color: #202020; background: #fbfbfa; border-color: #ddddda; border-radius: 11px; font-size: 14px; }
.auth-card .field::placeholder { color: #aaa9a6; opacity: 1; }
.auth-card .field:hover { border-color: #c9c9c5; }
.auth-card .field:focus { background: #fff; border-color: #ce8b1e; box-shadow: 0 0 0 3px rgb(250 162 27 / 13%); }
.auth-card .btn { min-height: 53px; border-radius: 10px; font-size: 14px; box-shadow: none; }
.auth-card .btn-primary:hover:not(:disabled) { box-shadow: 0 8px 20px rgb(250 162 27 / 23%); }
.auth-submit { gap: 12px; }
.auth-submit-icon { width: 17px; height: 17px; flex: 0 0 auto; transition: transform .16s var(--ease); }
.auth-submit:hover:not(:disabled) .auth-submit-icon { transform: translateX(2px); }
.auth-help { margin-top: 27px; display: flex; align-items: center; justify-content: center; gap: 7px; color: #a09f9b; font-size: 12px; font-weight: 400; line-height: 18px; text-align: center; }
.auth-help-icon { width: 14px; height: 14px; flex: 0 0 auto; }
.auth-notice { margin: -7px 0 20px; padding: 11px 13px; color: #735010; background: var(--accent-soft); border: 1px solid #f3d9aa; border-radius: 9px; font-size: 12px; line-height: 1.45; }
.password-field { position: relative; }
.password-field .field { padding-right: 51px; }
.password-field button { width: 46px; height: 46px; position: absolute; top: 4px; right: 4px; display: grid; place-items: center; color: #969691; background: transparent; border: 0; border-radius: 8px; transition: color .16s, background .16s; }
.password-field button:hover { color: #565652; background: #f2f2f0; }
.password-field button .icon { width: 18px; }
.auth-error { padding: 40px; }
.auth-error .empty-state { min-height: 300px; padding: 0; }
.auth-error .empty-state p { max-width: 310px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); transition: grid-template-columns .34s var(--ease); }
.sidebar { width: var(--sidebar-width); height: 100%; height: 100dvh; padding: 18px 12px max(14px, env(safe-area-inset-bottom)); position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; flex-direction: column; overflow: hidden; color: #ddd; background: var(--sidebar); border-right: 1px solid #202020; transition: width .34s var(--ease), transform .3s var(--ease); }
.brand-row { height: 50px; flex-shrink: 0; display: grid; grid-template-columns: minmax(0, 1fr) 32px; align-items: center; gap: 8px; transition: grid-template-columns .34s var(--ease), gap .34s var(--ease); }
.brand { width: 150px; min-width: 0; height: 42px; padding: 5px 8px; position: relative; display: flex; align-items: center; overflow: hidden; transition: width .34s var(--ease), padding .34s var(--ease); }
.brand img { position: absolute; left: 8px; object-fit: contain; object-position: left center; transition: opacity .22s var(--ease), transform .34s var(--ease); }
.brand-wordmark { width: 128px; max-height: 34px; opacity: 1; transform: translateX(0); }
.brand-mark { width: 31px; height: 31px; opacity: 0; transform: translateX(-8px) scale(.88); }
.sidebar-collapse { width: 32px; height: 32px; position: relative; display: grid; place-items: center; color: #777; background: transparent; border: 0; border-radius: var(--radius-sm); opacity: 1; transition: width .34s var(--ease), color .16s, background .16s, border-color .16s, opacity .2s var(--ease), transform .28s var(--ease); }
.sidebar-collapse:hover { color: #fff; background: #1e1e1e; }
.sidebar-collapse .icon { width: 16px; transition: transform .34s var(--ease); }
.nav-label { max-height: 14px; margin: 23px 10px 8px; overflow: hidden; color: #5d5d5d; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: none; white-space: nowrap; opacity: 1; transform: translateX(0); transition: max-height .28s var(--ease), margin .34s var(--ease), opacity .18s, transform .28s var(--ease); }
.nav-list { min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; display: grid; gap: 3px; }
.nav-item { min-height: 41px; padding: 0 11px; display: flex; align-items: center; gap: 11px; color: #929292; border-radius: 9px; white-space: nowrap; transition: color .16s, background .16s, transform .16s, padding .34s var(--ease), gap .34s var(--ease); }
.nav-item:hover { color: #eee; background: #171717; transform: translateX(1px); }
.nav-item.active { color: #fff; background: #222; box-shadow: inset 2px 0 var(--accent); }
.nav-item .nav-text { max-width: 155px; overflow: hidden; font-size: 14px; font-weight: 500; opacity: 1; transform: translateX(0); transition: max-width .34s var(--ease), opacity .18s, transform .28s var(--ease); }
.sidebar-bottom { margin-top: auto; padding-top: 8px; flex-shrink: 0; }
.user-menu { position: relative; }
.user-menu > summary { min-height: 56px; padding: 10px 9px; display: grid; grid-template-columns: 34px minmax(0, 1fr) 13px; align-items: center; gap: 9px; list-style: none; border-top: 1px solid #222; border-radius: 10px; cursor: pointer; transition: background .16s, padding .34s var(--ease), gap .34s var(--ease), grid-template-columns .34s var(--ease); }
.user-menu > summary::-webkit-details-marker, .action-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover { background: #171717; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; color: #1a1206; background: var(--accent); border-radius: 50%; font-size: 12px; font-weight: 800; }
.avatar-lg { width: 40px; height: 40px; }
.avatar-table { width: 34px; height: 34px; color: #544018; background: var(--accent-soft); border: 1px solid #f2d59d; }
.avatar-profile { width: 76px; height: 76px; font-size: 20px; }
.user-meta { min-width: 0; max-width: 160px; overflow: hidden; opacity: 1; transform: translateX(0); transition: max-width .34s var(--ease), opacity .18s, transform .28s var(--ease); }
.user-meta strong, .user-meta small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta strong { color: #e9e9e9; font-size: 12px; }
.user-meta small { margin-top: 3px; color: #6e6e6e; font-size: 12px; }
.menu-chevron { width: 13px; max-width: 13px; overflow: hidden; color: #5c5c5c; opacity: 1; transform: rotate(-90deg); transition: max-width .34s var(--ease), opacity .18s, transform .18s; }
.user-menu[open] .menu-chevron { transform: rotate(90deg); }
.sidebar-collapsed { grid-template-columns: 74px minmax(0, 1fr); }
.sidebar-collapsed .sidebar { width: 74px; }
.sidebar-collapsed .brand-row { position: relative; grid-template-columns: 1fr; justify-items: center; gap: 0; }
.sidebar-collapsed .brand { width: 50px; padding-inline: 0; justify-content: center; }
.sidebar-collapsed .brand-wordmark { opacity: 0; transform: translateX(-12px); }
.sidebar-collapsed .brand-mark { width: 28px; height: 28px; left: 50%; opacity: 1; transform: translateX(-50%) scale(1); }
.sidebar-collapsed .sidebar-collapse { width: 32px; position: absolute; left: 50%; top: 50%; color: #aaa; background: #202020; border: 1px solid #2e2e2e; opacity: 0; pointer-events: none; transform: translate(-50%, -50%) scale(.86); }
.sidebar-collapsed .brand-row:hover .brand-mark, .sidebar-collapsed .brand-row:focus-within .brand-mark { opacity: 0; transform: translateX(-50%) scale(.82); }
.sidebar-collapsed .brand-row:hover .sidebar-collapse, .sidebar-collapsed .brand-row:focus-within .sidebar-collapse { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.sidebar-collapsed .sidebar-collapse .icon { transform: rotate(180deg); }
.sidebar-collapsed .nav-label { max-height: 0; margin-top: 0; margin-bottom: 0; opacity: 0; transform: translateX(-8px); }
.sidebar-collapsed .nav-text, .sidebar-collapsed .user-meta { max-width: 0; opacity: 0; transform: translateX(-8px); }
.sidebar-collapsed .menu-chevron { max-width: 0; opacity: 0; }
.sidebar-collapsed .nav-item { padding-inline: 16px; gap: 0; }
.sidebar-collapsed .user-menu > summary { padding-inline: 8px; grid-template-columns: 34px 0 0; gap: 0; }
.main { min-width: 0; min-height: 100vh; grid-column: 2; }
.topbar { height: 66px; padding: 0 34px; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-title { display: flex; align-items: center; gap: 12px; }
.topbar-title strong { font-size: 14px; font-weight: 650; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.mobile-menu { display: none !important; }
.notification-trigger { position: relative; }
.notification-trigger i { width: 5px; height: 5px; position: absolute; top: 7px; right: 7px; background: var(--accent); border: 1px solid var(--bg); border-radius: 50%; }
.page { width: min(100%, 1500px); margin: 0 auto; padding: 38px 40px 70px; }
.view-enter { animation: fade .28s var(--ease) both; }
.page-heading { margin-bottom: 30px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-heading h1 { margin: 7px 0 6px; font-size: clamp(26px, 2.3vw, 32px); font-weight: 700; line-height: 1.05; letter-spacing: -.025em; }
.page-heading p { max-width: 720px; margin: 0; color: var(--ink-soft); line-height: 1.55; }
.eyebrow { color: #a26308; font-size: 12px; font-weight: 750; letter-spacing: .13em; text-transform: none; }
.page-actions { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.mobile-scrim { display: none; }

.btn { min-height: 38px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-xs); font-size: 14px; font-weight: 600; white-space: nowrap; transition: transform .16s var(--ease), border-color .16s, background .16s, box-shadow .16s, color .16s; }
.btn:hover:not(:disabled) { background: var(--surface-soft); border-color: #bdbdb9; box-shadow: 0 4px 12px rgb(0 0 0 / 6%); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .46; cursor: not-allowed; }
.btn-primary { color: #1b1102; background: var(--accent); border-color: var(--accent); box-shadow: 0 4px 14px rgb(250 162 27 / 20%); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: 0 7px 18px rgb(250 162 27 / 26%); }
.btn-danger { color: #fff; background: var(--red); border-color: var(--red); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-icon { width: 38px; padding: 0; }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 12px; }
.btn-lg { min-height: 48px; font-size: 14px; }
.btn-block { width: 100%; }
.button-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.text-link { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.text-link .icon { width: 14px; transition: transform .16s; }
.text-link:hover .icon { transform: translateX(2px); }

.metrics-grid { margin-bottom: 22px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-card { min-height: 150px; padding: 21px; position: relative; overflow: hidden; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; }
.metric-card:hover { border-color: #d8d8d4; box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.metric-icon { width: 34px; height: 34px; margin-bottom: 19px; display: grid; place-items: center; color: #a06308; background: var(--accent-soft); border-radius: 9px; }
.metric-icon .icon { width: 17px; }
.metric-icon.accent-blue { color: var(--blue); background: var(--blue-soft); }
.metric-icon.accent-purple { color: var(--purple); background: #f1edff; }
.metric-icon.accent-green { color: var(--green); background: var(--green-soft); }
.metric-card > span { color: var(--ink-soft); font-size: 12px; }
.metric-card > strong { margin-top: auto; font-size: 31px; line-height: 1; letter-spacing: -.04em; }
.metric-card > small { margin-top: 5px; color: var(--muted); font-size: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.panel-head { min-height: 73px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.panel-head h3, .settings-panel-head h2 { margin: 0; font-size: 14px; letter-spacing: -.015em; }
.panel-head p, .settings-panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.panel-flush { overflow: visible; }

.table-wrap { width: 100%; overflow: visible; }
.data-table { width: 100%; border-spacing: 0; border-collapse: separate; font-size: 14px; }
.data-table th { height: 42px; padding: 0 14px; color: var(--muted); background: var(--surface-soft); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 700; letter-spacing: 0; text-align: left; text-transform: none; white-space: nowrap; }
.data-table th:first-child { padding-left: 20px; }
.data-table th:last-child { width: 48px; padding-right: 12px; }
.data-table td { min-height: 64px; padding: 13px 14px; vertical-align: middle; border-bottom: 1px solid #efefed; }
.data-table td:first-child { padding-left: 20px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .14s; }
.data-table tbody tr:hover { background: #fbfbfa; }
.clickable-row { cursor: pointer; }
.name-cell { min-width: 0; display: flex; align-items: center; gap: 11px; }
.name-cell > div { min-width: 0; }
.name-cell strong, .name-cell small, .cell-note { display: block; }
.name-cell strong { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.name-cell small, .cell-note { margin-top: 3px; color: var(--muted); font-size: 12px; }
.file-mark { width: 33px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; color: #9c5d06; background: var(--accent-soft); border: 1px solid #f2d6a4; border-radius: 7px; font-size: 12px; font-style: normal; font-weight: 750; }
.file-mark.company-logo { padding: 3px; overflow: hidden; background: #fff; border-color: var(--line); }
.file-mark.company-logo img { width: 100%; height: 100%; display: block; object-fit: contain; }
.file-mark-soft { color: var(--ink-soft); background: #f5f5f3; border-color: var(--line); }
.file-mark .icon { width: 15px; }
.action-cell { width: 54px; text-align: right; }
.status-stack { display: flex; align-items: center; gap: 6px; }
.badge { min-height: 24px; padding: 0 8px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.badge-success { color: #13723e; background: var(--green-soft); border-color: #cdebd8; }
.badge-progress { color: #275fbf; background: var(--blue-soft); border-color: #d7e3fb; }
.badge-danger { color: #ba2b2b; background: var(--red-soft); border-color: #f4d0d0; }
.badge-neutral { color: #686868; background: #f1f1ef; border-color: #e1e1de; }
.mini-tag { padding: 3px 5px; color: #7d4d09; background: var(--accent-soft); border-radius: 5px; font-size: 12px; font-weight: 750; }
.spinner { width: 12px; height: 12px; display: inline-block; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .65s linear infinite; }
.delivery-state { color: var(--ink-soft); font-size: 12px; }
.row-progress { width: 88px; height: 2px; margin-top: 8px; overflow: hidden; background: #e6ebf6; border-radius: 99px; }
.row-progress i, .progress-track i { height: 100%; display: block; background: var(--blue); border-radius: inherit; transition: width .4s var(--ease); }

.action-menu { position: relative; display: inline-block; }
.more-button { width: 32px; height: 32px; display: grid; place-items: center; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 8px; list-style: none; cursor: pointer; transition: color .14s, background .14s, border-color .14s; }
.more-button:hover, .action-menu[open] > .more-button { color: var(--ink); background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-xs); }
.more-button .icon { width: 17px; }
.menu-popover { width: 260px; padding: 6px; position: absolute; z-index: 80; top: calc(100% + 5px); right: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 16px 50px rgb(0 0 0 / 14%); animation: menuIn .15s var(--ease) both; }
.menu-popover[popover] { margin: 0; position: fixed; inset: auto; z-index: 1000; }
.menu-popover[popover]::backdrop { background: transparent; }
.menu-popover a, .menu-popover button { width: 100%; min-height: 36px; padding: 0 9px; display: flex; align-items: center; gap: 9px; color: var(--ink-soft); background: transparent; border: 0; border-radius: 7px; font-size: 14px; text-align: left; transition: color .13s, background .13s; }
.menu-popover a:hover, .menu-popover button:hover { color: var(--ink); background: var(--surface-strong); }
.menu-popover .icon { width: 15px; color: var(--muted); }
.menu-popover hr { height: 1px; margin: 5px 2px; background: var(--line); border: 0; }
.menu-popover .menu-danger { color: var(--red); }
.user-popover { width: 236px; right: auto; bottom: calc(100% + 7px); left: 0; top: auto; }
.menu-account { padding: 9px; display: flex; align-items: center; gap: 10px; }
.menu-account div { min-width: 0; }
.menu-account strong, .menu-account small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-account small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.sidebar-collapsed .user-popover { left: 51px; bottom: 0; }

.toolbar { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.search-field { width: min(440px, 100%); min-height: 40px; padding: 0 12px; display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; transition: border-color .15s, box-shadow .15s; }
.search-field:focus-within { border-color: #d6a34d; box-shadow: 0 0 0 3px rgb(250 162 27 / 10%); }
.search-field .icon { width: 15px; color: var(--muted); }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 12px; }
.toolbar-filters { display: flex; align-items: center; gap: 7px; }

.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.template-card, .certificate-template-card, .form-card, .integration-card { min-width: 0; overflow: visible; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; }
.template-card:hover, .certificate-template-card:hover, .form-card:hover, .integration-card:hover { border-color: #d5d5d1; box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.template-preview { aspect-ratio: 16 / 9; position: relative; overflow: hidden; display: block; background: #ededeb; border-bottom: 1px solid var(--line); border-radius: 11px 11px 0 0; }
.template-preview img, .certificate-template-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.template-placeholder, .certificate-template-preview > div { width: 100%; height: 100%; display: grid; place-content: center; justify-items: center; gap: 9px; color: var(--muted); background: linear-gradient(145deg, #f9f9f8, #ececea); }
.template-placeholder .icon { width: 31px; height: 31px; }
.template-placeholder span { font-size: 12px; }
.edit-hint { padding: 7px 10px; position: absolute; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 6px; color: #fff; background: rgb(0 0 0 / 74%); border-radius: 7px; font-size: 12px; font-weight: 650; opacity: 0; transform: translateY(4px); transition: opacity .18s, transform .18s; backdrop-filter: blur(8px); }
.edit-hint .icon { width: 12px; }
.template-preview:hover .edit-hint, .certificate-template-preview:hover .edit-hint { opacity: 1; transform: translateY(0); }
.template-content { padding: 16px; }
.card-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-title-row > div { min-width: 0; }
.card-title-row h3 { margin: 0; overflow: hidden; font-size: 14px; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.card-title-row p { margin: 5px 0 0; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.template-meta { margin-top: 15px; display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: var(--muted); font-size: 12px; }
.version-line { margin-top: 14px; padding-top: 12px; display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); border-top: 1px solid var(--line); font-size: 12px; }
.version-line small { color: var(--muted); }

.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.form-card { padding: 18px; }
.service-icon { width: 38px; height: 38px; display: grid; place-items: center; color: #9e610b; background: var(--accent-soft); border-radius: 10px; }
.service-icon .icon { width: 18px; }
.form-card-title { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.form-card h3 { margin: 0; font-size: 14px; }
.form-card > p { min-height: 36px; margin: 7px 0 19px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.progress-row { margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.progress-row strong { color: var(--ink-soft); }
.progress-track { height: 5px; overflow: hidden; background: #ededeb; border-radius: 99px; }
.progress-track i { background: var(--accent); }
.form-card footer { margin-top: 17px; padding-top: 13px; display: flex; justify-content: space-between; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; }

.section-tabs-row { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tabs { padding: 3px; display: inline-flex; align-items: center; gap: 2px; overflow-x: auto; background: #ececea; border-radius: 10px; }
.tab { min-height: 34px; padding: 0 12px; display: flex; align-items: center; gap: 7px; color: var(--ink-soft); background: transparent; border: 0; border-radius: 8px; font-size: 14px; font-weight: 600; white-space: nowrap; transition: background .15s, color .15s, box-shadow .15s; }
.tab span { min-width: 19px; padding: 2px 5px; color: var(--muted); background: rgb(0 0 0 / 4%); border-radius: 99px; font-size: 12px; }
.tab.active { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-xs); }
.split-button { display: flex; }
.split-button > .btn:first-child { border-radius: 8px 0 0 8px; }
.split-menu { height: 38px; }
.btn-split { width: 35px; padding: 0; border-left-color: rgb(0 0 0 / 12%); border-radius: 0 8px 8px 0; box-shadow: none; list-style: none; }
.btn-split .icon { width: 13px; transform: rotate(90deg); }
.certificate-template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.certificate-template-preview { aspect-ratio: 1.414 / 1; position: relative; overflow: hidden; display: block; background: #eee; border-bottom: 1px solid var(--line); border-radius: 11px 11px 0 0; }

.empty-state { min-height: 280px; padding: 48px 24px; display: grid; place-content: center; justify-items: center; text-align: center; }
.empty-icon { width: 48px; height: 48px; margin-bottom: 15px; display: grid; place-items: center; color: #a1650c; background: var(--accent-soft); border: 1px solid #f4dfba; border-radius: 14px; }
.empty-icon .icon { width: 21px; }
.empty-state h2, .empty-state h3 { margin: 0 0 7px; font-size: 16px; letter-spacing: -.02em; }
.empty-state p { max-width: 430px; margin: 0 0 18px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.data-table .empty-state { min-height: 330px; }

.field, .select, .textarea, .static-field { width: 100%; min-height: 42px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; outline: 0; font-size: 12px; transition: border-color .15s, box-shadow .15s, background .15s; }
.field:hover, .select:hover, .textarea:hover { border-color: #c5c5c1; }
.field:focus, .select:focus, .textarea:focus { border-color: #d69a35; box-shadow: 0 0 0 3px rgb(250 162 27 / 10%); }
.field-lg { min-height: 46px; }
.select { appearance: none; padding-right: 33px; background-image: linear-gradient(45deg, transparent 50%, #777 50%), linear-gradient(135deg, #777 50%, transparent 50%); background-position: calc(100% - 16px) 17px, calc(100% - 12px) 17px; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
.select-compact { width: auto; min-width: 142px; min-height: 40px; }
.textarea { min-height: 104px; padding: 11px 12px; resize: vertical; line-height: 1.55; }
.textarea-compact { min-height: 78px; }
.master-prompt { min-height: 260px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.report-prompt { min-height: 150px; }
.file-field { padding: 8px; }
.static-field { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); }
.form-group { display: grid; gap: 7px; }
.form-group label, .property-grid span { color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.form-group small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.label-row { display: flex; justify-content: space-between; gap: 10px; }
.label-row span { color: var(--muted); font-size: 12px; }
.form-divider { margin: 8px 0; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; text-transform: none; letter-spacing: .06em; }
.form-divider::before, .form-divider::after { height: 1px; flex: 1; content: ""; background: var(--line); }
.switch-row { min-height: 58px; padding: 10px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch-row > span { min-width: 0; }
.switch-row strong, .switch-row small { display: block; }
.switch-row strong { font-size: 12px; }
.switch-row small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.switch { width: 36px; height: 20px; position: relative; flex: 0 0 auto; appearance: none; background: #d7d7d3; border: 0; border-radius: 99px; cursor: pointer; transition: background .18s; }
.switch::after { width: 16px; height: 16px; position: absolute; top: 2px; left: 2px; content: ""; background: #fff; border-radius: 50%; box-shadow: 0 1px 4px rgb(0 0 0 / 20%); transition: transform .18s var(--ease); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(16px); }
.section-title { margin-bottom: 13px; display: flex; align-items: center; justify-content: space-between; }
.section-title h3 { margin: 0; font-size: 12px; }
.section-title span { color: var(--muted); font-size: 12px; }
.form-section { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.form-section.first { margin-top: 0; padding-top: 0; border-top: 0; }

.compact-callout { min-height: 68px; padding: 12px 13px; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 11px; background: var(--accent-soft); border: 1px solid #f0d7aa; border-radius: 10px; }
.compact-callout > .icon { width: 18px; color: #9a610c; }
.compact-callout strong, .compact-callout small { display: block; }
.compact-callout strong { font-size: 12px; }
.compact-callout small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.prompt-template-content { padding: 18px; }
.prompt-template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.prompt-template-card { min-width: 0; padding: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-xs); transition: border-color .16s, box-shadow .16s, transform .16s var(--ease); }
.prompt-template-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.prompt-template-head, .prompt-template-head > div { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.prompt-template-head > div { min-width: 0; justify-content: flex-start; }
.prompt-template-icon { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; color: #9a610c; background: var(--accent-soft); border-radius: 8px; }
.prompt-template-icon .icon { width: 15px; }
.prompt-template-card h3 { margin: 1px 0 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.prompt-template-card h3 + p { margin: 4px 0 0; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.prompt-template-excerpt { height: 48px; margin: 14px 0; overflow: hidden; color: var(--ink-soft); font-size: 12px; line-height: 1.7; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.prompt-template-card footer { min-height: 29px; padding-top: 11px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; }
.prompt-template-card footer > span { display: flex; align-items: center; gap: 6px; }
.prompt-template-card footer .icon { width: 12px; }
.prompt-files-section { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.prompt-file-upload { min-height: 72px; margin-top: 9px; }
.attached-file-list { display: grid; gap: 6px; }
.attached-file-list > label { min-height: 46px; padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; }
.attached-file-list > label > span { min-width: 0; display: flex; align-items: center; gap: 8px; }
.attached-file-list .icon { width: 14px; color: var(--muted); }
.attached-file-list strong, .attached-file-list small { display: block; }
.attached-file-list strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.attached-file-list small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.unsaved-note { margin: 13px 0 0; display: flex; align-items: center; gap: 6px; color: #9a610c; font-size: 12px; }
.unsaved-note[hidden] { display: none; }
.unsaved-note .icon { width: 13px; }
.compact-empty { margin: 12px 0; font-size: 12px; }
.field-error { color: var(--red) !important; }

.dialog-backdrop { padding: 24px; position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; overflow-y: auto; background: rgb(0 0 0 / 44%); opacity: 0; transition: opacity .16s; backdrop-filter: blur(5px); }
.dialog-backdrop.visible { opacity: 1; }
.dialog { width: min(760px, 100%); max-height: min(900px, calc(100vh - 48px)); overflow: hidden; display: flex; flex-direction: column; background: var(--surface); border: 1px solid rgb(255 255 255 / 60%); border-radius: 16px; box-shadow: var(--shadow-lg); transform: translateY(12px) scale(.985); transition: transform .2s var(--ease); }
.dialog > form { min-height: 0; flex: 1 1 auto; overflow: hidden; display: flex; flex-direction: column; }
.dialog > form > .dialog-body, .dialog > .dialog-body { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; }
.dialog > form > .dialog-footer, .dialog > .dialog-footer { flex: 0 0 auto; }
.dialog-backdrop.visible .dialog { transform: translateY(0) scale(1); }
.dialog-sm { width: min(530px, 100%); }
.dialog-wide { width: min(980px, 100%); }
.dialog-head { padding: 22px 24px 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 6px 0 4px; font-size: 21px; letter-spacing: -.02em; }
.dialog-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.close-button { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; color: var(--muted); background: transparent; border: 0; border-radius: 8px; }
.close-button:hover { color: var(--ink); background: var(--surface-strong); }
.dialog-body { padding: 22px 24px; overflow-y: auto; }
.dialog-footer { min-height: 68px; padding: 13px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--surface-soft); border-top: 1px solid var(--line); }
.dialog-footer > span { color: var(--muted); font-size: 12px; }
.source-file-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.source-file { min-height: 66px; padding: 11px; position: relative; display: flex; align-items: center; gap: 10px; background: var(--surface-soft); border: 1px dashed var(--line-strong); border-radius: 9px; cursor: pointer; transition: border-color .15s, background .15s; }
.source-file:hover { background: var(--accent-soft); border-color: #e3b765; }
.source-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.source-file-icon { width: 29px; height: 29px; display: grid; place-items: center; color: var(--muted); background: #eee; border-radius: 7px; }
.source-file-icon .icon { width: 14px; }
.source-file strong, .source-file small { display: block; }
.source-file strong { font-size: 12px; }
.source-file small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.analysis-files-box { margin-top: 13px; padding: 14px; display: grid; gap: 11px; background: #fbfaf7; border: 1px solid #eee7da; border-radius: 10px; }
.analysis-files-box > div > strong { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.analysis-files-box > div > strong .icon { width: 15px; color: #a5680d; }
.analysis-files-box small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.template-attached-files { padding: 10px 11px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; }
.template-attached-files > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: none; }
.template-attached-files > div { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.template-attached-files > div > span { max-width: 100%; padding: 5px 7px; display: inline-flex; align-items: center; gap: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.template-attached-files b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.template-attached-files .icon { width: 11px; color: var(--muted); }
.knowledge-picker summary, .advanced-section summary, .manual-upload summary { color: var(--ink-soft); font-size: 12px; font-weight: 650; cursor: pointer; }
.knowledge-picker > div { margin-top: 8px; display: grid; gap: 5px; }
.knowledge-picker label { padding: 7px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; font-size: 12px; }
.template-file-editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.upload-card { min-height: 92px; padding: 15px; position: relative; display: flex; align-items: center; gap: 12px; color: var(--ink-soft); background: var(--surface-soft); border: 1px dashed var(--line-strong); border-radius: 10px; cursor: pointer; }
.upload-card:hover { color: var(--ink); border-color: #dea84e; background: var(--accent-soft); }
.upload-card > .icon { width: 24px; color: #a36a12; }
.upload-card strong, .upload-card small { display: block; }
.upload-card strong { font-size: 12px; }
.upload-card small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.upload-card input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-card-large { min-height: 130px; }
.advanced-section { margin-top: 20px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.advanced-section[open] summary { margin-bottom: 14px; }
.layout-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.layout-grid label { display: grid; gap: 5px; }
.layout-grid span { color: var(--muted); font-size: 12px; }
.token-list { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.token-list code { padding: 5px 7px; color: #7b520f; background: var(--accent-soft); border: 1px solid #efd9b2; border-radius: 6px; font-size: 12px; }
.upload-zone { min-height: 180px; padding: 25px; position: relative; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--muted); background: var(--surface-soft); border: 1px dashed var(--line-strong); border-radius: 12px; text-align: center; cursor: pointer; }
.upload-zone:hover { color: var(--ink); background: var(--accent-soft); border-color: #dfa94f; }
.upload-zone .icon { width: 28px; color: #a86b0c; }
.upload-zone strong { color: var(--ink); font-size: 12px; }
.upload-zone span { font-size: 12px; }
.upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.selected-files { display: grid; gap: 5px; }
.selected-files span { padding: 7px 9px; display: flex; align-items: center; gap: 7px; background: var(--surface-soft); border-radius: 7px; font-size: 12px; }
.selected-files b { min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.selected-files small { margin-left: auto; color: var(--muted); }
.selected-files .icon { width: 13px; }
.participants { min-height: 210px; }
.danger-callout { padding: 15px; display: flex; align-items: flex-start; gap: 12px; color: #923030; background: var(--red-soft); border: 1px solid #f1cece; border-radius: 10px; }
.danger-callout > .icon { width: 20px; }
.danger-callout p { margin: 0; }
.danger-callout strong, .danger-callout span { display: block; }
.danger-callout span { margin-top: 5px; font-size: 12px; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.detail-grid > div { min-height: 70px; padding: 12px; display: grid; align-content: space-between; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 9px; }
.detail-grid span { color: var(--muted); font-size: 12px; }
.analysis-preview { margin-top: 18px; padding: 19px; background: #fbfaf7; border: 1px solid #eee6d7; border-radius: 12px; }
.analysis-preview h3 { margin: 14px 0 6px; font-size: 12px; }
.analysis-preview p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.65; }
.analysis-preview details { margin-top: 16px; }
.analysis-preview summary { font-size: 12px; font-weight: 650; cursor: pointer; }
.analysis-preview details > div { padding: 12px 0; border-top: 1px solid #ebe4d7; }
.analysis-preview-title, .ai-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.analysis-preview-title h3, .ai-preview-head h4 { margin: 4px 0 0; font-size: 12px; }
.report-analysis-summary .analysis-document { margin-top: 12px; }
.ai-preview-panel { min-height: 150px; margin-top: 13px; padding: 15px; background: #fbfaf7; border: 1px solid #eee6d7; border-radius: 10px; transition: border-color .2s, background .2s; }
.ai-preview-panel.is-ready { background: #fbfdfb; border-color: #cde6d7; }
.ai-preview-panel.is-error { background: #fff8f8; border-color: #f1cece; }
.ai-preview-panel.is-dirty { background: #fffaf0; border-color: #eed3a4; }
.analysis-empty { min-height: 116px; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--muted); text-align: center; }
.analysis-empty .icon { width: 20px; }
.analysis-empty p { max-width: 380px; margin: 0; font-size: 12px; line-height: 1.55; }
.analysis-loading, .analysis-error { min-height: 78px; display: flex; align-items: center; gap: 11px; }
.analysis-loading > .spinner { width: 22px; height: 22px; color: #a1630c; }
.analysis-loading strong, .analysis-loading small, .analysis-error strong { display: block; }
.analysis-loading strong, .analysis-error strong { font-size: 12px; }
.analysis-loading small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.analysis-loading .btn, .analysis-error .btn { margin-left: auto; }
.analysis-error > .icon { width: 19px; color: var(--red); }
.analysis-error > div { min-width: 0; }
.analysis-error p { margin: 4px 0 0; color: var(--red); font-size: 12px; line-height: 1.45; }
.analysis-document { display: grid; gap: 12px; }
.analysis-document section { padding: 11px 12px; background: rgb(255 255 255 / 76%); border: 1px solid var(--line); border-radius: 8px; }
.analysis-document section > span { color: #9a610c; font-size: 12px; font-weight: 750; letter-spacing: .06em; text-transform: none; }
.analysis-document p, .analysis-document li { color: var(--ink-soft); font-size: 12px; line-height: 1.65; }
.analysis-document p { margin: 6px 0 0; white-space: pre-wrap; }
.analysis-document ul { margin: 7px 0 0; padding-left: 17px; }
.analysis-document details { border: 1px solid var(--line); border-radius: 8px; }
.analysis-document summary { padding: 10px 12px; font-size: 12px; font-weight: 650; cursor: pointer; }
.analysis-document details > div { max-height: 360px; padding: 0 12px; overflow: auto; }
.analysis-document article { padding: 10px 0; border-top: 1px solid var(--line); }
.analysis-document article strong { font-size: 12px; }
.analysis-document article p { margin-top: 4px; }
.preview-confirmation { margin-top: 11px; padding-top: 10px; display: flex; align-items: center; gap: 6px; color: var(--green); border-top: 1px solid #dcece2; font-size: 12px; }
.preview-confirmation .icon { width: 13px; }
.analysis-pptx-link { margin-top: 12px; }
.analysis-workbench { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.analysis-current, .analysis-draft { min-width: 0; padding: 14px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 11px; }
.analysis-current > .analysis-document, .analysis-draft > .ai-preview-panel { max-height: 540px; overflow: auto; }
.analysis-controls { display: grid; gap: 10px; }
.analysis-draft .ai-preview-panel { margin-top: 12px; background: var(--surface); }
.analysis-context { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; }
.analysis-capability-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 12px; padding: 10px 11px; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.analysis-capability-note > svg { width: 15px; height: 15px; margin-top: 1px; color: var(--muted); flex: 0 0 auto; }
.analysis-capability-note span { display: grid; min-width: 0; gap: 2px; }
.analysis-capability-note strong { font-size: 12px; font-weight: 650; }
.analysis-capability-note small { color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.analysis-context summary, .analysis-history > summary { padding: 10px 12px; color: var(--ink-soft); font-size: 12px; font-weight: 650; cursor: pointer; }
.analysis-context > div { padding: 0 12px 12px; }
.analysis-context dl { margin: 0; display: grid; gap: 7px; }
.analysis-context dl > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; font-size: 12px; }
.analysis-context dt { color: var(--muted); }
.analysis-context dd { margin: 0; overflow-wrap: anywhere; }
.analysis-context pre { max-height: 130px; margin: 10px 0 0; padding: 9px; overflow: auto; color: var(--ink-soft); background: var(--surface); border-radius: 6px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; line-height: 1.5; white-space: pre-wrap; }
.analysis-history { margin-top: 13px; border: 1px solid var(--line); border-radius: 10px; }
.analysis-history-list { padding: 0 10px 10px; display: grid; gap: 5px; }
.analysis-history-list article { min-height: 48px; padding: 7px 8px; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 32px; align-items: center; gap: 8px; background: var(--surface-soft); border-radius: 7px; }
.analysis-history-list article > i { width: 27px; height: 27px; display: grid; place-items: center; color: var(--muted); background: var(--surface); border-radius: 7px; }
.analysis-history-list article > i.applied { color: var(--green); background: var(--green-soft); }
.analysis-history-list article > i .icon { width: 13px; }
.analysis-history-list strong, .analysis-history-list small { display: block; }
.analysis-history-list strong { font-size: 12px; }
.analysis-history-list small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.form-template-summary { margin-bottom: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.form-template-summary > div { min-height: 54px; padding: 10px; display: flex; align-items: center; gap: 9px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; }
.form-template-summary .icon { width: 16px; color: #9a610c; }
.form-template-summary small, .form-template-summary strong { display: block; }
.form-template-summary small { color: var(--muted); font-size: 12px; }
.form-template-summary strong { margin-top: 3px; font-size: 12px; }
.form-template-stack { min-width: 0; display: grid; gap: 3px; }
.form-template-stack b, .form-template-stack small { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-template-stack b { color: var(--ink-soft); font-weight: 600; }
.form-template-stack small { color: var(--muted); }
.activity { margin-top: 22px; }
.activity h3 { margin: 0 0 12px; font-size: 12px; }
.activity > div { min-height: 41px; display: grid; grid-template-columns: 11px 1fr; gap: 10px; }
.activity > div > i { width: 7px; height: 7px; margin-top: 3px; position: relative; background: var(--accent); border-radius: 50%; }
.activity > div > i::after { width: 1px; height: 31px; position: absolute; top: 8px; left: 3px; content: ""; background: var(--line); }
.activity > div:last-child > i::after { display: none; }
.activity strong, .activity small { display: block; }
.activity strong { font-size: 12px; }
.activity small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.survey-detail-list { display: grid; gap: 7px; }
.survey-detail-list > a { min-height: 57px; padding: 10px 13px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 9px; transition: border-color .15s, transform .15s; }
.survey-detail-list > a:hover { border-color: #d7a44e; transform: translateX(2px); }
.survey-detail-list strong, .survey-detail-list small { display: block; }
.survey-detail-list strong { font-size: 12px; }
.survey-detail-list small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.survey-detail-list .icon { width: 14px; color: var(--muted); }
.manual-upload { margin-top: 20px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.manual-upload form { margin-top: 13px; }
.manual-upload .btn { margin-top: 11px; }
.preview-modal { display: grid; place-items: center; background: #eee; }
.preview-modal img { max-width: 100%; max-height: 70vh; object-fit: contain; box-shadow: var(--shadow-sm); }
.error-log { max-height: 330px; margin: 0; padding: 15px; overflow: auto; color: #842a2a; background: #fff5f5; border: 1px solid #f2d2d2; border-radius: 9px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.inline-error { padding: 10px 12px; color: var(--red); background: var(--red-soft); border-radius: 8px; font-size: 12px; }

.toast-region { width: min(390px, calc(100vw - 24px)); position: fixed; z-index: 200; right: 18px; bottom: 18px; display: grid; gap: 8px; pointer-events: none; }
.toast { min-height: 63px; padding: 10px 10px 10px 12px; display: grid; grid-template-columns: 32px 1fr auto auto; align-items: center; gap: 9px; pointer-events: auto; color: #eee; background: #171717; border: 1px solid #2c2c2c; border-radius: 11px; box-shadow: 0 18px 55px rgb(0 0 0 / 23%); opacity: 0; transform: translateY(12px) scale(.98); transition: opacity .2s, transform .2s var(--ease); }
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast-icon { width: 30px; height: 30px; display: grid; place-items: center; color: #181108; background: var(--accent); border-radius: 8px; }
.toast-icon .icon { width: 15px; }
.toast-error .toast-icon { color: #fff; background: var(--red); }
.toast strong, .toast span { display: block; }
.toast strong { font-size: 12px; }
.toast span { margin-top: 3px; color: #8b8b8b; font-size: 12px; }
.toast > button { min-height: 30px; padding: 0 8px; color: var(--accent); background: transparent; border: 0; font-size: 12px; font-weight: 650; }
.toast .toast-close { width: 28px; padding: 0; display: grid; place-items: center; color: #777; }
.toast-close .icon { width: 14px; }

.skeleton-line, .skeleton-row i, .skeleton-row span, .skeleton-row b, .skeleton-card > * { display: block; background: linear-gradient(90deg, #eeeeec 20%, #f8f8f7 48%, #eeeeec 75%); background-size: 250% 100%; border-radius: 6px; animation: shimmer 1.35s infinite linear; }
.skeleton-line.tiny { width: 90px; height: 8px; }
.skeleton-line.title { width: 260px; height: 32px; margin-top: 12px; }
.skeleton-line.medium { width: 420px; max-width: 80vw; height: 11px; margin-top: 12px; }
.skeleton-line.wide { width: 180px; height: 14px; margin: 18px 20px 8px; }
.skeleton-line.short { width: 110px; height: 8px; margin: 0 20px 18px; }
.skeleton-row { min-height: 63px; padding: 12px 20px; display: grid; grid-template-columns: 38px 2fr 1fr 80px; align-items: center; gap: 13px; border-top: 1px solid var(--line); }
.skeleton-row i { width: 34px; height: 38px; }
.skeleton-row span { height: 10px; }
.skeleton-row b { height: 24px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.skeleton-card { height: 310px; padding: 17px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.skeleton-card i { height: 170px; margin: -17px -17px 20px; border-radius: 11px 11px 0 0; }
.skeleton-card b { width: 55%; height: 15px; }
.skeleton-card span { height: 9px; margin-top: 12px; }
.skeleton-card span:last-child { width: 74%; }

.settings-shell { display: grid; grid-template-columns: 225px minmax(0, 1fr); align-items: start; gap: 20px; }
.settings-nav { padding: 6px; position: sticky; top: 84px; display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.settings-nav button { min-height: 42px; padding: 0 10px; display: grid; grid-template-columns: 17px 1fr 13px; align-items: center; gap: 9px; color: var(--ink-soft); background: transparent; border: 0; border-radius: 8px; font-size: 14px; text-align: left; transition: color .14s, background .14s; }
.settings-nav button:hover { color: var(--ink); background: var(--surface-soft); }
.settings-nav button.active { color: var(--ink); background: var(--accent-soft); }
.settings-nav .icon { width: 15px; color: var(--muted); }
.settings-nav button.active > .icon:first-child { color: #a56508; }
.settings-chevron { width: 11px !important; }
.settings-content { min-width: 0; }
.settings-panel { overflow: visible; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.settings-panel-head { min-height: 91px; padding: 21px 23px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.settings-panel-head h2 { margin-top: 5px; font-size: 18px; }
.settings-panel-head p { max-width: 650px; line-height: 1.5; }
.settings-fields { padding: 22px 23px; display: grid; gap: 17px; }
.sticky-actions { min-height: 67px; padding: 12px 23px; position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; justify-content: flex-end; gap: 9px; background: rgb(250 250 249 / 94%); border-top: 1px solid var(--line); border-radius: 0 0 11px 11px; backdrop-filter: blur(12px); }
.sticky-actions > span { margin-right: auto; color: var(--muted); font-size: 12px; }
.knowledge-callout { margin: 18px 22px; padding: 15px; display: grid; grid-template-columns: 38px 1fr; gap: 12px; color: #704b0d; background: var(--accent-soft); border: 1px solid #f0dab5; border-radius: 10px; }
.knowledge-callout > div:first-child { width: 36px; height: 36px; display: grid; place-items: center; background: rgb(255 255 255 / 60%); border-radius: 8px; }
.knowledge-callout strong { font-size: 12px; }
.knowledge-callout p { margin: 5px 0 0; color: #8e6a31; font-size: 12px; line-height: 1.5; }
.access-label { padding: 5px 8px; display: inline-flex; color: #755011; background: var(--accent-soft); border: 1px solid #efd9b4; border-radius: 99px; font-size: 12px; font-weight: 650; }
.operation-name { display: flex; align-items: center; gap: 10px; }
.operation-glyph { width: 33px; height: 33px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 8px; }
.operation-glyph .icon { width: 15px; }
.operation-name strong, .operation-name small { display: block; }
.operation-name small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.operation-progress { min-width: 110px; display: flex; align-items: center; gap: 8px; }
.operation-progress > div { height: 4px; flex: 1; overflow: hidden; background: #e8e8e6; border-radius: 99px; }
.operation-progress i { height: 100%; display: block; background: var(--blue); }
.operation-progress span { color: var(--muted); font-size: 12px; }
.notification-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr); }
.notification-settings { padding: 14px 22px 24px; }
.notification-preview { padding: 21px; background: var(--surface-soft); border-left: 1px solid var(--line); }
.notification-preview h3 { margin: 0 0 13px; font-size: 12px; }
.notification-item { min-height: 52px; padding: 7px 0; display: grid; grid-template-columns: 31px 1fr; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); }
.notification-item > i { width: 30px; height: 30px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 8px; }
.notification-item > i.error { color: var(--red); background: var(--red-soft); }
.notification-item .icon { width: 14px; }
.notification-item strong, .notification-item small { display: block; }
.notification-item strong { font-size: 12px; }
.notification-item small { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.notification-empty { min-height: 210px; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.notification-empty p { font-size: 12px; }
.notification-drawer .empty-state { min-height: 240px; }
.integration-grid { padding: 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.integration-card { padding: 16px; }
.integration-card h3 { margin: 16px 0 5px; font-size: 14px; }
.integration-card > p { min-height: 32px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.integration-state { margin-top: 17px; padding-top: 13px; display: flex; align-items: center; justify-content: space-between; gap: 9px; border-top: 1px solid var(--line); }
.integration-state small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.profile-layout { display: grid; grid-template-columns: 280px minmax(0, 700px); align-items: start; gap: 18px; }
.profile-summary { padding: 28px; display: grid; justify-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-align: center; }
.profile-summary h2 { margin: 16px 0 4px; font-size: 18px; }
.profile-summary p { margin: 0 0 13px; color: var(--muted); font-size: 12px; }

.version-list { display: grid; gap: 0; }
.version-item { min-height: 92px; display: grid; grid-template-columns: 32px 1fr auto; gap: 11px; border-bottom: 1px solid var(--line); }
.version-item:last-child { border-bottom: 0; }
.version-marker { width: 27px; height: 27px; margin-top: 4px; display: grid; place-items: center; color: #82520d; background: var(--accent-soft); border-radius: 50%; font-size: 12px; font-weight: 700; }
.version-marker .icon { width: 13px; }
.version-title { display: flex; align-items: center; gap: 8px; }
.version-item p { margin: 6px 0; color: var(--ink-soft); font-size: 12px; }
.version-item small { color: var(--muted); font-size: 12px; }

.editor-shell { width: 100vw; height: 100vh; overflow: hidden; display: grid; grid-template-rows: 62px 1fr; background: #ececea; }
.editor-topbar { padding: 0 14px; z-index: 10; display: grid; grid-template-columns: minmax(250px, 1fr) auto minmax(250px, 1fr); align-items: center; gap: 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.editor-title { min-width: 0; display: flex; align-items: center; gap: 9px; }
.editor-title > div { min-width: 0; }
.editor-title strong, .editor-title span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-title strong { font-size: 12px; }
.editor-title span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.editor-toolbar { padding: 3px; display: flex; align-items: center; gap: 2px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 9px; }
.editor-toolbar .btn { min-height: 30px; width: 30px; }
.toolbar-divider { width: 1px; height: 18px; margin: 0 4px; background: var(--line); }
.zoom-label { min-width: 38px; color: var(--muted); font-size: 12px; text-align: center; }
.editor-actions { display: flex; justify-content: flex-end; gap: 7px; }
.editor-main { min-height: 0; display: grid; grid-template-columns: 176px minmax(0, 1fr) 265px; }
.slides-panel, .properties-panel { min-height: 0; overflow: auto; background: var(--surface); }
.slides-panel { border-right: 1px solid var(--line); }
.properties-panel { border-left: 1px solid var(--line); }
.editor-panel-head { height: 46px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); font-size: 12px; }
.editor-panel-head button { width: 27px; height: 27px; display: grid; place-items: center; color: var(--muted); background: transparent; border: 0; border-radius: 7px; }
.editor-panel-head button:hover { color: var(--ink); background: var(--surface-strong); }
.editor-panel-head .icon { width: 14px; }
.slide-list { padding: 10px; display: grid; gap: 10px; }
.slide-thumb { padding: 0; position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 5px; background: transparent; border: 0; text-align: left; }
.slide-thumb > span { color: var(--muted); font-size: 12px; text-align: center; }
.slide-thumb > div { aspect-ratio: var(--thumb-ratio, 16/9); position: relative; overflow: hidden; background-color: #f3f3f1; background-size: 100% 100%; background-position: center; background-repeat: no-repeat; border: 1px solid var(--line); border-radius: 5px; transition: border-color .15s, box-shadow .15s; }
.slide-thumb-synthetic { background: #fff; }
.slide-thumb-synthetic > i { position: absolute; display: block; overflow: hidden; font-style: normal; line-height: 1.1; white-space: pre-wrap; }
.slide-thumb.active > div { border-color: var(--accent); box-shadow: 0 0 0 2px rgb(250 162 27 / 18%); }
.slide-thumb small { padding: 4px; position: absolute; inset: auto 0 0; overflow: hidden; color: #fff; background: linear-gradient(transparent, rgb(0 0 0 / 65%)); font-size: 6px; text-overflow: ellipsis; white-space: nowrap; }
.canvas-workspace { min-width: 0; min-height: 0; position: relative; display: grid; grid-template-rows: 1fr 28px; overflow: hidden; background: radial-gradient(#cacac6 .7px, transparent .7px) 0 0/16px 16px, #ececea; }
.canvas-scroller { min-width: 0; min-height: 0; padding: 45px; overflow: auto; display: grid; place-items: start center; }
.design-canvas { width: calc(min(78vw, 920px) * var(--editor-zoom)); aspect-ratio: var(--canvas-ratio); position: relative; flex: 0 0 auto; overflow: hidden; background-color: #fff; background-size: 100% 100%; background-position: center; background-repeat: no-repeat; box-shadow: 0 14px 45px rgb(0 0 0 / 18%); transform-origin: center; user-select: none; }
.canvas-source-mask { position: absolute; z-index: 1; pointer-events: none; background: var(--source-mask-background, #fff); }
.canvas-element { padding: 0; position: absolute; z-index: 2; color: transparent !important; background: transparent !important; border: 0 !important; outline: 1px solid transparent; cursor: move; touch-action: none; transition: outline-color .12s, box-shadow .12s; }
.canvas-element > span { width: 1px; height: 1px; position: absolute; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.canvas-element:hover { outline-color: rgb(32 100 214 / 48%); outline-style: dashed; }
.canvas-element.selected { z-index: 3; outline: 2px solid var(--blue); outline-offset: 1px; box-shadow: 0 0 0 1px #fff; }
.canvas-element.selected::before { padding: 3px 6px; position: absolute; z-index: 2; left: -2px; bottom: calc(100% + 4px); content: attr(data-element-name); color: #fff; background: var(--blue); border-radius: 4px; font-size: 7px; line-height: 1; white-space: nowrap; }
.canvas-element.locked { cursor: default; }
.canvas-element.type-image { display: block; }
.design-canvas.rendered-preview .canvas-element:is(.selected, .modified):not(.type-image) { padding: 2px; display: flex; align-items: var(--element-vertical); color: var(--element-color) !important; background: var(--element-preview-background) !important; border: var(--element-border) !important; font-family: var(--element-font), Montserrat, Arial, sans-serif; font-size: var(--element-size); font-weight: var(--element-weight); font-style: var(--element-style); text-decoration: var(--element-decoration); text-align: var(--element-align); line-height: 1.14; }
.design-canvas.rendered-preview .canvas-element:is(.selected, .modified):not(.type-image) > span { width: 100%; height: auto; position: static; overflow: hidden; clip-path: none; white-space: pre-wrap; }
.design-canvas.synthetic-preview .canvas-element:not(.type-image) { padding: 2px; display: flex; align-items: var(--element-vertical); color: var(--element-color) !important; background: var(--element-background) !important; border: var(--element-border) !important; font-family: var(--element-font), Montserrat, Arial, sans-serif; font-size: var(--element-size); font-weight: var(--element-weight); font-style: var(--element-style); text-decoration: var(--element-decoration); text-align: var(--element-align); line-height: 1.14; }
.design-canvas.synthetic-preview .canvas-element > span { width: 100%; height: auto; position: static; overflow: hidden; clip-path: none; white-space: pre-wrap; }
.design-canvas.synthetic-preview .canvas-element.type-image { opacity: 0; }
.resize-handle { width: 9px; height: 9px; position: absolute; right: -5px; bottom: -5px; background: #fff; border: 2px solid var(--blue); border-radius: 50%; cursor: nwse-resize; }
.canvas-status { padding: 0 12px; display: flex; align-items: center; justify-content: space-between; color: #777; background: #e4e4e1; border-top: 1px solid #d7d7d3; font-size: 7px; }

.report-preview-body { padding: 0; overflow: hidden !important; }
.report-preview-viewer { height: min(680px, calc(100vh - 205px)); min-height: 420px; display: grid; grid-template-columns: 150px minmax(0, 1fr); background: #e9e9e6; }
.report-preview-slides { min-height: 0; padding: 12px; overflow-y: auto; display: grid; align-content: start; gap: 10px; background: var(--surface); border-right: 1px solid var(--line); }
.report-preview-slides button { padding: 3px; position: relative; background: transparent; border: 2px solid transparent; border-radius: 7px; cursor: pointer; transition: border-color .16s, background .16s; }
.report-preview-slides button.active { background: var(--accent-soft); border-color: var(--accent); }
.report-preview-slides button > span { position: absolute; z-index: 2; left: 7px; top: 6px; min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; color: #fff; background: rgb(15 15 15 / 72%); border-radius: 5px; font-size: 7px; }
.report-preview-slides img { width: 100%; aspect-ratio: 16 / 9; display: block; object-fit: contain; background: #fff; border-radius: 4px; }
.report-preview-stage { min-width: 0; min-height: 0; padding: 24px; position: relative; overflow: auto; display: grid; place-items: center; }
.report-preview-stage > img { max-width: 100%; max-height: 100%; display: block; object-fit: contain; background: #fff; box-shadow: 0 14px 42px rgb(0 0 0 / 16%); }
.report-preview-stage > span { padding: 5px 8px; position: absolute; right: 14px; bottom: 12px; color: #fff; background: rgb(0 0 0 / 62%); border-radius: 6px; font-size: 12px; }
.report-preview-prev .icon { transform: rotate(180deg); }
.editor-inspector-tabs { height: 46px; padding: 0 10px; display: flex; align-items: flex-end; gap: 14px; border-bottom: 1px solid var(--line); }
.editor-inspector-tabs button { height: 36px; padding: 0; position: relative; color: var(--muted); background: transparent; border: 0; font-size: 12px; font-weight: 650; }
.editor-inspector-tabs button.active { color: var(--ink); }
.editor-inspector-tabs button.active::after { height: 2px; position: absolute; inset: auto 0 0; content: ""; background: var(--accent); }
#properties-content, #layers-content { padding: 14px; }
.properties-empty { min-height: 280px; display: grid; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.properties-empty .icon { width: 24px; }
.properties-empty h3 { margin: 11px 0 5px; color: var(--ink-soft); font-size: 12px; }
.properties-empty p { max-width: 190px; margin: 0; font-size: 12px; line-height: 1.5; }
.properties-form { display: grid; gap: 14px; }
.property-head { display: flex; justify-content: space-between; gap: 10px; }
.property-head span, .property-head strong { display: block; }
.property-head span { color: var(--muted); font-size: 12px; }
.property-head strong { margin-top: 4px; font-size: 12px; }
.property-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.property-grid label { display: grid; gap: 5px; }
.property-grid .field, .property-grid .select { min-height: 36px; font-size: 12px; }
.color-field { width: 100%; height: 36px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.layer-actions { display: flex; gap: 6px; }
.layers-list { margin-top: 12px; display: grid; gap: 3px; }
.layer-row { min-height: 34px; padding: 0 8px; display: grid; grid-template-columns: 15px 1fr 14px; align-items: center; gap: 7px; color: var(--ink-soft); background: transparent; border: 0; border-radius: 7px; font-size: 14px; text-align: left; }
.layer-row:hover, .layer-row.active { color: var(--ink); background: var(--accent-soft); }
.layer-row .icon { width: 13px; color: var(--muted); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -250% 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes menuIn { from { opacity: 0; transform: translateY(-3px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 1180px) {
  .page { padding-inline: 26px; }
  .template-grid, .form-grid, .certificate-template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .integration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-main { grid-template-columns: 150px minmax(0, 1fr) 240px; }
  .editor-topbar { grid-template-columns: minmax(200px, 1fr) auto auto; }
  .editor-actions .btn:not(.btn-primary) { width: 38px; padding: 0; font-size: 0; }
  .editor-actions .btn .icon { width: 17px; }
}

@media (max-width: 900px) {
  .app-shell, .sidebar-collapsed { grid-template-columns: 1fr; }
  .sidebar, .sidebar-collapsed .sidebar { width: min(288px, 86vw); transform: translateX(-104%); box-shadow: none; }
  .sidebar.mobile-open { transform: translateX(0); box-shadow: 20px 0 60px rgb(0 0 0 / 18%); }
  .brand-row, .sidebar-collapsed .brand-row { grid-template-columns: 1fr; gap: 0; }
  .sidebar-collapsed .brand { width: 150px; padding: 5px 8px; }
  .sidebar-collapsed .brand-wordmark { opacity: 1; transform: translateX(0); }
  .sidebar-collapsed .brand-mark { opacity: 0; transform: translateX(-8px) scale(.88); }
  .sidebar-collapsed .nav-label { max-height: 14px; margin: 23px 10px 8px; opacity: 1; transform: none; }
  .sidebar-collapsed .nav-text, .sidebar-collapsed .user-meta { max-width: 160px; opacity: 1; transform: none; }
  .sidebar-collapsed .menu-chevron { max-width: 13px; opacity: 1; }
  .sidebar-collapsed .nav-item { padding: 0 11px; gap: 11px; }
  .sidebar-collapsed .user-menu > summary { padding: 10px 9px; grid-template-columns: 34px minmax(0, 1fr) 13px; gap: 9px; }
  .sidebar-collapse { display: none; }
  .main { grid-column: 1; }
  .mobile-menu { display: inline-flex !important; }
  .mobile-scrim { display: block; position: fixed; inset: 0; z-index: 29; visibility: hidden; pointer-events: none; background: rgb(0 0 0 / 38%); opacity: 0; transition: opacity .25s var(--ease), visibility 0s linear .25s; }
  .mobile-scrim.visible { visibility: visible; pointer-events: auto; opacity: 1; transition: opacity .25s var(--ease); }
  .topbar { padding: 0 20px; }
  .page { padding: 30px 22px 60px; }
  .settings-shell { grid-template-columns: 1fr; }
  .settings-nav { padding: 3px; position: static; display: flex; overflow-x: auto; }
  .settings-nav button { min-width: max-content; grid-template-columns: 16px auto; }
  .settings-chevron { display: none; }
  .notification-layout { grid-template-columns: 1fr; }
  .notification-preview { border-top: 1px solid var(--line); border-left: 0; }
  .analysis-workbench { grid-template-columns: 1fr; }
  .analysis-current > .analysis-document, .analysis-draft > .ai-preview-panel { max-height: none; }
  .profile-layout { grid-template-columns: 1fr; }
  .profile-summary { display: grid; grid-template-columns: 64px 1fr auto; justify-items: start; text-align: left; }
  .profile-summary .avatar { grid-row: 1 / 4; }
  .profile-summary h2 { margin: 6px 0 3px; }
  .profile-summary p { margin: 0; }
  .profile-summary .access-label { grid-column: 3; grid-row: 1 / 3; align-self: center; }
  .editor-topbar { grid-template-columns: 1fr auto; }
  .editor-toolbar { display: none; }
  .editor-main { grid-template-columns: 120px minmax(0, 1fr); }
  .properties-panel { width: 280px; position: fixed; z-index: 20; inset: 62px 0 0 auto; box-shadow: -12px 0 35px rgb(0 0 0 / 12%); transform: translateX(calc(100% - 38px)); transition: transform .2s var(--ease); }
  .properties-panel:hover, .properties-panel:focus-within { transform: translateX(0); }
  .canvas-scroller { padding: 25px; }
}

@media (max-width: 700px) {
  .topbar { height: 58px; padding: 0 13px; }
  .topbar-title strong { display: none; }
  .topbar-create span { display: none; }
  .topbar-create { width: 38px; padding: 0; }
  .page { padding: 23px 14px 50px; }
  .page-heading { margin-bottom: 22px; align-items: flex-start; flex-direction: column; }
  .page-heading h1 { font-size: 29px; }
  .page-heading p { font-size: 12px; }
  .page-actions { width: 100%; }
  .page-actions > .btn, .page-actions > .split-button { flex: 1; }
  .page-actions > .btn { width: 100%; }
  .split-button > .btn:first-child { flex: 1; }
  .metrics-grid, .template-grid, .form-grid, .certificate-template-grid, .integration-grid, .skeleton-grid { grid-template-columns: 1fr; }
  .metrics-grid { gap: 8px; }
  .metric-card { min-height: 111px; padding: 16px; display: grid; grid-template-columns: 36px 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 10px; }
  .metric-icon { margin: 0; grid-row: 1 / 3; }
  .metric-card > strong { margin: 0; grid-column: 3; grid-row: 1 / 3; font-size: 27px; }
  .metric-card > small { margin: 2px 0 0; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .toolbar-filters { justify-content: space-between; }
  .select-compact { flex: 1; }
  .panel-flush { background: transparent; border: 0; box-shadow: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table thead { display: none; }
  .data-table tbody { display: grid; gap: 9px; }
  .data-table tr { padding: 14px; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
  .data-table tbody tr:hover { background: var(--surface); }
  .data-table td, .data-table td:first-child { min-height: 0; padding: 6px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 0; text-align: right; }
  .data-table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 650; text-transform: none; }
  .data-table td:first-child { padding: 0 40px 10px 0; justify-content: flex-start; text-align: left; border-bottom: 1px solid var(--line); }
  .data-table td:first-child::before, .data-table .action-cell::before { display: none; }
  .data-table .action-cell { width: auto; padding: 0; position: absolute; top: 10px; right: 9px; }
  .name-cell strong { max-width: 210px; }
  .status-stack { justify-content: flex-end; }
  .mobile-only { margin-left: 8px; display: inline; color: var(--muted); font-size: 12px; }
  .row-progress { display: none; }
  .data-table .empty-state { min-height: 280px; }
  .data-table tr:has(.empty-state) { padding: 0; }
  .source-file-grid, .form-row, .template-file-editor, .layout-grid, .detail-grid { grid-template-columns: 1fr; }
  .form-template-summary { grid-template-columns: 1fr; }
  .dialog-backdrop { padding: 0; place-items: end center; }
  .dialog { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; transform: translateY(30px); }
  .dialog-head, .dialog-body, .dialog-footer { padding-inline: 16px; }
  .dialog-footer { align-items: stretch; flex-direction: column; }
  .dialog-footer > .button-row, .dialog-footer > .btn { width: 100%; }
  .dialog-footer .button-row .btn { flex: 1; }
  .report-preview-viewer { height: calc(92vh - 188px); min-height: 360px; grid-template-columns: 1fr; grid-template-rows: 78px minmax(0, 1fr); }
  .report-preview-slides { padding: 7px; overflow-x: auto; overflow-y: hidden; display: flex; border-right: 0; border-bottom: 1px solid var(--line); }
  .report-preview-slides button { width: 112px; min-width: 112px; }
  .report-preview-stage { padding: 12px; }
  .toast-region { right: 12px; bottom: 12px; }
  .toast { grid-template-columns: 32px 1fr auto; }
  .toast > button:not(.toast-close) { grid-column: 2; justify-self: start; padding: 0; }
  .toast-close { grid-column: 3; grid-row: 1; }
  .settings-page .page-heading { margin-bottom: 15px; }
  .settings-panel-head { padding: 17px; align-items: stretch; flex-direction: column; }
  .settings-panel-head .btn { width: 100%; }
  .prompt-template-content { padding: 14px; }
  .prompt-template-grid { grid-template-columns: 1fr; }
  .compact-callout { grid-template-columns: 28px minmax(0, 1fr); }
  .compact-callout .btn { width: auto; grid-column: 2; justify-self: start; }
  .settings-fields { padding: 17px; }
  .knowledge-callout { margin: 14px; }
  .sticky-actions { padding: 11px 15px; }
  .analysis-history-list article { grid-template-columns: 28px minmax(0, 1fr) auto; }
  .analysis-history-list article > .action-menu { grid-column: 3; }
  .section-tabs-row { align-items: stretch; flex-direction: column; }
  .tabs { width: 100%; }
  .tab { flex: 1; justify-content: center; }
  .editor-shell { grid-template-rows: 58px 1fr; }
  .editor-topbar { padding: 0 8px; }
  .editor-title strong { max-width: 130px; }
  .editor-actions .btn:not(.btn-primary) { display: none; }
  .editor-actions .btn-primary { min-height: 36px; padding: 0 10px; font-size: 12px; }
  .editor-main { grid-template-columns: 1fr; }
  .slides-panel { height: 87px; position: fixed; z-index: 15; inset: auto 0 0; overflow-x: auto; border-top: 1px solid var(--line); border-right: 0; }
  .editor-panel-head { display: none; }
  .slide-list { padding: 7px; display: flex; gap: 8px; }
  .slide-thumb { min-width: 110px; grid-template-columns: 15px 1fr; }
  .canvas-workspace { padding-bottom: 87px; }
  .canvas-scroller { padding: 20px 30px; }
  .design-canvas { width: calc(100vw * var(--editor-zoom)); min-width: 330px; }
  .properties-panel { inset: 58px 0 87px auto; }
  .auth-shell {
    background:
      radial-gradient(390px 520px at 110% 7%, rgb(250 162 27 / 13%), transparent 58%),
      radial-gradient(420px 480px at -15% 90%, rgb(250 162 27 / 8%), transparent 61%),
      #0d0d0c;
  }
  .auth-shell::after { height: 2px; position: absolute; z-index: 0; top: 218px; right: 0; left: 0; display: block; content: ""; background: linear-gradient(90deg, #d88408, #faa21b 50%, #d88408); box-shadow: 0 0 16px rgb(250 162 27 / 22%); }
  .auth-logo { width: 146px; top: 25px; left: 24px; }
  .auth-form-wrap { min-height: 100vh; min-height: 100svh; padding: 119px 20px 42px; place-items: start center; }
  .auth-card { width: min(350px, 100%); padding: 35px 26px 30px; border-radius: 19px; }
  .auth-card h1 { font-size: 28px; line-height: 1.15; }
  .auth-card > p { margin: 7px 0 25px; font-size: 14px; line-height: 1.5; }
  .auth-card .form-group { gap: 7px; }
  .auth-card .form-group:last-of-type { margin-bottom: 25px; }
  .auth-card .field { min-height: 53px; }
  .password-field button { height: 45px; }
  .auth-help { margin-top: 25px; }
}

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

/* BetterLife working surfaces: restrained color, readable labels, no decorative lift. */
.eyebrow { display: none; }
.page-heading { margin-bottom: 24px; }
.page-heading h1 { margin: 0; line-height: 1.2; font-weight: 600; }
.page-heading p { margin-top: 8px; font-size: 14px; }
.panel-head h3 { font-size: 16px; font-weight: 600; }
.btn, .btn-primary { box-shadow: none; }
.btn:hover:not(:disabled), .btn-primary:hover:not(:disabled) { transform: none; box-shadow: none; }
.btn:active:not(:disabled) { transform: none; }
.metric-card:hover, .template-card:hover, .certificate-template-card:hover, .form-card:hover, .integration-card:hover { transform: none; box-shadow: none; }
.nav-item:hover { transform: none; }
.nav-label { font-size: 12px; letter-spacing: 0; color: #969ea9; }
.nav-item { color: #b1b8c2; border-radius: 5px; }
.nav-item.active { background: #2a3039; }
.nav-item:hover, .user-menu > summary:hover { background: #242a32; }
.user-meta small { color: #a0a8b4; }
.topbar-title strong { font-weight: 500; color: var(--ink-soft); }
.brand { width: 166px; }
.brand-wordmark { width: 145px; max-height: 41px; }
.metrics-grid { gap: 0; padding: 20px 0; margin-bottom: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.metric-card { min-height: 112px; padding: 0 24px; background: transparent; border: 0; border-right: 1px solid var(--line); border-radius: 0; }
.metric-card:last-child { border-right: 0; }
.metric-card > span { font-size: 14px; }
.metric-card > strong { margin-top: 12px; font-size: 32px; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric-card > small { margin-top: 8px; }
.name-cell strong { font-size: 14px; font-weight: 600; }
.data-table th { font-size: 12px; font-weight: 600; }
.data-table td { padding-block: 16px; }
.data-table { font-variant-numeric: tabular-nums; }
.badge { min-height: 26px; border-radius: 5px; font-size: 12px; font-weight: 500; }
.mini-tag { color: var(--ink-soft); background: var(--surface-strong); font-size: 12px; font-weight: 500; }
.file-mark, .file-mark-soft { color: var(--ink-soft); background: var(--surface-soft); border-color: var(--line); }
.service-icon, .operation-glyph, .toast-icon { color: var(--ink-soft); background: var(--surface-strong); border-radius: 6px; }
.toast-icon { color: #e5e9ef; background: #303640; }
.toast-error .toast-icon { color: #fff; background: var(--red); }
.card-title-row h3, .form-card h3 { font-size: 16px; font-weight: 600; }
.form-card > p { min-height: auto; font-size: 14px; }
.field, .select, .search-field input { font-size: 14px; }
.form-group label, .switch-copy strong, .source-file strong { font-size: 14px; }
.dialog-head h2 { margin: 0; font-size: 22px; font-weight: 600; }
.dialog-head p { margin-top: 8px; font-size: 14px; }
.dialog-footer { background: var(--surface); }
.settings-nav { padding: 0; background: transparent; border: 0; }
.settings-nav button { min-height: 44px; font-size: 14px; }
.settings-nav button.active { background: #e9edf2; }
.settings-panel-head h2 { margin-top: 0; font-weight: 600; }
.settings-panel-head p { font-size: 14px; }
.knowledge-callout, .analysis-files-box { color: var(--ink); background: var(--surface-soft); border-color: var(--line); }
.knowledge-callout p { color: var(--ink-soft); }
.auth-shell { background: #1b1f26; }
.auth-shell::after { display: none; }
.auth-card { border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 12px 36px rgb(0 0 0 / 12%); animation: none; }
.auth-card h1 { font-size: 28px; font-weight: 600; }
.auth-card .form-group label, .auth-card .field { font-size: 14px; }
.auth-card .field, .auth-card .btn { border-radius: 6px; min-height: 48px; }
.auth-card .btn-primary:hover:not(:disabled) { box-shadow: none; }
.auth-help { color: var(--muted); }
@media (max-width: 900px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; }
  .metric-card:nth-child(2) { border-right: 0; }
}
@media (max-width: 600px) {
  .metric-card { min-height: 110px; display: flex; padding: 0 16px; }
  .metric-card > strong { margin-top: 10px; }
  .metric-card > small { margin-top: 6px; }
  .name-cell strong { max-width: 200px; }
  .auth-shell { background: #1b1f26; }
  .auth-shell::after { display: none; }
  .auth-card { border-radius: 10px; }
  .page-heading .btn { white-space: normal; }
}

.compact-callout { background: var(--surface-soft); border-color: var(--line); }
.data-table td[data-label="Компания"] > strong { font-weight: 400; }
.form-row + .form-row, .form-section > .form-group + .form-group { margin-top: 16px; }
.field::file-selector-button { padding: 6px 10px; margin-right: 10px; color: var(--ink); background: var(--surface-strong); border: 0; border-radius: 4px; font: inherit; }
