:root {
  color-scheme: light;
  --wine: #63082e;
  --wine-deep: #43051f;
  --wine-soft: #7d3150;
  --gold: #c49a50;
  --gold-pale: #f3ead8;
  --paper: #f7f5f0;
  --surface: #fffefa;
  --surface-pink: #f7edf0;
  --ink: #282429;
  --muted: #746e71;
  --line: #e8e1de;
  --sage: #56745f;
  --sage-pale: #edf4ee;
  --red: #a33b43;
  --shadow: 0 12px 32px rgb(52 25 37 / 5%);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); color: var(--ink); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 3; display: flex; width: 258px; flex-direction: column; padding: 22px 16px 16px; overflow-y: auto; background: var(--wine-deep); color: #fffaf5; }
.brand { display: flex; min-height: 78px; align-items: center; gap: 14px; padding: 3px 8px 16px; color: inherit; text-decoration: none; }
.crest { display: block; width: 54px; height: 58px; flex: none; object-fit: contain; }
.brand-copy { display: grid; gap: 5px; letter-spacing: .12em; }
.brand-copy strong { font-family: Georgia, serif; font-size: 13px; letter-spacing: .16em; }
.brand-copy small { color: #c49a50; font-size: 9px; font-weight: 700; letter-spacing: .13em; }
.nav-label { padding: 17px 11px 8px; color: #d9b7c5; font-size: 9px; font-weight: 700; letter-spacing: .16em; }
.nav-label-spaced { padding-top: 21px; }
.nav-list { display: grid; gap: 4px; }
.nav-item { display: flex; min-height: 42px; align-items: center; gap: 12px; width: 100%; padding: 0 12px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #f9eff3; text-align: left; transition: background .16s ease, color .16s ease; }
.nav-item:hover { background: rgb(255 255 255 / 8%); color: white; }
.nav-item.active { border-color: rgb(255 255 255 / 13%); background: #fffaf5; color: var(--wine-deep); box-shadow: inset 3px 0 var(--gold); }
.nav-icon { display: inline-grid; width: 19px; place-items: center; color: #d9bf8b; font-size: 17px; }
.nav-item.active .nav-icon { color: var(--wine); }
.sidebar-bottom { margin-top: auto; padding-top: 22px; }
.workspace-label { display: grid; gap: 6px; margin: 0 2px 14px; padding: 13px 11px; border-top: 1px solid rgb(255 255 255 / 17%); border-bottom: 1px solid rgb(255 255 255 / 17%); }
.workspace-label span, .workspace-label small { color: #d9b7c5; font-size: 8px; letter-spacing: .12em; }
.workspace-label strong { color: #ead7ae; font-family: Georgia, serif; font-size: 12px; letter-spacing: .08em; }
.legal-link { min-height: 32px; padding-left: 11px; font-size: 11px; }
.user-chip { display: flex; align-items: center; gap: 9px; margin-top: 12px; padding: 13px 4px 3px; border-top: 1px solid rgb(255 255 255 / 17%); }
.user-avatar { display: grid; width: 32px; height: 32px; flex: none; place-items: center; border: 1px solid rgb(255 255 255 / 40%); border-radius: 50%; color: #f6e8c2; font-family: Georgia, serif; }
.user-chip > span:nth-child(2) { display: grid; min-width: 0; gap: 3px; }
.user-chip strong { overflow: hidden; color: white; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.user-chip small { color: #dfc8d1; font-size: 9px; }
.text-button { margin-left: auto; padding: 4px 0 4px 5px; border: 0; background: transparent; color: #f6e8c2; font-size: 10px; }
.main-area { display: flex; min-height: 100vh; flex: 1; flex-direction: column; margin-left: 258px; }
.topbar { position: sticky; top: 0; z-index: 2; display: flex; min-height: 66px; align-items: center; justify-content: space-between; gap: 16px; padding: 0 38px; border-bottom: 1px solid var(--line); background: rgb(255 254 250 / 94%); backdrop-filter: blur(12px); }
.breadcrumb { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.breadcrumb strong { color: var(--wine); font-size: 12px; letter-spacing: 0; }
.crumb-slash { color: #c9b8bf; }
.top-actions { display: flex; align-items: center; gap: 17px; }
.sync-indicator { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 3px var(--sage-pale); }
.sync-indicator.pending .status-dot { background: var(--gold); box-shadow: 0 0 0 3px var(--gold-pale); }
.sync-indicator.error .status-dot { background: var(--red); box-shadow: 0 0 0 3px #f8eaeb; }
.date-label { color: var(--muted); font-size: 10px; }
.content-area { width: min(1320px, 100%); flex: 1; margin: 0 auto; padding: 34px 38px 42px; }
.app-footer { display: flex; justify-content: space-between; gap: 12px; padding: 14px 38px; border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 9px; letter-spacing: .05em; }
.footer-link { padding: 0; border: 0; background: transparent; color: var(--wine); font-size: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.print-header { display: none; }
.page-heading h1 { margin: 7px 0 0; color: var(--wine-deep); font: 700 clamp(25px, 2.2vw, 34px)/1.16 Georgia, "Times New Roman", serif; letter-spacing: -.025em; }
.page-heading p { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.eyebrow { color: var(--wine-soft); font-size: 9px; font-weight: 700; letter-spacing: .15em; }
.button { display: inline-flex; min-height: 39px; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 7px; font-size: 11px; font-weight: 650; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.button[hidden] { display: none; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button-primary { border-color: var(--wine); background: var(--wine); color: #fffaf5; }
.button-primary:hover { border-color: var(--wine-deep); background: var(--wine-deep); }
.button-secondary { border-color: var(--line); background: var(--surface); color: var(--wine); }
.button-secondary:hover, .button-quiet:hover { border-color: #d7bec9; background: var(--surface-pink); }
.button-quiet { border-color: var(--line); background: var(--surface); color: var(--ink); }
.button-danger { border-color: #e6c6ca; background: #fff8f8; color: var(--red); }
.button-small { min-height: 30px; padding: 0 10px; font-size: 10px; }
.button:disabled { cursor: not-allowed; opacity: .48; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 19px; }
.stat-card, .panel { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.stat-card { position: relative; min-height: 128px; padding: 20px 19px; overflow: hidden; }
.stat-card:before { position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: var(--wine); content: ""; }
.stat-card:nth-child(2):before { background: #b68a3a; }
.stat-card:nth-child(3):before { background: #8d6a80; }
.stat-card:nth-child(4):before { background: #6d8b72; }
.stat-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .09em; }
.stat-number { margin-top: 17px; color: var(--wine-deep); font: 700 31px Georgia, serif; }
.stat-note { margin-top: 5px; color: var(--muted); font-size: 9px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(270px, .85fr); gap: 16px; }
.quick-actions-panel { margin-bottom: 17px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 19px; }
.panel { overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; color: var(--wine-deep); font-family: Georgia, serif; font-size: 14px; font-weight: 700; }
.panel-header p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.panel-body { padding: 18px 20px; }
.stream-list { display: grid; gap: 15px; }
.stream-row { display: grid; grid-template-columns: 110px minmax(50px, 1fr) 42px; align-items: center; gap: 12px; }
.stream-name { color: var(--ink); font-size: 10px; }
.bar-track { height: 7px; overflow: hidden; border-radius: 8px; background: #f1e9e9; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--wine-soft); transition: width .25s ease; }
.stream-row:nth-child(even) .bar-fill { background: var(--gold); }
.stream-count { color: var(--muted); font-size: 10px; text-align: right; }
.panel-empty { display: grid; min-height: 164px; place-content: center; justify-items: center; padding: 18px; text-align: center; }
.empty-mark { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid #e4d6dc; border-radius: 50%; background: var(--surface-pink); color: var(--wine); font: 17px Georgia, serif; }
.panel-empty strong { margin-top: 12px; color: var(--ink); font-size: 11px; }
.panel-empty p { max-width: 280px; margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.quick-panel { margin-top: 17px; }
.inventory-header { align-items: flex-start; }
.inventory-toolbar { display: flex; flex: 1; align-items: center; justify-content: flex-end; gap: 10px; }
.inventory-toolbar > .toolbar { flex: 1; justify-content: flex-end; }
.inventory-views { flex: none; }
.book-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 17px; }
.book-card { display: flex; min-width: 0; flex-direction: column; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fffdfa; }
.book-cover, .book-cover-placeholder { width: 100%; height: 164px; border-radius: 7px; object-fit: cover; }
.book-cover-placeholder { display: grid; place-items: center; background: linear-gradient(140deg, #f8edf0, #f5ecd9); color: #9c7788; font: 700 11px Georgia, serif; letter-spacing: .19em; }
.book-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.book-subject { color: var(--wine-soft); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.book-card h3 { margin: 0; color: var(--ink); font-family: Georgia, serif; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.book-card > .code-text { margin: 0; }
.book-description { margin: -4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.book-card dl { display: grid; gap: 8px; margin: 0; }
.book-card dl > div { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.book-card dt, .book-card dd { margin: 0; font-size: 10px; }
.book-card dt { color: var(--muted); }
.book-card dd { text-align: right; }
.book-card > .footer-link { align-self: flex-start; }
.quick-entry { display: grid; grid-template-columns: minmax(180px, 1fr) auto; align-items: end; gap: 12px; }
.circulation-entry { grid-template-columns: minmax(150px, .9fr) minmax(180px, 1.1fr) minmax(145px, .7fr) auto; }
.field { display: grid; gap: 7px; }
.field > span { color: var(--ink); font-size: 10px; font-weight: 650; }
.field > span small { color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea, .search-input { width: 100%; min-height: 39px; padding: 0 11px; border: 1px solid #ded5d2; border-radius: 6px; background: #fffefa; color: var(--ink); font-size: 11px; }
.field textarea { min-height: 74px; padding: 10px 11px; resize: vertical; }
.field input[type="file"] { padding: 8px; }
.field input::placeholder, .field textarea::placeholder, .search-input::placeholder { color: #a69b9e; }
.inline-hint { margin: 10px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.toolbar { display: flex; align-items: center; gap: 9px; }
.search-wrap { min-width: 190px; flex: 1; }
.search-input { min-height: 37px; }
.filter-select { width: auto; min-width: 130px; min-height: 37px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 10px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th { padding: 12px 15px; background: #faf6f4; color: #81757b; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
td { padding: 12px 15px; border-top: 1px solid #f0eae7; color: var(--ink); font-size: 10px; }
td strong { color: var(--wine-deep); font-size: 10px; font-weight: 650; }
td small { color: var(--muted); font-size: 9px; }
.code-text { color: var(--wine-soft); font-family: ui-monospace, Consolas, monospace; font-size: 10px; }
.status-tag { display: inline-flex; min-height: 22px; align-items: center; padding: 0 8px; border: 1px solid #e6dfdc; border-radius: 20px; background: #f8f5f2; color: #665c61; font-size: 9px; }
.status-tag.good { border-color: #d7e5d8; background: var(--sage-pale); color: #47664e; }
.status-tag.warn { border-color: #f0dfb8; background: var(--gold-pale); color: #80621e; }
.status-tag.danger { border-color: #eed1d3; background: #fbefef; color: #963b43; }
.table-empty { padding: 37px 18px; color: var(--muted); font-size: 11px; text-align: center; white-space: normal; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 15px; }
.house-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.house-card { padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fffdfa; }
.house-card strong { color: var(--wine); font: 700 18px Georgia, serif; }
.house-card span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.report-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.segmented { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: #f7f2ef; }
.segment-button { min-height: 29px; padding: 0 11px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 10px; }
.segment-button.active { background: var(--wine); color: white; box-shadow: 0 2px 5px rgb(73 7 31 / 14%); }
.textbook-allocations-panel { margin-top: 17px; }
.shop-item-cell { display: flex; align-items: center; gap: 9px; min-width: 220px; white-space: normal; }
.shop-item-cell > span { display: grid; gap: 4px; }
.shop-item-cell small { display: -webkit-box; max-width: 330px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.shop-thumb { width: 37px; height: 43px; border-radius: 4px; object-fit: cover; }
.row-actions { display: flex; align-items: center; gap: 10px; }
.dialog { width: min(510px, calc(100% - 28px)); max-height: min(88vh, 780px); padding: 0; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 24px 70px rgb(41 20 30 / 18%); color: var(--ink); }
.dialog::backdrop { background: rgb(35 17 26 / 45%); backdrop-filter: blur(2px); }
.dialog > form, .legal-dialog { padding: 25px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 19px; }
.dialog-head h2 { margin: 7px 0 0; color: var(--wine-deep); font: 700 21px Georgia, serif; }
.auth-identity { display: flex; align-items: center; gap: 13px; }
.auth-crest { width: 54px; height: 54px; object-fit: contain; }
.icon-button { display: grid; width: 32px; height: 32px; flex: none; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); font-size: 20px; line-height: 1; }
.form-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-fields .field:first-child, .form-fields .field.full { grid-column: 1 / -1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 21px; }
.legal-dialog { max-width: 650px; }
.legal-dialog .dialog-head { margin-bottom: 14px; }
.legal-content { color: var(--ink); font-size: 12px; line-height: 1.75; }
.legal-content h3 { margin: 18px 0 4px; color: var(--wine); font-family: Georgia, serif; font-size: 13px; }
.legal-content p { margin: 7px 0; }
.legal-content ul { padding-left: 19px; }
.auth-dialog { max-width: 460px; }
.form-note { margin: -5px 0 17px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.auth-dialog .field { margin-top: 12px; }
.auth-dialog input.auth-input-invalid {
  border-color: #d93025 !important;
  background: #fff8f7;
  box-shadow: 0 0 0 1px #d93025;
}
.auth-dialog input.auth-input-invalid:focus {
  border-color: #d93025 !important;
  box-shadow: 0 0 0 2px rgb(217 48 37 / 15%);
}
.auth-form-reject { animation: auth-reject-shake 260ms ease-in-out; }
.form-error { min-height: 18px; margin: 10px 0 0; color: #d93025; font-size: 11px; line-height: 1.45; }
@keyframes auth-reject-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 5; display: grid; gap: 8px; }
.toast { max-width: min(390px, calc(100vw - 40px)); padding: 12px 15px; border: 1px solid var(--line); border-left: 3px solid var(--wine); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); font-size: 11px; }
.toast.error { border-color: #eed1d3; border-left-color: var(--red); color: var(--red); }
.mobile-menu { display: none; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media (max-width: 1050px) {
  .sidebar { width: 230px; }
  .main-area { margin-left: 230px; }
  .content-area { padding-right: 25px; padding-left: 25px; }
  .topbar { padding: 0 25px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: 1fr; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .sidebar { position: static; width: 100%; padding: 10px 14px 8px; overflow: visible; }
  .app-shell { display: block; }
  .brand { min-height: 53px; padding: 0 2px 8px; }
  .crest { width: 39px; height: 43px; }
  .brand-copy { gap: 3px; }
  .brand-copy strong { font-size: 11px; }
  .brand-copy small { font-size: 8px; }
  .nav-label, .sidebar-bottom { display: none; }
  .nav-label-spaced { display: none; }
  .nav-list { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 2px; scrollbar-width: thin; }
  .nav-list + .nav-list { margin-top: 3px; }
  .nav-item { width: auto; min-height: 34px; flex: none; gap: 6px; padding: 0 9px; border-radius: 6px; font-size: 10px; }
  .nav-icon { width: auto; font-size: 13px; }
  .main-area { min-height: calc(100vh - 102px); margin-left: 0; }
  .topbar { min-height: 48px; padding: 0 16px; }
  .breadcrumb > span:first-child, .crumb-slash { display: none; }
  .breadcrumb strong { font-size: 11px; }
  .top-actions { gap: 10px; }
  .date-label { display: none; }
  .content-area { padding: 22px 15px 27px; }
  .app-footer { padding: 12px 15px; font-size: 8px; }
  .page-heading { align-items: flex-start; margin-bottom: 18px; }
  .page-heading h1 { font-size: 25px; }
  .page-heading p { max-width: 310px; line-height: 1.5; }
  .page-heading .button { min-height: 35px; padding: 0 10px; font-size: 10px; }
  .stats-grid { gap: 10px; }
  .stat-card { min-height: 105px; padding: 14px; }
  .stat-number { margin-top: 12px; font-size: 25px; }
  .quick-entry { grid-template-columns: 1fr; }
  .quick-entry .button { width: 100%; }
  .toolbar { flex-wrap: wrap; }
  .search-wrap { flex-basis: 100%; }
  .filter-select { flex: 1; }
  .inventory-header { display: grid; }
  .inventory-toolbar, .inventory-toolbar > .toolbar { width: 100%; flex-direction: column; align-items: stretch; }
  .inventory-views { align-self: flex-start; }
  .book-grid { grid-template-columns: 1fr; padding: 12px; }
  .book-cover, .book-cover-placeholder { height: 190px; }
  .quick-actions { padding: 12px 14px; }
  .house-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-header { padding: 14px; }
  .panel-body { padding: 14px; }
  .stream-row { grid-template-columns: 92px 1fr 32px; gap: 8px; }
  .form-fields { grid-template-columns: 1fr; }
  .form-fields .field { grid-column: 1 / -1; }
  .dialog > form, .legal-dialog { padding: 20px; }
  .app-footer span:last-child { text-align: right; }
}
@media (max-width: 360px) {
  .topbar { gap: 8px; }
  .top-actions { gap: 0; }
  .top-actions .button, .sync-indicator > span:last-child { display: none; }
  .stat-card { padding: 11px; }
}
@media print {
  body { background: white; color: #282429; }
  .sidebar, .topbar, .app-footer, .page-heading > *, .report-actions, .footer-link, .row-actions { display: none !important; }
  .app-shell, .main-area { display: block; margin: 0; }
  .content-area { width: 100%; padding: 0; }
  .print-header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 2px solid var(--wine); }
  .print-header img { width: 56px; height: 56px; }
  .print-header div { display: grid; gap: 4px; }
  .print-header strong { color: var(--wine); font-size: 14px; }
  .print-header span { color: #282429; font-size: 9px; }
  .panel, .stat-card { break-inside: avoid; border-color: #ded5d2; box-shadow: none; }
  .house-card { border-color: #ded5d2; }
  .table-wrap { overflow: visible; }
  table { white-space: normal; }
  th, td { padding: 6px; color: #282429; }
}


/* Official demonstration walkthrough */
.demo-mode-label{display:inline-flex;align-items:center;padding:6px 9px;border:1px solid #ead9a8;border-radius:20px;background:#fff8e5;color:#76551a;font-size:8px;font-weight:800;letter-spacing:.09em;white-space:nowrap}
.demo-walkthrough{margin:0 0 18px}
.demo-walkthrough .panel-header{align-items:flex-start}
.demo-walkthrough .panel-header h2{margin-top:5px;font-size:16px}
.demo-steps{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:15px 18px}
.demo-steps button{display:grid;min-height:108px;align-content:start;gap:8px;padding:13px;border:1px solid var(--line);border-radius:9px;background:#fffdfa;color:var(--ink);text-align:left;cursor:pointer;transition:border-color .16s ease,transform .16s ease}
.demo-steps button:hover{transform:translateY(-2px);border-color:#d6b5c3;background:#fff9fb}
.demo-steps button>span{color:#a37b26;font:700 11px Georgia,serif;letter-spacing:.08em}
.demo-steps button strong{color:var(--wine-deep);font-size:11px}
.demo-steps button small{color:var(--muted);font-size:9px;line-height:1.5}
.demo-footer{padding:11px 18px;border-top:1px solid var(--line);background:#fdfaf4}
.demo-footer p{margin:0;color:var(--muted);font-size:9px;line-height:1.5}
@media(max-width:1000px){.demo-steps{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){.demo-mode-label{display:none}.demo-steps{grid-template-columns:1fr}.demo-steps button{min-height:82px}}

.demo-warning{border-color:#ead9a8;background:#fffaf0;margin-bottom:16px}.demo-warning .panel-body{padding:13px 17px}.demo-warning strong{color:#76551a;font-size:12px}.demo-warning p{margin:5px 0 0;color:var(--muted);font-size:10px;line-height:1.55}

/* Clear, consistent inline feedback for invalid fields in KBMS dialogs. */
.field input.kbms-invalid, .field select.kbms-invalid, .field textarea.kbms-invalid {
  border-color: var(--red) !important;
  background: #fff8f7;
  box-shadow: 0 0 0 1px var(--red);
}


/* KBMS interaction and layout refinement */
:root {
  --motion-fast: 150ms;
  --motion-standard: 220ms;
  --ease-out: cubic-bezier(.2,.75,.25,1);
}
html { scroll-behavior: smooth; }
.content-area { animation: kbms-page-enter 260ms var(--ease-out) both; }
.page-heading { align-items: center; }
.panel-header { align-items: center; }
.button {
  min-height: 42px;
  padding-inline: 17px;
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: .005em;
  transition: color var(--motion-fast) ease, background var(--motion-fast) ease,
    border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease,
    transform var(--motion-fast) var(--ease-out);
}
.button-small { min-height: 34px; border-radius: 9px; }
.button:focus-visible, .nav-item:focus-visible, .segment-button:focus-visible {
  outline: 3px solid rgb(182 138 58 / 65%);
  outline-offset: 3px;
}
.button:active:not(:disabled) { transform: translateY(1px) scale(.985); }
.nav-item { transition: background var(--motion-standard) ease, color var(--motion-standard) ease, transform var(--motion-fast) var(--ease-out); }
.nav-item:hover { transform: translateX(2px); }
.panel, .stat-card { transition: box-shadow var(--motion-standard) ease, border-color var(--motion-standard) ease, transform var(--motion-standard) var(--ease-out); }
.panel:hover { border-color: #ded1d5; box-shadow: 0 14px 34px rgb(52 25 37 / 7%); }
.field input, .field select, .field textarea, .search-input {
  min-height: 43px;
  border-radius: 9px;
  transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease, background var(--motion-fast) ease;
}
.field textarea { min-height: 92px; padding-block: 11px; }
.field input:focus, .field select:focus, .field textarea:focus, .search-input:focus {
  border-color: var(--wine-soft);
  box-shadow: 0 0 0 3px rgb(99 8 46 / 9%);
  outline: none;
}
.field input.kbms-invalid, .field select.kbms-invalid, .field textarea.kbms-invalid {
  border-color: var(--red) !important;
  background: #fff8f7;
  box-shadow: 0 0 0 3px rgb(163 59 67 / 12%);
}
.dialog[open] { animation: kbms-dialog-enter 180ms var(--ease-out) both; }
.dialog::backdrop { background: rgb(25 12 19 / 48%); backdrop-filter: blur(3px); animation: kbms-backdrop-enter 160ms ease both; }
.toast { animation: kbms-toast-enter 220ms var(--ease-out) both; }
.toast.error { border-left-width: 4px; }
.table-wrap { scrollbar-width: thin; scrollbar-color: #cdbbc3 transparent; }
table tbody tr { transition: background var(--motion-fast) ease; }
table tbody tr:hover { background: #fcf7f8; }
@keyframes kbms-page-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes kbms-dialog-enter { from { opacity: 0; transform: translateY(9px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes kbms-backdrop-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes kbms-toast-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 700px) {
  .page-heading { align-items: stretch; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1 1 auto; }
  .panel-header { align-items: flex-start; }
  .panel-header > .button, .panel-header > .footer-link { flex: none; }
  .button { min-height: 42px; }
  .dialog-actions { flex-wrap: wrap; }
  .dialog-actions .button { flex: 1 1 130px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .content-area, .dialog[open], .toast { animation: none !important; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}


/* KBMS motion system — consistent, restrained transitions across every workspace. */
:root {
  --kbms-motion-instant: 120ms;
  --kbms-motion-fast: 180ms;
  --kbms-motion-base: 260ms;
  --kbms-motion-slow: 380ms;
  --kbms-motion-ease: cubic-bezier(.2,.72,.22,1);
  --kbms-motion-spring: cubic-bezier(.18,.82,.24,1.12);
}
.page-enter { animation: kbms-page-enter 320ms var(--kbms-motion-ease) both; }
.nav-item[aria-current="page"] { position: relative; }
.nav-item[aria-current="page"]::before {
  position: absolute; inset: 8px auto 8px 0; width: 3px; border-radius: 0 4px 4px 0;
  background: currentColor; content: "";
}
.button, .icon-button, .text-button, .segment-button, .filter-select, .demo-steps button {
  -webkit-tap-highlight-color: transparent;
  transform-origin: center;
  transition:
    color var(--kbms-motion-fast) ease,
    background-color var(--kbms-motion-fast) ease,
    border-color var(--kbms-motion-fast) ease,
    box-shadow var(--kbms-motion-base) var(--kbms-motion-ease),
    transform var(--kbms-motion-fast) var(--kbms-motion-ease),
    opacity var(--kbms-motion-fast) ease;
}
.button:hover:not(:disabled), .icon-button:hover:not(:disabled), .demo-steps button:hover {
  transform: translateY(-1px);
}
.button:active:not(:disabled), .icon-button:active:not(:disabled), .segment-button:active {
  transform: translateY(1px) scale(.975);
}
.button:disabled, .icon-button:disabled {
  cursor: not-allowed; opacity: .58; transform: none; box-shadow: none;
}
.nav-item { position: relative; overflow: hidden; }
.nav-item::after {
  position: absolute; inset: 0; background: currentColor; opacity: 0;
  content: ""; pointer-events: none; transition: opacity var(--kbms-motion-fast) ease;
}
.nav-item:hover::after { opacity: .045; }
.panel, .stat-card, .book-card, .house-card, .quick-panel {
  transition: border-color var(--kbms-motion-base) ease,
    box-shadow var(--kbms-motion-base) var(--kbms-motion-ease),
    transform var(--kbms-motion-base) var(--kbms-motion-ease);
}
.stat-card:hover, .book-card:hover, .house-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgb(52 25 37 / 8%);
}
.panel-header, .dialog-head, .page-heading { transition: color var(--kbms-motion-fast) ease; }
.book-cover, .shop-thumb, .crest, .auth-crest {
  transition: transform var(--kbms-motion-slow) var(--kbms-motion-ease), filter var(--kbms-motion-base) ease;
}
.book-card:hover .book-cover { transform: scale(1.025); }
.field input, .field select, .field textarea, .search-input, .filter-select {
  transition: border-color var(--kbms-motion-fast) ease, background-color var(--kbms-motion-fast) ease,
    box-shadow var(--kbms-motion-fast) ease;
}
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .search-input:focus-visible {
  outline: none; box-shadow: 0 0 0 3px rgb(99 8 46 / 12%);
}
.dialog[open] { animation: kbms-dialog-enter var(--kbms-motion-base) var(--kbms-motion-ease) both; }
.dialog[open]::backdrop { animation: kbms-backdrop-enter var(--kbms-motion-fast) ease both; }
.toast { animation: kbms-toast-enter var(--kbms-motion-base) var(--kbms-motion-ease) both; }
.toast.is-leaving { animation: kbms-toast-exit var(--kbms-motion-fast) ease both; }
.table-wrap { overscroll-behavior-x: contain; }
table tbody tr { transition: background-color var(--kbms-motion-fast) ease; }
.status-tag { transition: color var(--kbms-motion-fast) ease, background-color var(--kbms-motion-fast) ease, border-color var(--kbms-motion-fast) ease; }
.empty-mark { animation: kbms-empty-float 3.6s ease-in-out infinite; }
.status-dot { transition: background-color var(--kbms-motion-fast) ease, box-shadow var(--kbms-motion-fast) ease; }
.sync-indicator.pending .status-dot { animation: kbms-status-pulse 1.35s ease-in-out infinite; }
@keyframes kbms-dialog-enter {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes kbms-toast-exit {
  to { opacity: 0; transform: translateX(12px); }
}
@keyframes kbms-empty-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes kbms-status-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgb(163 59 67 / 0%); }
  50% { box-shadow: 0 0 0 5px rgb(163 59 67 / 12%); }
}
@media (max-width: 700px) {
  .nav-item:hover { transform: none; }
  .stat-card:hover, .book-card:hover, .house-card:hover { transform: none; }
  .page-enter { animation-duration: 240ms; }
}
@media (prefers-reduced-motion: reduce) {
  .page-enter, .empty-mark, .sync-indicator.pending .status-dot { animation: none !important; }
  .button:hover:not(:disabled), .icon-button:hover:not(:disabled),
  .button:active:not(:disabled), .icon-button:active:not(:disabled),
  .stat-card:hover, .book-card:hover, .house-card:hover { transform: none !important; }
}


/* Public welcome screen: no workspace chrome is rendered before authorization. */
body.auth-pending { overflow-x: hidden; }
body.auth-pending .app-shell { display: none !important; }
.public-home {
  position: relative; isolation: isolate; display: flex; min-height: 100svh; flex-direction: column;
  overflow: hidden; padding: 0 clamp(22px, 6vw, 92px);
  background: radial-gradient(ellipse at 78% 48%, rgb(182 138 58 / 9%), transparent 34%),
    linear-gradient(135deg, #fffefa 0%, #f8f4f0 48%, #f3e9ed 100%);
}
.public-home[hidden] { display: none !important; }
.public-home-header, .public-home-footer {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between;
}
.public-home-header { min-height: 94px; border-bottom: 1px solid rgb(99 8 46 / 10%); }
.public-brand { display: inline-flex; align-items: center; gap: 13px; color: var(--wine-deep); text-decoration: none; }
.public-brand-crest { width: 45px; height: 49px; object-fit: contain; }
.public-brand span { display: grid; gap: 4px; }
.public-brand strong { font: 700 17px Georgia, serif; letter-spacing: .16em; }
.public-brand small, .public-secure-label { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .15em; }
.public-secure-label { display: inline-flex; align-items: center; gap: 9px; }
.public-secure-dot { width: 7px; height: 7px; border-radius: 50%; background: #64816b; box-shadow: 0 0 0 4px #e8efe7; }
.public-hero { position: relative; z-index: 1; display: grid; width: min(1240px, 100%); flex: 1; grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr); align-items: center; gap: clamp(24px, 6vw, 90px); margin: 0 auto; padding: 58px 0 68px; }
.public-hero-copy { max-width: 650px; animation: kbms-hero-copy-in 700ms var(--kbms-motion-ease, ease-out) both; }
.public-kicker { display: inline-flex; align-items: center; gap: 10px; color: var(--wine-soft); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.public-kicker span { width: 24px; height: 2px; background: var(--gold); }
.public-hero h1 { margin: 23px 0 0; color: var(--wine-deep); font: 700 clamp(42px, 5.2vw, 70px)/1.04 Georgia, serif; letter-spacing: -.045em; }
.public-hero h1 em { color: var(--wine-soft); font-weight: 500; }
.public-description { max-width: 560px; margin: 23px 0 0; color: #6e6569; font-size: clamp(14px, 1.3vw, 16px); line-height: 1.85; }
.public-hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 17px; margin-top: 32px; }
.public-login-button { min-height: 52px; min-width: 190px; justify-content: space-between; padding: 0 20px; border-radius: 9px; font-size: 13px; box-shadow: 0 10px 24px rgb(99 8 46 / 17%); }
.public-login-button span:last-child { font-size: 19px; transition: transform 180ms ease; }
.public-login-button:hover span:last-child { transform: translateX(4px); }
.public-access-note { color: #83777d; font-size: 10px; }
.public-hero-art { position: relative; display: grid; min-height: 420px; place-items: center; animation: kbms-hero-art-in 850ms 100ms var(--kbms-motion-ease, ease-out) both; }
.public-hero-art::before { position: absolute; width: min(34vw, 390px); aspect-ratio: 1; border-radius: 50%; background: linear-gradient(145deg, rgb(99 8 46 / 9%), rgb(182 138 58 / 12%)); content: ""; filter: blur(1px); }
.public-orbit { position: absolute; width: min(38vw, 440px); aspect-ratio: 1; border: 1px solid rgb(99 8 46 / 12%); border-radius: 50%; }
.public-orbit-one { transform: rotate(-18deg) scaleY(.72); }
.public-orbit-two { transform: rotate(52deg) scaleY(.72); border-color: rgb(190 145 55 / 26%); }
.public-crest-card { position: relative; display: grid; width: 220px; height: 250px; place-items: center; border: 1px solid rgb(255 255 255 / 85%); border-radius: 28px; background: rgb(255 254 250 / 75%); box-shadow: 0 28px 75px rgb(52 25 37 / 14%); backdrop-filter: blur(14px); transform: rotate(-4deg); }
.public-crest-card img { width: 164px; height: 190px; object-fit: contain; }
.public-float-card { position: absolute; display: flex; align-items: center; gap: 12px; min-width: 205px; padding: 13px 16px; border: 1px solid rgb(255 255 255 / 80%); border-radius: 12px; background: rgb(255 254 250 / 92%); box-shadow: 0 12px 35px rgb(52 25 37 / 10%); backdrop-filter: blur(10px); animation: kbms-float 5s ease-in-out infinite; }
.public-float-top { top: 72px; right: -4px; }
.public-float-bottom { bottom: 64px; left: -4px; animation-delay: -2.4s; }
.public-float-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; background: var(--surface-pink); color: var(--wine); font-size: 18px; }
.public-float-card > span:last-child { display: grid; gap: 4px; }
.public-float-card strong { color: var(--wine-deep); font: 700 13px Georgia, serif; }
.public-float-card small { color: var(--muted); font-size: 10px; }
.public-home-footer { min-height: 62px; border-top: 1px solid rgb(99 8 46 / 10%); color: #81747a; font-size: 9px; font-weight: 700; letter-spacing: .11em; }
.public-home-footer i { padding: 0 7px; color: var(--gold); font-style: normal; }
.public-home-glow { position: absolute; z-index: -1; width: 340px; aspect-ratio: 1; border-radius: 50%; background: rgb(99 8 46 / 5%); filter: blur(65px); pointer-events: none; }
.public-home-glow-one { top: 18%; left: -190px; }
.public-home-glow-two { right: -190px; bottom: 5%; background: rgb(182 138 58 / 10%); }
@keyframes kbms-hero-copy-in { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes kbms-hero-art-in { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes kbms-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* Navigation hierarchy and button-label protection across desktop and mobile. */
.sidebar { width: 274px; padding: 24px 17px 17px; background: linear-gradient(165deg, #43051f 0%, #350318 100%); }
.main-area { margin-left: 274px; }
.brand { min-height: 82px; padding: 4px 9px 20px; }
.crest { width: 58px; height: 60px; padding: 4px; border: 1px solid rgb(255 255 255 / 15%); border-radius: 13px; background: rgb(255 255 255 / 5%); }
.nav-label { display: flex; align-items: center; gap: 9px; padding: 19px 10px 9px; color: #d9b7c5; font-size: 9px; letter-spacing: .18em; }
.nav-label::before { width: 13px; height: 1px; background: rgb(182 138 58 / 75%); content: ""; }
.nav-list { gap: 5px; }
.nav-item { min-width: 0; min-height: 44px; gap: 12px; padding: 0 11px; border-radius: 9px; font-size: 12px; font-weight: 550; }
.nav-icon { width: 29px; height: 29px; flex: 0 0 29px; border: 1px solid rgb(255 255 255 / 12%); border-radius: 8px; background: rgb(255 255 255 / 5%); font-size: 15px; }
.nav-item.active { border-color: rgb(255 255 255 / 70%); background: #fffaf5; box-shadow: 0 5px 16px rgb(0 0 0 / 12%), inset 3px 0 var(--gold); font-weight: 750; }
.nav-item.active .nav-icon { border-color: #eadde2; background: #f7edf0; }
.nav-item[aria-current="page"]::before { display: none; }
.workspace-label { margin-top: 6px; border-color: rgb(255 255 255 / 13%); }
.user-chip { min-width: 0; gap: 8px; }
.user-chip .text-button { flex: 0 0 auto; white-space: nowrap; }
.button { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; text-align: center; }
.button-primary, .button-secondary, .button-quiet, .button-danger { flex-shrink: 0; }
.heading-actions { align-items: stretch; }
.heading-actions .button { flex: 0 1 auto; min-width: max-content; }
.quick-actions .button, .dialog-actions .button { min-width: 112px; }
.table-wrap { max-width: 100%; }
@media (max-width: 1050px) {
  .sidebar { width: 244px; }
  .main-area { margin-left: 244px; }
  .public-hero { gap: 25px; }
  .public-hero h1 { font-size: clamp(40px, 5vw, 58px); }
}
@media (max-width: 700px) {
  .public-home { padding: 0 22px; }
  .public-home-header { min-height: 76px; }
  .public-hero { grid-template-columns: 1fr; gap: 12px; padding: 48px 0 34px; }
  .public-hero h1 { font-size: clamp(39px, 11vw, 58px); }
  .public-hero-art { min-height: 310px; }
  .public-crest-card { width: 166px; height: 190px; border-radius: 22px; }
  .public-crest-card img { width: 125px; height: 145px; }
  .public-orbit { width: min(78vw, 340px); }
  .public-hero-art::before { width: min(70vw, 300px); }
  .public-float-top { top: 36px; right: 0; }
  .public-float-bottom { bottom: 35px; left: 0; }
  .public-home-footer { min-height: 58px; flex-wrap: wrap; gap: 8px; padding: 13px 0; font-size: 8px; }
  .sidebar { width: 100%; padding: 12px 14px 9px; }
  .main-area { margin-left: 0; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1 1 148px; min-width: 0; }
  .quick-actions .button, .dialog-actions .button { flex: 1 1 135px; min-width: 0; }
}
@media (max-width: 420px) {
  .public-secure-label { font-size: 8px; letter-spacing: .1em; }
  .public-home-footer { justify-content: center; text-align: center; }
  .public-home-footer span { width: 100%; }
  .button { min-height: 42px; padding-inline: 12px; }
  .dialog-actions { flex-wrap: wrap; }
  .dialog-actions .button { flex: 1 1 125px; }
}
@media (prefers-reduced-motion: reduce) {
  .public-hero-copy, .public-hero-art, .public-float-card { animation: none !important; }
}


/* Compact, legible mobile navigation with visible group labels. */
@media (max-width: 700px) {
  .sidebar { gap: 0; }
  .brand { margin-bottom: 5px; }
  .nav-label, .nav-label-spaced { display: flex; min-height: 23px; padding: 7px 4px 5px; font-size: 8px; }
  .nav-label::before { width: 9px; }
  .nav-list { display: flex; width: 100%; gap: 6px; padding: 0 0 5px; overflow-x: auto; overscroll-behavior-x: contain; }
  .nav-list + .nav-list { margin-top: 0; }
  .nav-item { min-height: 38px; padding: 0 10px; border-radius: 8px; font-size: 10px; }
  .nav-icon { width: 24px; height: 24px; flex-basis: 24px; font-size: 13px; }
  .nav-item.active { box-shadow: inset 0 -2px var(--gold); }
}
@media (max-width: 420px) {
  .public-hero-actions { align-items: stretch; flex-direction: column; }
  .public-login-button { width: 100%; }
  .public-access-note { text-align: center; }
  .page-heading { flex-direction: column; }
  .heading-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .heading-actions .button { min-width: 0; width: 100%; }
}


#app-shell[hidden] { display: none !important; }


/* Public welcome page: fit the first screen without clipping essential content. */
.public-home {
  height: 100svh;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}
.public-home-header { flex: 0 0 auto; }
.public-hero {
  min-height: 0;
  padding: clamp(18px, 3.5vh, 42px) 0;
}
.public-hero-art { min-height: min(48vh, 420px); }
.public-home-footer { flex: 0 0 auto; }
@media (max-width: 700px) {
  .public-home { height: 100svh; min-height: 0; }
  .public-home-header { min-height: clamp(58px, 9vh, 76px); }
  .public-hero {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    padding: clamp(16px, 3vh, 30px) 0;
  }
  .public-hero-copy { width: 100%; }
  .public-hero h1 {
    margin-top: 15px;
    font-size: clamp(34px, 8.8vw, 54px);
    line-height: 1.02;
  }
  .public-description {
    margin-top: 14px;
    font-size: 13px;
    line-height: 1.55;
  }
  .public-hero-actions { gap: 12px; margin-top: 20px; }
  .public-hero-art { display: none; }
  .public-home-footer {
    min-height: clamp(46px, 7vh, 58px);
    padding: 8px 0;
  }
}
@media (max-width: 420px) {
  .public-home { padding-right: 18px; padding-left: 18px; }
  .public-kicker { font-size: 8px; letter-spacing: .14em; }
  .public-hero h1 { font-size: clamp(32px, 8.5vw, 42px); }
  .public-description { font-size: 12px; line-height: 1.5; }
  .public-hero-actions { margin-top: 16px; }
  .public-login-button { min-height: 46px; }
}
@media (max-height: 620px) {
  .public-home-header { min-height: 56px; }
  .public-brand-crest { width: 34px; height: 38px; }
  .public-hero { padding-top: 10px; padding-bottom: 10px; }
  .public-hero h1 { margin-top: 10px; font-size: clamp(30px, 5vh, 48px); }
  .public-description { margin-top: 10px; line-height: 1.45; }
  .public-hero-actions { margin-top: 14px; }
  .public-home-footer { min-height: 42px; }
}
@media (max-height: 620px) and (max-width: 700px) {
  .public-description { max-width: 48rem; font-size: 11px; }
  .public-access-note { font-size: 9px; }
}


/* Fail-safe: never allow the staff workspace to overlap the public welcome screen. */
#public-home:not([hidden]) ~ #app-shell {
  display: none !important;
}
#app-shell[hidden] {
  display: none !important;
}


/* KBMS sign-in transition: restrained school palette, quiet motion, no generic gradients. */
.signin-transition {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 24px;
  border: 0;
  overflow: hidden;
  color: var(--ink);
  background: transparent;
  opacity: 1;
  transition: opacity .24s ease, transform .24s ease;
}
.signin-transition::backdrop {
  background: rgb(247 245 240 / 94%);
  backdrop-filter: blur(5px);
}
.signin-transition[open] {
  display: grid;
  place-items: center;
}
.signin-transition.is-leaving {
  opacity: 0;
  transform: translateY(5px);
}
.signin-transition-content {
  position: relative;
  display: flex;
  width: min(440px, 100%);
  min-height: 290px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid var(--line);
  border-top: 3px solid var(--wine);
  border-radius: 12px;
  background: var(--surface);
  text-align: center;
  box-shadow: 0 18px 55px rgb(52 25 37 / 9%);
}
.signin-transition .eyebrow {
  margin: 8px 0 0;
  color: var(--wine-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .19em;
}
.signin-transition h2 {
  margin: 0;
  color: var(--wine-deep);
  font: 600 clamp(24px, 4vw, 31px)/1.18 Georgia, serif;
}
.signin-transition-status {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}
.signin-quote {
  max-width: 340px;
  margin: 13px 0 0;
  color: var(--wine-soft);
  font: italic 16px/1.55 Georgia, serif;
}
.signin-transition-foot {
  margin-top: 12px;
  color: #93878b;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .17em;
}
.signin-spinner {
  width: 25px;
  height: 25px;
  border: 2px solid #eadfe3;
  border-top-color: var(--wine);
  border-right-color: var(--gold);
  border-radius: 50%;
  animation: signin-spin .85s linear infinite;
}
@keyframes signin-spin { to { transform: rotate(360deg); } }
@media (max-width: 520px) {
  .signin-transition { padding: 18px; }
  .signin-transition-content { min-height: 270px; border-radius: 10px; }
  .signin-quote { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .signin-spinner { animation: none; }
  .signin-transition { transition: none; }
}


/* Keep scrolling available while removing distracting browser scrollbar tracks. */
html, body, * { scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar, *::-webkit-scrollbar { width: 0; height: 0; }

/* Sidebar collapse uses a compact icon rail without removing navigation access. */
.sidebar-brand-row { position: relative; display: flex; align-items: center; min-width: 0; }
.sidebar-brand-row .brand { min-width: 0; flex: 1; }
.sidebar-toggle { display: grid; width: 28px; height: 28px; flex: none; place-items: center; border: 1px solid rgb(255 255 255 / 20%); border-radius: 7px; background: rgb(255 255 255 / 7%); color: #f6e8c2; font-size: 20px; line-height: 1; transition: background .18s ease, border-color .18s ease; }
.sidebar-toggle:hover { border-color: rgb(255 255 255 / 42%); background: rgb(255 255 255 / 13%); }
.sidebar-collapsed .sidebar { width: 78px; padding-right: 10px; padding-left: 10px; }
.sidebar-collapsed .main-area { margin-left: 78px; }
.sidebar-collapsed .sidebar-brand-row { justify-content: center; }
.sidebar-collapsed .sidebar-brand-row .brand { justify-content: center; padding: 3px 0 16px; }
.sidebar-collapsed .brand-copy, .sidebar-collapsed .nav-label, .sidebar-collapsed .workspace-label, .sidebar-collapsed .sidebar-bottom .legal-link, .sidebar-collapsed .user-chip > span:nth-child(2), .sidebar-collapsed .user-chip .text-button { display: none; }
.sidebar-collapsed .sidebar-toggle { position: absolute; top: -9px; right: -5px; z-index: 1; width: 24px; height: 24px; }
.sidebar-collapsed .nav-item { justify-content: center; gap: 0; padding-right: 0; padding-left: 0; font-size: 0; }
.sidebar-collapsed .nav-icon { width: auto; font-size: 18px; }
.sidebar-collapsed .user-chip { justify-content: center; }
.sidebar-collapsed .sidebar-bottom { padding-top: 12px; }
.sidebar-collapsed .nav-item:hover { background: rgb(255 255 255 / 12%); }

/* One global search surface, sized to sit comfortably between the page title and status. */
.topbar { justify-content: flex-start; }
.breadcrumb { flex: 0 0 auto; }
.global-search { position: relative; z-index: 5; width: min(390px, 34vw); min-width: 190px; margin: 0 auto; }
.global-search-field { display: flex; min-height: 39px; align-items: center; gap: 9px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); transition: border-color .18s ease, box-shadow .18s ease; }
.global-search-field:focus-within { border-color: #c9a9b7; box-shadow: 0 0 0 3px rgb(99 8 46 / 7%); }
.global-search-icon { color: var(--wine); font-size: 19px; line-height: 1; }
.global-search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }
.global-search-field input:focus-visible { outline: 0; }
.global-search-field kbd { flex: none; padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; color: #9a8e92; font: 9px ui-monospace, monospace; }
.global-search-results { position: absolute; top: calc(100% + 8px); right: 0; left: 0; max-height: min(440px, 65vh); overflow: auto; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: 0 16px 42px rgb(45 23 33 / 14%); }
.global-search-result { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 13px; border: 0; border-bottom: 1px solid #f0eae7; background: transparent; color: var(--ink); text-align: left; }
.global-search-result:last-child { border-bottom: 0; }
.global-search-result:hover, .global-search-result:focus-visible { background: #faf4f5; }
.global-result-copy { display: grid; min-width: 0; gap: 4px; }
.global-result-copy strong { overflow: hidden; color: var(--wine-deep); font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.global-result-copy small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.global-result-type { flex: none; color: var(--wine-soft); font-size: 8px; font-weight: 750; letter-spacing: .1em; }
.global-search-empty { padding: 17px 14px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.class-name-link { font-size: 11px; font-weight: 700; }
#class-roster-search { min-width: 230px; }
@media (max-width: 1050px) { .sidebar-collapsed .sidebar { width: 76px; } .sidebar-collapsed .main-area { margin-left: 76px; } .global-search { width: min(330px, 32vw); } }
@media (max-width: 700px) {
  .sidebar-toggle { display: none; }
  .sidebar-collapsed .sidebar { width: 100%; padding: 10px 14px 8px; }
  .sidebar-collapsed .main-area { margin-left: 0; }
  .sidebar-collapsed .brand-copy { display: grid; }
  .sidebar-collapsed .nav-label { display: none; }
  .sidebar-collapsed .nav-item { justify-content: flex-start; gap: 6px; padding: 0 9px; font-size: 10px; }
  .sidebar-collapsed .nav-icon { width: auto; font-size: 13px; }
  .global-search { order: 3; width: 100%; min-width: 0; margin: 8px 0 0; }
  .topbar { flex-wrap: wrap; gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .top-actions { margin-left: auto; }
  .global-search-results { right: auto; }
  #class-roster-search { min-width: 0; }
}

.public-demo-button { min-height: 46px; gap: 10px; border-color: #d8c7cd; background: rgb(255 254 250 / 88%); color: var(--wine); text-decoration: none; }
.public-demo-button:hover { border-color: var(--wine-soft); background: #fffefa; }
.public-hero-actions { flex-wrap: wrap; }
@media (max-width: 420px) { .public-demo-button { width: 100%; justify-content: center; } }

/* KBMS navigation: smooth, quiet width transitions with a neutral menu glyph. */
.sidebar, .main-area { transition: width .28s cubic-bezier(.2,.75,.25,1), margin-left .28s cubic-bezier(.2,.75,.25,1), padding .28s ease; }
.sidebar-toggle { width: 32px; height: 32px; border-radius: 8px; }
.sidebar-toggle-icon, .sidebar-toggle-icon::before, .sidebar-toggle-icon::after { display:block; width:13px; height:1.5px; border-radius:2px; background:#f6e8c2; transition:transform .2s ease, opacity .2s ease; }
.sidebar-toggle-icon { position:relative; }
.sidebar-toggle-icon::before, .sidebar-toggle-icon::after { position:absolute; left:0; content:""; }
.sidebar-toggle-icon::before { top:-4px; }
.sidebar-toggle-icon::after { top:4px; }
.sidebar-toggle:hover .sidebar-toggle-icon::before { transform:translateY(-1px); }
.sidebar-toggle:hover .sidebar-toggle-icon::after { transform:translateY(1px); }
.sidebar-collapsed .sidebar-toggle { position:absolute; top:18px; right:-7px; z-index:4; width:30px; height:30px; background:var(--wine); box-shadow:0 2px 8px rgb(0 0 0 / 18%); }
@media (max-width: 1280px) {
  .app-shell:not(.sidebar-collapsed) .sidebar { width:258px; padding-right:16px; padding-left:16px; }
  .app-shell:not(.sidebar-collapsed) .main-area { margin-left:258px; }
  .app-shell:not(.sidebar-collapsed) .sidebar .brand-copy, .app-shell:not(.sidebar-collapsed) .sidebar .nav-label, .app-shell:not(.sidebar-collapsed) .sidebar .workspace-label, .app-shell:not(.sidebar-collapsed) .sidebar .sidebar-bottom .legal-link, .app-shell:not(.sidebar-collapsed) .sidebar .user-chip > span:nth-child(2), .app-shell:not(.sidebar-collapsed) .sidebar .user-chip .text-button { display:revert; }
  .app-shell:not(.sidebar-collapsed) .sidebar .nav-item { justify-content:flex-start; gap:12px; padding-right:12px; padding-left:12px; font-size:11px; }
  .app-shell:not(.sidebar-collapsed) .sidebar .nav-icon { width:19px; }
  .app-shell:not(.sidebar-collapsed) .sidebar .user-chip { justify-content:flex-start; }
  .sidebar { width:78px; padding-right:10px; padding-left:10px; }
  .main-area { margin-left:78px; }
  .sidebar-brand-row { justify-content:center; }
  .sidebar-brand-row .brand { justify-content:center; padding:3px 0 16px; }
  .sidebar .brand-copy, .sidebar .nav-label, .sidebar .workspace-label, .sidebar .sidebar-bottom .legal-link, .sidebar .user-chip > span:nth-child(2), .sidebar .user-chip .text-button { display:none; }
  .sidebar .sidebar-toggle { position:absolute; top:18px; right:-7px; z-index:4; }
  .sidebar .nav-item { justify-content:center; gap:0; padding-right:0; padding-left:0; font-size:0; }
  .sidebar .nav-icon { width:auto; font-size:18px; }
  .sidebar .user-chip { justify-content:center; }
}
@media (prefers-reduced-motion: reduce) { .sidebar, .main-area, .sidebar-toggle-icon, .sidebar-toggle-icon::before, .sidebar-toggle-icon::after { transition:none !important; } }


/* Mobile workspace redesign — a true compact navigation drawer and touch-first layouts. */
.mobile-nav-toggle, .mobile-nav-backdrop { display: none; }
@media (max-width: 700px) {
  html, body { width: 100%; max-width: 100%; overflow-x: clip; }
  body.mobile-nav-visible { overflow: hidden; }
  .app-shell { position: relative; display: block; min-height: 100svh; overflow-x: clip; }
  .sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    z-index: 60 !important;
    display: flex !important;
    width: min(86vw, 310px) !important;
    height: 100svh;
    min-height: 100svh;
    padding: max(16px, env(safe-area-inset-top)) 15px max(16px, env(safe-area-inset-bottom)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    box-shadow: 18px 0 48px rgb(24 8 17 / 22%);
    transform: translateX(-105%);
    transition: transform 280ms cubic-bezier(.2,.75,.25,1);
    will-change: transform;
  }
  .mobile-nav-open .sidebar { transform: translateX(0); }
  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgb(24 8 17 / 48%);
    opacity: 1;
    animation: mobile-backdrop-in 180ms ease both;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-nav-backdrop[hidden] { display: none !important; }
  .sidebar-brand-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .sidebar .brand { min-height: 62px; flex: 1; padding: 0 2px 12px; }
  .sidebar .crest { width: 43px; height: 46px; }
  .sidebar .brand-copy strong { font-size: 12px; }
  .sidebar .brand-copy small { font-size: 8px; }
  .sidebar-toggle { display: grid !important; width: 38px; height: 38px; flex: none; place-items: center; }
  .sidebar .nav-label, .sidebar .nav-label-spaced { display: block; padding: 17px 10px 8px; }
  .sidebar .sidebar-bottom { display: block; margin-top: auto; padding-top: 18px; }
  .sidebar .nav-list, .sidebar .nav-list + .nav-list {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    overflow: visible;
  }
  .sidebar .nav-item {
    display: flex;
    width: 100%;
    min-height: 44px;
    flex: initial;
    justify-content: flex-start;
    gap: 12px;
    padding: 0 12px;
    border-radius: 9px;
    font-size: 12px;
  }
  .sidebar .nav-icon { width: 20px; font-size: 16px; }
  .sidebar .workspace-label { display: grid; }
  .sidebar .legal-link { display: flex; }
  .sidebar .user-chip { display: flex; }
  .main-area { width: 100%; min-width: 0; min-height: 100svh; margin: 0; }
  .topbar {
    position: sticky;
    z-index: 30;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 9px;
    min-height: 64px;
    padding: max(8px, env(safe-area-inset-top)) 13px 8px;
    background: rgb(255 254 250 / 96%);
  }
  .mobile-nav-toggle {
    display: flex;
    width: 40px;
    height: 40px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    box-shadow: 0 2px 8px rgb(52 25 37 / 5%);
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-nav-toggle span { display: block; width: 17px; height: 2px; border-radius: 3px; background: var(--wine-deep); transition: transform 180ms ease, opacity 180ms ease; }
  .mobile-nav-open .mobile-nav-toggle span:first-child { transform: translateY(7px) rotate(45deg); }
  .mobile-nav-open .mobile-nav-toggle span:nth-child(2) { opacity: 0; }
  .mobile-nav-open .mobile-nav-toggle span:last-child { transform: translateY(-7px) rotate(-45deg); }
  .breadcrumb { display: none; }
  .global-search { width: 100%; min-width: 0; }
  .global-search-field { min-height: 40px; }
  .global-search-field input { min-width: 0; font-size: 12px; }
  .global-search-field kbd { display: none; }
  .top-actions { min-width: 20px; justify-content: flex-end; gap: 0; }
  .top-actions .date-label, .top-actions .demo-mode-label { display: none; }
  .sync-indicator { gap: 0; }
  .sync-indicator > span:last-child { display: none; }
  .sync-indicator .status-dot { width: 9px; height: 9px; }
  .content-area { width: 100%; min-width: 0; padding: 20px 13px max(26px, env(safe-area-inset-bottom)); }
  .page-heading { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-heading > div:first-child { min-width: 0; }
  .page-heading h1 { font-size: clamp(24px, 7vw, 30px); overflow-wrap: anywhere; }
  .page-heading p { max-width: none; font-size: 12px; }
  .heading-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .heading-actions .button { width: 100%; min-width: 0; padding-inline: 9px; white-space: normal; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stat-card { min-width: 0; min-height: 104px; padding: 13px 12px; }
  .stat-label { align-items: flex-start; font-size: 8px; line-height: 1.4; }
  .stat-number { font-size: clamp(22px, 7vw, 27px); overflow-wrap: anywhere; }
  .overview-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .panel, .stat-card, .book-card { min-width: 0; border-radius: 11px; }
  .panel-header { flex-wrap: wrap; gap: 9px; padding: 13px; }
  .panel-header > * { min-width: 0; }
  .panel-body { padding: 13px; }
  .quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px; }
  .quick-actions .button { width: 100%; min-width: 0; padding-inline: 8px; white-space: normal; }
  .toolbar { width: 100%; gap: 8px; }
  .search-wrap { min-width: 0; flex: 1 1 100%; }
  .filter-select { min-width: 0; max-width: 100%; }
  .inventory-toolbar, .inventory-toolbar > .toolbar { min-width: 0; }
  .book-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 11px; }
  .book-card { display: grid; grid-template-columns: 86px minmax(0, 1fr); align-items: start; gap: 8px 11px; padding: 10px; }
  .book-cover, .book-cover-placeholder { grid-row: span 4; width: 86px; height: 116px; }
  .book-card-top, .book-card h3, .book-card > .code-text, .book-description, .book-card dl, .book-card > .footer-link { grid-column: 2; }
  .book-card h3 { font-size: 13px; }
  .book-card dl { gap: 5px; }
  .book-card dl > div { padding-top: 5px; }
  .quick-entry, .circulation-entry { grid-template-columns: minmax(0, 1fr); gap: 11px; }
  .quick-entry .button, .circulation-entry .button { width: 100%; }
  .field input, .field select, .field textarea, .search-input, .filter-select { min-height: 46px; font-size: 13px; }
  .field > span { font-size: 11px; }
  .button, .button-small { min-height: 44px; }
  .row-actions { flex-wrap: wrap; gap: 7px; }
  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }
  .table-wrap table { min-width: 620px; }
  .table-wrap th, .table-wrap td { padding: 11px 10px; font-size: 10px; }
  .table-wrap th { position: sticky; top: 0; z-index: 1; }
  .house-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .house-card { min-width: 0; padding: 11px; }
  .stream-row { grid-template-columns: minmax(70px, 92px) minmax(0, 1fr) 30px; gap: 7px; }
  .stream-name, .stream-count { font-size: 9px; }
  .form-fields { grid-template-columns: minmax(0, 1fr); gap: 11px; }
  .form-fields .field, .form-fields .field:first-child, .form-fields .field.full { grid-column: 1; }
  .dialog { width: calc(100% - 20px); max-width: 520px; max-height: calc(100svh - 20px); border-radius: 16px; }
  .dialog > form, .legal-dialog { padding: 17px; }
  .dialog-head h2 { font-size: 19px; }
  .dialog-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dialog-actions .button { width: 100%; min-width: 0; padding-inline: 8px; }
  .app-footer { flex-wrap: wrap; padding: 12px 13px max(12px, env(safe-area-inset-bottom)); line-height: 1.6; }
  .toast-region { right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); left: 10px; }
  .toast { max-width: none; font-size: 12px; }
}
@media (max-width: 390px) {
  .topbar { grid-template-columns: 38px minmax(0, 1fr) 14px; gap: 7px; padding-inline: 9px; }
  .mobile-nav-toggle { width: 38px; height: 38px; }
  .content-area { padding-inline: 10px; }
  .heading-actions { grid-template-columns: minmax(0, 1fr); }
  .quick-actions { grid-template-columns: minmax(0, 1fr); }
  .stat-card { padding: 11px 10px; }
  .book-card { grid-template-columns: 72px minmax(0, 1fr); }
  .book-cover, .book-cover-placeholder { width: 72px; height: 100px; }
}
@keyframes mobile-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .sidebar, .mobile-nav-toggle span, .mobile-nav-backdrop { transition: none !important; animation: none !important; }
}

/* Mobile drawer must restore full labels even when the desktop rail preference is collapsed. */
@media (max-width: 700px) {
  .sidebar .sidebar-brand-row { justify-content: space-between; }
  .sidebar .sidebar-brand-row .brand { justify-content: flex-start; padding: 0 2px 12px; }
  .sidebar .sidebar-toggle { position: static; top: auto; right: auto; width: 38px; height: 38px; }
  .sidebar .sidebar-bottom .legal-link { display: flex; }
  .sidebar .user-chip > span:nth-child(2) { display: grid; }
  .sidebar .user-chip .text-button { display: inline-flex; }
  .sidebar .user-chip { justify-content: flex-start; }
}


/* Refined Kabarak finish: antique gold, integrated navigation and a real product-led landing page. */
.sidebar {
  border-right: 1px solid rgb(255 255 255 / 8%);
  transition: width 280ms cubic-bezier(.2,.75,.25,1), padding 280ms cubic-bezier(.2,.75,.25,1);
  will-change: width;
}
.main-area { transition: margin-left 280ms cubic-bezier(.2,.75,.25,1); }
.sidebar-toggle {
  width: 30px;
  height: 30px;
  border-color: rgb(217 191 139 / 35%);
  border-radius: 8px;
  background: rgb(255 255 255 / 5%);
  color: #e1c995;
}
.sidebar-toggle-icon {
  position: relative;
  display: block;
  width: 13px;
  height: 14px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  background: transparent;
}
.sidebar-toggle-icon::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 0;
  height: auto;
  border-left: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  content: "";
}
.sidebar-toggle-icon::after { display: none; }
.sidebar-collapsed .sidebar-toggle { top: 8px; right: 6px; width: 28px; height: 28px; }
.sidebar-collapsed .sidebar-brand-row .brand { justify-content: center; }
.sidebar-collapsed .sidebar { padding-top: 22px; }
.sidebar .nav-item.active { box-shadow: inset 3px 0 var(--gold); }
.sidebar .nav-label::before { background: rgb(217 191 139 / 65%); }
.public-home {
  background:
    radial-gradient(ellipse at 80% 48%, rgb(182 138 58 / 10%), transparent 34%),
    linear-gradient(135deg, #fffefa 0%, #f8f5ef 52%, #f2e9e9 100%);
}
.public-hero {
  width: min(1300px, 100%);
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, .98fr);
  gap: clamp(28px, 5vw, 76px);
  padding: 38px 0 42px;
}
.public-hero-copy { max-width: 690px; }
.public-kicker { color: #765c31; }
.public-hero h1 { max-width: 700px; font-size: clamp(48px, 5.8vw, 78px); line-height: 1.02; }
.public-hero h1 em { color: #78415a; }
.public-description { max-width: 580px; color: #625a5b; line-height: 1.75; }
.public-login-button {
  min-height: 54px;
  border: 1px solid var(--wine-deep);
  border-radius: 8px;
  background: var(--wine);
  color: #fffaf5;
}
.public-login-button:hover { background: var(--wine-deep); }
.public-demo-button { min-height: 50px; border-radius: 8px; }
.public-hero-art { min-height: 440px; }
.public-hero-art::before {
  width: min(35vw, 430px);
  background: linear-gradient(145deg, rgb(99 8 46 / 8%), rgb(182 138 58 / 13%));
}
.public-orbit { width: min(39vw, 470px); border-color: rgb(99 8 46 / 10%); }
.public-workspace-card {
  position: relative;
  z-index: 1;
  width: min(100%, 470px);
  padding: 23px 24px 18px;
  border: 1px solid rgb(255 255 255 / 88%);
  border-radius: 20px;
  background: rgb(255 254 250 / 91%);
  box-shadow: 0 28px 80px rgb(52 25 37 / 14%), 0 4px 14px rgb(52 25 37 / 5%);
  backdrop-filter: blur(16px);
  transform: rotate(-1.2deg);
}
.public-workspace-top, .public-workspace-access, .public-workspace-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.public-workspace-top { padding-bottom: 16px; border-bottom: 1px solid #eee7df; }
.public-workspace-mark, .public-workspace-access, .public-workspace-bottom {
  color: #83766f;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .13em;
}
.public-workspace-access { gap: 7px; color: var(--wine-soft); }
.public-workspace-access i { width: 6px; height: 6px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 3px var(--sage-pale); }
.public-workspace-heading { display: flex; align-items: center; gap: 12px; padding: 19px 0 16px; }
.public-workspace-crest { width: 43px; height: 48px; object-fit: contain; }
.public-workspace-heading > span { display: grid; gap: 5px; }
.public-workspace-heading strong { color: var(--wine-deep); font: 700 18px Georgia, serif; }
.public-workspace-heading small { color: var(--muted); font-size: 10px; }
.public-workspace-modules { display: grid; gap: 8px; }
.public-workspace-module {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 11px;
  min-height: 68px;
  padding: 10px 12px;
  border: 1px solid #eee7df;
  border-radius: 10px;
  background: #fffefa;
}
.public-module-number { color: #a88343; font: 700 11px Georgia, serif; }
.public-workspace-module > span:nth-child(2) { display: grid; gap: 4px; }
.public-workspace-module strong { color: #382a30; font-size: 11px; }
.public-workspace-module small { color: #83777b; font-size: 9px; }
.public-module-mark { color: var(--gold); font-size: 15px; }
.public-workspace-bottom { gap: 8px; padding-top: 15px; font-size: 7px; letter-spacing: .1em; }
.public-workspace-float {
  position: absolute;
  right: -5px;
  bottom: 22px;
  z-index: 2;
  padding: 11px 15px;
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: 7px;
  background: var(--wine-deep);
  box-shadow: 0 12px 26px rgb(52 25 37 / 17%);
  color: #f2e5c8;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .13em;
  transform: rotate(2deg);
}
.public-home-footer { min-height: 62px; border-top: 1px solid rgb(99 8 46 / 10%); }
@media (max-width: 900px) {
  .public-home { padding-inline: 24px; }
  .public-home-header { min-height: 72px; }
  .public-hero { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 25px 0 22px; }
  .public-hero-copy { max-width: 720px; }
  .public-hero h1 { margin-top: 15px; font-size: clamp(38px, 7.5vw, 56px); }
  .public-description { margin-top: 14px; font-size: 13px; }
  .public-hero-actions { gap: 10px; margin-top: 19px; }
  .public-hero-art { min-height: 255px; }
  .public-workspace-card { width: min(100%, 520px); padding: 15px 17px 13px; transform: none; }
  .public-workspace-top { padding-bottom: 10px; }
  .public-workspace-heading { padding: 10px 0; }
  .public-workspace-crest { width: 34px; height: 36px; }
  .public-workspace-heading strong { font-size: 15px; }
  .public-workspace-module { min-height: 48px; padding: 7px 10px; }
  .public-workspace-bottom { padding-top: 10px; }
  .public-workspace-float { right: -6px; bottom: 2px; }
  .public-home-footer { min-height: 42px; font-size: 8px; }
}
@media (max-width: 560px) {
  .public-home { min-height: 100svh; padding-inline: 17px; }
  .public-home-header { min-height: 66px; }
  .public-brand-crest { width: 37px; height: 40px; }
  .public-brand strong { font-size: 15px; }
  .public-brand small, .public-secure-label { font-size: 8px; letter-spacing: .1em; }
  .public-hero { gap: 6px; padding: 20px 0 14px; }
  .public-kicker { font-size: 8px; letter-spacing: .14em; }
  .public-hero h1 { font-size: clamp(35px, 10vw, 44px); line-height: 1.03; }
  .public-description { max-width: 100%; font-size: 12px; line-height: 1.55; }
  .public-hero-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 16px; }
  .public-login-button, .public-demo-button { min-width: 0; width: 100%; min-height: 46px; padding-inline: 11px; font-size: 11px; }
  .public-access-note { grid-column: 1 / -1; font-size: 9px; }
  .public-hero-art { min-height: 235px; }
  .public-workspace-card { padding: 12px 12px 10px; border-radius: 14px; }
  .public-workspace-mark, .public-workspace-access { font-size: 7px; }
  .public-workspace-heading { gap: 8px; }
  .public-workspace-heading strong { font-size: 13px; }
  .public-workspace-heading small { font-size: 8px; }
  .public-workspace-module { grid-template-columns: 25px minmax(0, 1fr) 18px; min-height: 43px; gap: 7px; padding: 6px 8px; }
  .public-workspace-module strong { font-size: 9px; }
  .public-workspace-module small { font-size: 8px; }
  .public-workspace-bottom { font-size: 6px; }
  .public-workspace-float { right: -3px; bottom: -2px; padding: 8px 10px; font-size: 7px; }
  .public-home-footer { min-height: 36px; gap: 10px; font-size: 7px; letter-spacing: .05em; }
  .public-home-footer span:last-child { text-align: right; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar, .main-area { transition: none !important; }
}


/* Refined gold + seamless navigation surface. */
:root { --gold: #c49a50; --gold-pale: #f3ead8; }
.sidebar {
  background: linear-gradient(165deg, #3f071f 0%, #470923 58%, #3b061d 100%);
  border-right: 1px solid rgb(214 180 112 / 13%);
  box-shadow: 8px 0 28px rgb(41 5 22 / 8%);
  transition: width 260ms cubic-bezier(.2,.75,.25,1), padding 260ms cubic-bezier(.2,.75,.25,1);
}
.main-area { transition: margin-left 260ms cubic-bezier(.2,.75,.25,1); }
.sidebar .nav-item { border-color: transparent; border-radius: 9px; }
.sidebar .nav-item.active {
  border-color: transparent;
  background: rgb(255 250 245 / 9%);
  color: #fffaf5;
  box-shadow: inset 3px 0 var(--gold);
}
.sidebar .nav-item.active .nav-icon { color: var(--gold); }
.sidebar .nav-item:hover { background: rgb(255 250 245 / 7%); }
.sidebar .brand { border-bottom: 1px solid rgb(255 255 255 / 10%); }
.sidebar .sidebar-toggle { border-color: rgb(196 154 80 / 25%); color: #d5b477; }
.sidebar .sidebar-toggle:hover { border-color: rgb(196 154 80 / 55%); background: rgb(196 154 80 / 10%); }
.workspace-label { border-color: rgb(255 255 255 / 10%); }
.sidebar-bottom { border-color: transparent; }

/* The welcome page is a complete landing page, not just a sign-in splash. */
.public-home { overflow-x: clip; overflow-y: visible; }
.public-capabilities {
  position: relative;
  z-index: 1;
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 68px 0 74px;
  border-top: 1px solid rgb(99 8 46 / 10%);
}
.public-section-heading { max-width: 690px; margin-bottom: 27px; }
.public-section-heading h2, .public-final-cta h2 {
  margin: 17px 0 0;
  color: var(--wine-deep);
  font: 700 clamp(31px, 4.1vw, 49px)/1.08 Georgia, serif;
  letter-spacing: -.035em;
}
.public-section-heading h2 em, .public-final-cta h2 em { color: var(--wine-soft); font-weight: 500; }
.public-section-heading p, .public-final-cta p {
  max-width: 590px;
  margin: 13px 0 0;
  color: #746b6e;
  font-size: 13px;
  line-height: 1.8;
}
.public-feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.public-feature-card {
  min-width: 0;
  min-height: 220px;
  padding: 20px 18px;
  border: 1px solid rgb(99 8 46 / 10%);
  border-radius: 13px;
  background: rgb(255 254 250 / 82%);
  box-shadow: 0 10px 28px rgb(52 25 37 / 4%);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.public-feature-card:hover { transform: translateY(-3px); border-color: rgb(196 154 80 / 55%); box-shadow: 0 15px 34px rgb(52 25 37 / 8%); }
.public-feature-index { color: #9b7b48; font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.public-feature-symbol {
  display: grid;
  width: 39px;
  height: 39px;
  margin: 19px 0 15px;
  place-items: center;
  border: 1px solid rgb(196 154 80 / 35%);
  border-radius: 11px;
  background: #f5efe2;
  color: #98713a;
  font: 700 19px Georgia, serif;
}
.public-feature-card h3 { margin: 0; color: var(--wine-deep); font: 700 17px Georgia, serif; }
.public-feature-card p { margin: 9px 0 0; color: #746b6e; font-size: 11px; line-height: 1.7; }
.public-proof-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 16px;
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 27px 30px 23px;
  border: 1px solid rgb(196 154 80 / 28%);
  border-radius: 14px;
  background: linear-gradient(110deg, #f4ecdc, #fbf8f1 52%, #f3e9ed);
}
.public-proof-strip > div { display: grid; gap: 4px; text-align: center; }
.public-proof-strip strong { color: var(--wine-deep); font: 700 30px Georgia, serif; }
.public-proof-strip span { color: #766c6f; font-size: 10px; }
.public-proof-strip p { grid-column: 1 / -1; margin: 2px 0 0; color: #8a7d7e; font-size: 9px; text-align: center; }
.public-final-cta {
  display: flex;
  width: min(1240px, 100%);
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin: 54px auto 0;
  padding: 39px clamp(22px, 4vw, 52px);
  border-radius: 17px 17px 0 0;
  background: linear-gradient(112deg, #42061f 0%, #5a0b2e 70%, #6b173b 100%);
}
.public-final-cta .public-kicker { color: #e5cfaa; }
.public-final-cta .public-kicker span { background: var(--gold); }
.public-final-cta h2 { color: #fffaf5; font-size: clamp(29px, 3.4vw, 42px); }
.public-final-cta h2 em { color: #e0c38b; }
.public-final-cta p { color: #e3d1d7; }
.public-final-actions { display: grid; min-width: 205px; gap: 14px; justify-items: center; }
.public-final-actions .button { width: 100%; min-height: 48px; justify-content: space-between; padding-inline: 18px; border-color: var(--gold); background: var(--gold); color: #35101f; }
.public-final-actions .button:hover { border-color: #d6b878; background: #d6b878; }
.public-final-demo { color: #f1e4ca; font-size: 10px; text-underline-offset: 4px; }
.public-home-footer { margin-top: 0; }
@media (max-width: 1000px) {
  .public-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .public-feature-card { min-height: 190px; }
}
@media (max-width: 700px) {
  .public-capabilities { padding: 43px 0 48px; }
  .public-section-heading h2 { font-size: 34px; }
  .public-feature-grid { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .public-feature-card { min-height: 0; padding: 16px; }
  .public-feature-symbol { margin: 12px 0 10px; }
  .public-proof-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding: 18px 10px 14px; }
  .public-proof-strip strong { font-size: clamp(20px, 7vw, 27px); }
  .public-proof-strip span { font-size: 8px; line-height: 1.4; }
  .public-proof-strip p { font-size: 8px; line-height: 1.5; }
  .public-final-cta { display: grid; gap: 21px; margin-top: 34px; padding: 25px 18px; border-radius: 14px 14px 0 0; }
  .public-final-actions { width: 100%; justify-items: stretch; }
  .public-final-demo { text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar, .main-area, .public-feature-card { transition: none !important; }
}

/* Cloudflare-inspired navigation: quiet white rail, clear hierarchy, compact active state. */
:root {
  --cf-ink: #242a31;
  --cf-muted: #69727d;
  --cf-line: #e5e7eb;
  --cf-surface: #ffffff;
  --cf-hover: #f5f6f7;
  --cf-accent: #c49a50;
}
.sidebar {
  width: 252px;
  padding: 18px 13px 14px;
  overflow-x: hidden;
  border-right: 1px solid var(--cf-line);
  background: #fff;
  color: var(--cf-ink);
  box-shadow: 1px 0 0 rgb(20 30 40 / 2%);
}
.main-area { margin-left: 252px; }
.sidebar-brand-row { min-height: 58px; margin-bottom: 13px; padding: 0 4px 12px; border-bottom: 1px solid var(--cf-line); }
.sidebar .brand { min-height: 48px; gap: 10px; padding: 0; color: var(--cf-ink); }
.sidebar .crest { width: 39px; height: 43px; }
.sidebar .brand-copy { gap: 3px; letter-spacing: .06em; }
.sidebar .brand-copy strong { color: #252b33; font: 750 12px/1.2 Inter, "Segoe UI", Arial, sans-serif; letter-spacing: .11em; }
.sidebar .brand-copy small { color: #8a6b36; font-size: 8px; letter-spacing: .1em; }
.sidebar .sidebar-toggle {
  width: 29px; height: 29px; border: 1px solid #e1e4e8; border-radius: 6px;
  background: #fff; color: #59636e; box-shadow: none;
}
.sidebar .sidebar-toggle-icon, .sidebar .sidebar-toggle-icon::before {
  border-color: currentColor; background: currentColor;
}
.sidebar .nav-label {
  display: flex; align-items: center; gap: 8px; padding: 16px 10px 7px;
  color: #818a95; font-size: 9px; font-weight: 750; letter-spacing: .09em;
}
.sidebar .nav-label::before { width: 3px; height: 3px; border-radius: 50%; background: #c49a50; content: ""; }
.sidebar .nav-list { gap: 2px; }
.sidebar .nav-item {
  min-height: 37px; gap: 10px; padding: 0 10px; border: 0; border-radius: 5px;
  color: #424b55; font-size: 11px; font-weight: 550; transition: background .15s ease, color .15s ease;
}
.sidebar .nav-item:hover { background: #f4f5f6; color: #1f252c; }
.sidebar .nav-item.active {
  border: 0; background: #f1f2f3; color: #20262d; box-shadow: inset 3px 0 #c49a50;
  font-weight: 700;
}
.sidebar .nav-icon { width: 18px; color: #747e89; font-size: 15px; }
.sidebar .nav-item.active .nav-icon { color: #9b773d; }
.sidebar .nav-label-spaced { padding-top: 17px; }
.sidebar .sidebar-bottom { padding-top: 14px; }
.sidebar .workspace-label {
  gap: 5px; margin: 0 1px 10px; padding: 12px 9px;
  border-top: 1px solid var(--cf-line); border-bottom: 1px solid var(--cf-line);
}
.sidebar .workspace-label span, .sidebar .workspace-label small { color: #7c8792; font-size: 8px; letter-spacing: .08em; }
.sidebar .workspace-label strong { color: #775b2f; font: 700 11px Georgia, serif; }
.sidebar .legal-link { min-height: 29px; color: #69727d; font-size: 10px; }
.sidebar .legal-link:hover { background: #f4f5f6; color: #252b33; }
.sidebar .user-chip { gap: 9px; margin-top: 9px; padding: 10px 7px 2px; border-top: 1px solid var(--cf-line); }
.sidebar .user-avatar { background: #f2eadb; color: #75592e; }
.sidebar .user-chip strong { color: #313943; }
.sidebar .user-chip small { color: #7b8590; }
.sidebar .text-button { color: #8a6b36; }
.sidebar-collapsed .sidebar { width: 72px; padding-right: 9px; padding-left: 9px; }
.sidebar-collapsed .main-area { margin-left: 72px; }
.sidebar-collapsed .sidebar .nav-item.active { box-shadow: inset 3px 0 #c49a50; }
.sidebar-collapsed .sidebar-toggle { top: 9px; right: 5px; border-color: #e1e4e8; background: #fff; color: #59636e; box-shadow: 0 1px 3px rgb(0 0 0 / 5%); }
@media (max-width: 1280px) {
  .sidebar { width: 72px; padding-right: 9px; padding-left: 9px; }
  .main-area { margin-left: 72px; }
  .sidebar .brand-copy, .sidebar .nav-label, .sidebar .workspace-label, .sidebar .sidebar-bottom .legal-link,
  .sidebar .user-chip > span:nth-child(2), .sidebar .user-chip .text-button { display: none; }
  .sidebar .sidebar-brand-row { justify-content: center; }
  .sidebar .sidebar-brand-row .brand { justify-content: center; }
  .sidebar .nav-item { justify-content: center; gap: 0; padding: 0; font-size: 0; }
  .sidebar .nav-icon { width: auto; font-size: 17px; }
  .sidebar .user-chip { justify-content: center; }
  .sidebar .sidebar-toggle { position: absolute; top: 9px; right: 5px; }
}
@media (max-width: 700px) {
  .sidebar { width: min(310px, 86vw); padding: 15px 13px 16px; background: #fff; }
  .sidebar .sidebar-brand-row { justify-content: space-between; }
  .sidebar .brand-copy { display: grid; }
  .sidebar .nav-label { display: flex; }
  .sidebar .workspace-label, .sidebar .sidebar-bottom .legal-link, .sidebar .user-chip > span:nth-child(2),
  .sidebar .user-chip .text-button { display: revert; }
  .sidebar .nav-item { justify-content: flex-start; gap: 10px; padding: 0 10px; font-size: 11px; }
  .sidebar .nav-icon { width: 18px; font-size: 15px; }
  .sidebar .user-chip { justify-content: flex-start; }
}

/* The landing page has multiple real sections; let it grow instead of stacking them into one viewport. */
body.auth-pending { overflow-x: clip; overflow-y: auto; }
.public-home {
  height: auto;
  min-height: 100svh;
  overflow-x: clip;
  overflow-y: visible;
}
.public-home-header { min-height: 78px; }
.public-hero {
  min-height: min(760px, calc(100svh - 140px));
  flex: 0 0 auto;
  padding: clamp(38px, 6vh, 72px) 0;
}
.public-hero-copy, .public-hero-art { min-width: 0; }
.public-hero h1 { overflow-wrap: anywhere; }
.public-description { overflow-wrap: anywhere; }
.public-capabilities, .public-proof-strip, .public-final-cta, .public-home-footer {
  position: relative; z-index: 1; width: min(1300px, 100%); margin-right: auto; margin-left: auto;
}
.public-capabilities { padding: 66px 0 76px; }
.public-section-heading { max-width: 680px; margin-bottom: 30px; }
.public-section-heading h2, .public-final-cta h2 { line-height: 1.08; overflow-wrap: anywhere; }
.public-feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.public-feature-card { min-width: 0; }
.public-feature-card h3, .public-feature-card p { overflow-wrap: anywhere; }
.public-proof-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 26px; padding: 25px 0; }
.public-proof-strip > div { min-width: 130px; }
.public-proof-strip p { flex: 1 1 240px; }
.public-final-cta { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 48px 0; }
.public-final-cta > div:first-child { min-width: 0; max-width: 720px; }
.public-final-actions { flex: 0 0 auto; }
.public-home-footer { min-height: 62px; }
@media (max-width: 1000px) {
  .public-hero { min-height: 0; grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 42px 0 50px; }
  .public-hero-art { min-height: 360px; }
  .public-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .public-final-cta { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 700px) {
  .public-home { padding-inline: 20px; }
  .public-home-header { min-height: 68px; }
  .public-hero { display: grid; gap: 18px; padding: 34px 0 38px; }
  .public-hero h1 { font-size: clamp(36px, 9vw, 54px); line-height: 1.04; }
  .public-description { font-size: 13px; line-height: 1.65; }
  .public-hero-art { display: grid; min-height: 300px; }
  .public-capabilities { padding: 42px 0 48px; }
  .public-feature-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .public-proof-strip { gap: 16px; padding: 22px 0; }
  .public-final-cta { gap: 20px; padding: 36px 0; }
  .public-home-footer { flex-wrap: wrap; gap: 9px; padding: 14px 0; }
}
@media (max-width: 420px) {
  .public-home { padding-inline: 16px; }
  .public-hero h1 { font-size: clamp(33px, 9.5vw, 43px); }
  .public-workspace-card { padding: 13px 12px; }
  .public-workspace-bottom { flex-wrap: wrap; }
}



/* Presentation release: fixed, labelled navigation. No collapsible desktop sidebar. */
.sidebar {
  width: 252px !important;
  padding: 18px 13px 14px !important;
  border-right: 1px solid #e5e7eb !important;
  background: #fff !important;
  color: #242a31 !important;
  box-shadow: 1px 0 0 rgb(20 30 40 / 2%) !important;
  transition: none !important;
  will-change: auto !important;
}
.main-area { margin-left: 252px !important; transition: none !important; }
.sidebar-brand-row { justify-content: flex-start !important; min-height: 58px; margin-bottom: 13px; padding: 0 4px 12px; border-bottom: 1px solid #e5e7eb; }
.sidebar .brand { min-height: 48px; gap: 10px; padding: 0; color: #242a31; }
.sidebar .brand-copy { display: grid !important; gap: 3px; }
.sidebar .brand-copy strong { color: #252b33; font: 750 12px/1.2 Inter, "Segoe UI", Arial, sans-serif; letter-spacing: .11em; }
.sidebar .brand-copy small { color: #8a6b36; font-size: 8px; letter-spacing: .1em; }
.sidebar .sidebar-toggle { display: none !important; }
.sidebar .nav-label { display: flex !important; align-items: center; gap: 8px; padding: 16px 10px 7px; color: #818a95; font-size: 9px; font-weight: 750; letter-spacing: .09em; }
.sidebar .nav-label::before { width: 3px; height: 3px; border-radius: 50%; background: #c49a50; content: ""; }
.sidebar .nav-list { display: grid !important; gap: 2px; overflow: visible; }
.sidebar .nav-item { display: flex !important; width: 100%; min-height: 37px; justify-content: flex-start !important; gap: 10px !important; padding: 0 10px !important; border: 0; border-radius: 5px; color: #424b55; font-size: 11px !important; font-weight: 550; }
.sidebar .nav-item:hover { background: #f4f5f6; color: #1f252c; }
.sidebar .nav-item.active { border: 0; background: #f1f2f3; color: #20262d; box-shadow: inset 3px 0 #c49a50; font-weight: 700; }
.sidebar .nav-icon { width: 18px !important; color: #747e89; font-size: 15px !important; }
.sidebar .nav-item.active .nav-icon { color: #9b773d; }
.sidebar .sidebar-bottom { display: block !important; margin-top: auto; padding-top: 14px; }
.sidebar .workspace-label { display: grid !important; gap: 5px; margin: 0 1px 10px; padding: 12px 9px; border-top: 1px solid #e5e7eb; border-bottom: 1px solid #e5e7eb; }
.sidebar .workspace-label span, .sidebar .workspace-label small { color: #7c8792; font-size: 8px; letter-spacing: .08em; }
.sidebar .workspace-label strong { color: #775b2f; font: 700 11px Georgia, serif; }
.sidebar .legal-link { display: flex !important; min-height: 29px; color: #69727d; font-size: 10px !important; }
.sidebar .user-chip { display: flex !important; gap: 9px; margin-top: 9px; padding: 10px 7px 2px; border-top: 1px solid #e5e7eb; }
.sidebar .user-chip > span:nth-child(2) { display: grid !important; }
.sidebar .user-chip .text-button { display: inline-flex !important; }
.sidebar-collapsed .sidebar, .sidebar-collapsed .main-area { width: auto !important; }
@media (min-width: 701px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; }
  .main-area { width: calc(100% - 252px); min-width: 0; }
}
@media (max-width: 1280px) and (min-width: 701px) {
  .sidebar { width: 252px !important; padding: 18px 13px 14px !important; }
  .main-area { margin-left: 252px !important; }
  .sidebar .brand-copy, .sidebar .nav-label, .sidebar .workspace-label, .sidebar .sidebar-bottom .legal-link,
  .sidebar .user-chip > span:nth-child(2), .sidebar .user-chip .text-button { display: revert !important; }
  .sidebar .nav-item { justify-content: flex-start !important; gap: 10px !important; padding: 0 10px !important; font-size: 11px !important; }
  .sidebar .nav-icon { width: 18px !important; font-size: 15px !important; }
  .sidebar .user-chip { justify-content: flex-start !important; }
}
@media (max-width: 700px) {
  .sidebar { width: min(310px, 86vw) !important; padding: 15px 13px 16px !important; }
  .sidebar .brand-copy, .sidebar .nav-label, .sidebar .workspace-label, .sidebar .sidebar-bottom .legal-link,
  .sidebar .user-chip > span:nth-child(2), .sidebar .user-chip .text-button { display: revert !important; }
  .sidebar .nav-list { display: grid !important; }
  .sidebar .nav-item { justify-content: flex-start !important; gap: 10px !important; padding: 0 10px !important; font-size: 11px !important; }
  .sidebar .nav-icon { width: 18px !important; font-size: 15px !important; }
  .sidebar .user-chip { justify-content: flex-start !important; }
  .main-area { width: 100%; margin-left: 0 !important; }
}
@media (prefers-reduced-motion: reduce) { .sidebar, .main-area { transition: none !important; } }
