:root {
  --ink: #1d2430;
  --muted: #687386;
  --paper: #fbfaf6;
  --surface: #ffffff;
  --line: #d9dee8;
  --accent: #2364aa;
  --accent-dark: #174575;
  --mint: #dcefe4;
  --rose: #f5dedb;
  --amber: #f5d48b;
  --folder: #d6b46f;
  --folder-dark: #a9823e;
  --pen: #1e55a6;
  --shadow: 0 18px 50px rgba(29, 36, 48, 0.14);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

body {
  --desk-width: max(138vw, calc(138vh * 1.7778));
  --desk-shift: calc(100vw - var(--desk-width));
  margin: 0;
  color: var(--ink);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.1), transparent 34%),
    linear-gradient(135deg, #4c453f, #36322f 54%, #2c2927);
  transition: background-color 520ms cubic-bezier(0.18, 0.86, 0.28, 1);
}

body::before {
  content: "";
  position: fixed;
  top: -16vh;
  left: 0;
  z-index: 0;
  width: var(--desk-width);
  height: 138vh;
  pointer-events: none;
  background: url("assets/textures/desktop.png") center / cover no-repeat;
  transform: translateX(var(--desk-shift));
  transition: transform 520ms cubic-bezier(0.18, 0.86, 0.28, 1);
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

.app-shell.in-session {
  grid-template-columns: 1fr;
  height: 100vh;
  overflow: hidden;
}

.app-shell.in-session .sidebar {
  display: none;
}

.sidebar {
  display: none;
  flex-direction: column;
  gap: 28px;
  padding: 28px;
  color: #f7fbff;
  background: #17202d;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: #17202d;
  background: var(--amber);
  font-weight: 800;
}

.brand h1,
.brand p,
.screen-header h2,
.session-header h2,
.briefing-panel h3,
.session-notes h3,
.file-page h3 {
  margin: 0;
}

.brand h1 {
  font-size: 1.2rem;
}

.brand p,
.therapist-card p {
  margin: 4px 0 0;
  color: #b8c5d8;
  font-size: 0.88rem;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 8px;
  color: #dbe6f7;
  background: transparent;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
}

.therapist-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.therapist-card strong {
  display: block;
  margin: 8px 0 12px;
}

.xp-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.xp-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--amber);
  transition: width 220ms ease;
}

main {
  position: relative;
  min-width: 0;
  padding: 24px clamp(14px, 4vw, 44px);
  overflow-x: clip;
}

.screen {
  display: none;
  min-height: calc(100vh - 64px);
}

.screen.active {
  display: block;
}

.screen.desk-leaving {
  position: fixed;
  inset: 24px clamp(14px, 4vw, 44px) auto;
  z-index: 6;
  display: block;
  min-height: calc(100vh - 64px);
  pointer-events: none;
}

.screen.desk-leaving .screen-header {
  visibility: hidden;
}

.auth-layout {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 48px);
}

.auth-card {
  width: min(460px, 100%);
  padding: 28px;
  border: 2px solid var(--folder-dark);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.auth-logo-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;

  margin: -8px -12px 0px;
  padding: 18px 12px 8px;

  border-radius: 8px;
  background: var(--paper);
}

.auth-brand-title {
  margin: 0px 0 6px;
  color: var(--accent-dark);

  font-size: clamp(2rem, 5.5vw, 3rem);
  line-height: 1;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.auth-brand-subtitle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  margin: 14px 0 10px;

  color: #5c7696;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.auth-brand-subtitle::before,
.auth-brand-subtitle::after {
  content: "";

  width: 42px;
  height: 1px;

  background: #8ea7c4;
  opacity: 0.7;
}

.auth-description {
  margin-top: 12px;

  color: var(--muted);
  line-height: 1.55;
}

.auth-logo {
  width: 140px;
  height: auto;
  display: block;
  margin: 0 auto 12px;
}

.auth-card h2 {
  margin: 6px 0 6px;
  color: var(--pen);
  font-size: clamp(2rem, 5.5vw, 3rem);
  line-height: 1;
  white-space: nowrap;
}

.auth-card p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.55;
}

.auth-card .auth-subtitle {
  margin-bottom: 12px;
  color: var(--accent-dark);
  font-size: 1rem;
  font-weight: 850;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin: 22px 0;
  padding: 4px;
  border-radius: 8px;
  background: #e9edf0;
}

.auth-tab {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.auth-tab.active {
  color: #ffffff;
  background: var(--accent);
}

.auth-form {
  display: grid;
  gap: 9px;
}

.auth-form label {
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.auth-form input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
}

.register-only {
  display: none;
}

.register-only.show {
  display: block;
}

.auth-error {
  min-height: 22px;
  margin: 4px 0 0;
  color: #9c2e2e;
  font-weight: 800;
}

.screen-header,
.session-header {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) auto minmax(260px, 1fr);
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
}

.session-header {
  display: flex;
  justify-content: space-between;
}

.app-shell.in-session main {
  display: block;
  height: 100vh;
  height: 100dvh;
  padding: 20px;
  overflow: hidden;
}

.app-shell.in-session #sessionScreen.active,
.app-shell.in-session #supervisorScreen.active {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.app-shell.in-session .session-header {
  margin-bottom: 14px;
}

.app-shell.in-session .session-header h2 {
  font-size: clamp(1.5rem, 3vw, 2.4rem);
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.session-actions [hidden] {
  display: none;
}

.screen-header h2,
.session-header h2 {
  color: #fff7e8;
  font-size: clamp(1.65rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 2px 18px rgba(28, 12, 3, 0.45);
}

.screen-header h2 {
  justify-self: center;
  text-align: center;
}

.menu-wrap {
  position: relative;
  justify-self: start;
}

.session-menu-wrap {
  justify-self: auto;
}

.session-menu-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 40px;
  border: 1px solid rgba(255, 247, 232, 0.46);
  border-radius: 8px;
  color: #fff7e8;
  background: rgba(255, 255, 255, 0.1);
  font-size: 1.12rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 12px rgba(28, 12, 3, 0.38);
}

.session-menu-button:hover,
.session-menu-button[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.18);
}

.session-options-menu button[aria-pressed="true"]::after {
  content: "On";
  margin-left: auto;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hamburger-button {
  display: grid;
  gap: 4px;
  width: 42px;
  height: 38px;
  place-content: center;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 247, 232, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 247, 232, 0.22);
}

.hamburger-button span {
  display: block;
  width: 19px;
  height: 3px;
  border-radius: 999px;
  background: #fff7e8;
  box-shadow: 0 1px 5px rgba(28, 12, 3, 0.3);
}

.app-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  min-width: 220px;
  padding: 8px;
  border: 1px solid rgba(58, 34, 16, 0.24);
  border-radius: 8px;
  background: #fffaf0;
  box-shadow: var(--shadow);
}

.app-menu[hidden] {
  display: none;
}

.menu-account {
  display: grid;
  gap: 2px;
  max-width: 240px;
  margin-bottom: 6px;
  padding: 7px 8px 9px;
  border-bottom: 1px solid rgba(58, 34, 16, 0.16);
  color: #51351f;
}

.menu-account strong,
.menu-account span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-account strong {
  font-weight: 900;
}

.menu-account span {
  color: #746450;
  font-size: 0.82rem;
}

.app-menu button,
.app-menu a {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 2px 6px;
  border: 0;
  border-radius: 6px;
  color: #51351f;
  background: transparent;
  font: inherit;
  font-weight: 850;
  text-align: left;
  text-decoration: none;
}

.app-menu button:hover,
.app-menu a:hover {
  background: #efe1c6;
}

.session-menu-wrap .session-options-menu {
  left: auto;
  right: 0;
  min-width: 180px;
}

.desk-link {
  padding: 0;
  border: 0;
  color: #fff7e8;
  background: transparent;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-shadow: 0 2px 14px rgba(28, 12, 3, 0.48);
}

.desk-link:hover {
  color: #ffffff;
}

.desk-link.active {
  color: #ffffff;
  text-decoration-thickness: 3px;
}

.top-actions {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-self: end;
}

.screen.slide-from-left .folder-stage,
.screen.slide-from-left .archive-stage {
  animation: desk-in-from-left 380ms cubic-bezier(0.18, 0.86, 0.28, 1);
}

.screen.slide-from-right .folder-stage,
.screen.slide-from-right .archive-stage {
  animation: desk-in-from-right 380ms cubic-bezier(0.18, 0.86, 0.28, 1);
}

.screen.desk-leave-left .folder-stage,
.screen.desk-leave-left .archive-stage {
  animation: desk-out-to-left 380ms cubic-bezier(0.55, 0, 0.38, 1) forwards;
}

.screen.desk-leave-right .folder-stage,
.screen.desk-leave-right .archive-stage {
  animation: desk-out-to-right 380ms cubic-bezier(0.55, 0, 0.38, 1) forwards;
}

@keyframes desk-in-from-left {
  from {
    opacity: 0.92;
    transform: translateX(-110vw);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes desk-in-from-right {
  from {
    opacity: 0.92;
    transform: translateX(110vw);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes desk-out-to-left {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0.92;
    transform: translateX(-110vw);
  }
}

@keyframes desk-out-to-right {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0.92;
    transform: translateX(110vw);
  }
}

.eyebrow {
  display: block;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.primary-action,
.secondary-action,
.danger-action,
.icon-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  font-weight: 750;
}

.primary-action {
  padding: 0 18px;
  color: #ffffff;
  background: var(--accent);
}

.primary-action:hover {
  background: var(--accent-dark);
}

.secondary-action {
  padding: 0 18px;
  color: var(--accent-dark);
  background: #dce8f6;
}

.secondary-action.active,
.secondary-action[aria-pressed="true"] {
  color: #ffffff;
  background: var(--accent);
}

.danger-action {
  padding: 0 18px;
  color: #ffffff;
  background: #9f3d36;
}

.danger-action:hover {
  background: #812d28;
}

.quiet-action {
  color: #687386;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(104, 115, 134, 0.22);
}

.icon-button {
  width: 42px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 1.6rem;
}

.waiting-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
}

.client-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.client-card,
.briefing-panel,
.session-notes,
.chat-panel,
.score-card,
.review-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(29, 36, 48, 0.06);
}

.client-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.client-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.client-card h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.client-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.badge {
  align-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  color: #4d2c00;
  background: var(--amber);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.briefing-panel {
  padding: 20px;
  align-self: start;
}

.briefing-panel h3 {
  margin-top: 8px;
}

.briefing-panel ul {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.session-workspace {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  min-height: 0;
  overflow: hidden;
}

.session-workspace.lens-open {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
}

.session-notes {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: none;
  width: min(460px, calc(100% - 20px));
  padding: 20px;
  max-height: calc(100vh - 88px);
  overflow: visible;
  box-shadow: var(--shadow);
}

.session-notes.open {
  display: block;
}

.session-notes h3 {
  margin-top: 8px;
  font-size: 1.45rem;
}

.session-notes p {
  color: var(--muted);
  line-height: 1.55;
}

.session-note-history {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.session-note-history[hidden] {
  display: none;
}

.session-note-history section {
  display: grid;
  gap: 6px;
}

.session-note-history h4 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.session-note-history p {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.45;
}

.session-notes-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(217, 222, 232, 0.9);
}

.session-file-link {
  padding: 0;
  border: 0;
  color: var(--accent-dark);
  background: transparent;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.session-file-link:hover {
  color: var(--accent);
}

dl {
  display: grid;
  gap: 14px;
  margin: 20px 0 0;
}

dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
}

.chat-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.supervisor-lens {
  display: none;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(29, 36, 48, 0.08);
}

.supervisor-lens.open {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.supervisor-lens header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 10px;
  border-bottom: 1px solid rgba(217, 222, 232, 0.8);
}

.supervisor-lens h3,
.supervisor-lens h4 {
  margin: 0;
}

.supervisor-lens h3 {
  font-size: 1rem;
}

.supervisor-lens h4 {
  color: var(--accent-dark);
  font-size: 0.85rem;
}

.guide-position-toggle {
  display: inline-grid;
  place-items: center;
  width: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid rgba(35, 100, 170, 0.18);
  border-radius: 999px;
  color: var(--accent-dark);
  background: #edf4fb;
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1;
}

.guide-position-toggle:hover {
  border-color: rgba(35, 100, 170, 0.36);
  background: #e2eef9;
}

.lens-scroll {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
}

.lens-section {
  display: grid;
  gap: 9px;
}

.lens-section[hidden] {
  display: none;
}

.lens-content {
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.52;
}

.lens-content p,
.lens-content ul,
.suggested-replies-list p {
  margin: 0;
}

.suggested-replies-list {
  display: grid;
  gap: 10px;
}

.supervisor-lens .suggested-replies {
  display: none;
}

.suggested-reply {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(35, 100, 170, 0.24);
  border-radius: 8px;
  color: var(--ink);
  background: #f6f9fd;
  text-align: left;
  box-shadow: 0 3px 8px rgba(29, 36, 48, 0.08);
}

.suggested-reply:hover {
  border-color: rgba(35, 100, 170, 0.42);
  color: var(--ink);
  background: #edf5ff;
}

.suggested-reply span {
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.suggested-reply strong {
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.42;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 22px;
  overflow-y: auto;
  scrollbar-width: none;
}

.chat-log::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.message {
  max-width: min(680px, 86%);
  padding: 13px 15px;
  border-radius: 8px;
  line-height: 1.5;
}

.message p {
  margin: 0;
}

.message p + p,
.message ul + p,
.message p + ul {
  margin-top: 10px;
}

.message ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
}

.message strong {
  font-weight: 850;
}

.message.client {
  align-self: flex-start;
  background: #eef4f0;
}

.message.supervisor {
  align-self: flex-start;
  max-width: min(720px, 92%);
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(21, 31, 45, 0.08);
}

.message.therapist {
  align-self: flex-end;
  color: #ffffff;
  background: var(--accent);
}

.message.meta {
  align-self: center;
  max-width: 100%;
  color: var(--muted);
  background: #f0f2f5;
  font-size: 0.9rem;
}

.chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #f7f8fa;
}

.mobile-suggested-replies {
  display: none;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 12px;
  background: #f7f8fa;
}

#sessionScreen.suggestions-on .chat-panel {
  grid-template-rows: minmax(0, 1fr) auto auto;
}

#sessionScreen.suggestions-on .chat-composer {
  display: none;
}

#sessionScreen.suggestions-on .mobile-suggested-replies {
  display: grid;
}

.suggested-end-session {
  justify-self: end;
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.86rem;
}

.chat-composer .primary-action,
.composer-end {
  min-height: 38px;
  padding: 0 12px;
}

.composer-actions {
  display: grid;
  gap: 8px;
}

.composer-end {
  font-size: 0.82rem;
  line-height: 1.1;
}

textarea {
  width: 100%;
  min-height: 58px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
}

.app-shell.in-session textarea {
  resize: none;
}

.review-layout {
  display: grid;
  gap: 16px;
}

.review-actions {
  display: flex;
  justify-content: flex-end;
  justify-self: end;
  flex-wrap: wrap;
  gap: 10px;
}

.review-header .review-title-block {
  grid-column: 2;
  justify-self: center;
  text-align: center;
}

.review-header .review-actions {
  grid-column: 3;
}

.review-back-link {
  align-self: center;
  min-height: auto;
  border-radius: 0;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 340px;
  border: 1px dashed #aeb8c7;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
}

.account-page {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 980px;
  margin: 0 auto;
}

.account-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(29, 36, 48, 0.08);
}

.account-summary {
  grid-column: 1 / -1;
}

.account-summary strong {
  color: var(--accent-dark);
  font-size: 1.45rem;
}

.account-summary p,
.danger-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.account-panel h3 {
  margin: 0;
}

.account-form {
  display: grid;
  gap: 9px;
}

.account-form label {
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.account-form input:not([type="checkbox"]) {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
}

.preference-fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.preference-fieldset legend {
  margin-bottom: 2px;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.preference-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(35, 100, 170, 0.16);
  border-radius: 8px;
  background: #f7f9fc;
}

.preference-option input {
  width: 18px;
  height: 18px;
}

.preference-option span {
  display: grid;
  gap: 3px;
}

.preference-option strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.preference-option small {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  letter-spacing: 0;
  text-transform: none;
}

.checkbox-line input {
  width: 18px;
  height: 18px;
}

.account-status {
  min-height: 22px;
  margin: 0;
  color: var(--accent-dark);
  font-weight: 800;
}

.danger-panel {
  border-color: rgba(159, 61, 54, 0.22);
  background: rgba(255, 248, 247, 0.96);
}

.score-card {
  padding: 20px;
}

.review-score-summary {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(320px, 1.4fr);
  gap: 22px;
  align-items: center;
}

.review-summary {
  display: grid;
  gap: 10px;
  align-content: center;
}

.supervisor-discuss-action {
  justify-self: start;
  margin-top: 6px;
}

.supervisor-workspace {
  grid-template-columns: minmax(0, 1fr);
}

.score-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin: 6px 0 16px;
}

.score-number {
  margin: 0;
  color: var(--ink);
  font-size: clamp(4.8rem, 12vw, 7rem);
  font-weight: 850;
  line-height: 0.9;
}

.score-level {
  display: grid;
  gap: 8px;
  margin: 0;
}

.score-level span {
  color: var(--accent-dark);
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 900;
  line-height: 1.05;
}

.score-level p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.score-meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ebf2;
}

.score-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a9a9a9, #d5a43a, #3577b8, #3d8d65);
}

.score-meter.small {
  height: 7px;
}

.score-help-link {
  justify-self: end;
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.score-card p,
.review-section p,
.file-page p {
  color: var(--muted);
  line-height: 1.55;
}

.review-client-line {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
}

.review-client-line span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
}

.review-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.review-appendix {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.review-detail {
  min-width: min(260px, 100%);
  text-align: center;
}

.review-detail summary {
  display: inline-grid;
  min-height: 38px;
  align-items: center;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--accent-dark);
  background: #dce8f6;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.review-detail summary::-webkit-details-marker {
  display: none;
}

.review-detail[open] {
  display: block;
  flex-basis: 100%;
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  text-align: center;
}

.review-detail[open] summary {
  margin-bottom: 10px;
}

.review-detail[open] > p {
  text-align: left;
}

.transcript-detail {
  margin-top: 12px;
  text-align: center;
}

.review-detail[open] .transcript-detail summary {
  display: inline;
  min-height: 0;
  margin: 0;
  padding: 0;
  border-radius: 0;
  color: var(--accent);
  background: transparent;
  font-size: 0.9rem;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.review-section {
  padding: 18px;
}

.review-section-strengths {
  border-color: rgba(61, 141, 101, 0.18);
  background: rgba(244, 250, 246, 0.96);
}

.review-section-focus {
  border-color: rgba(196, 139, 55, 0.2);
  background: rgba(255, 249, 239, 0.96);
}

.review-section.flat {
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.review-section h3 {
  margin: 0 0 12px;
}

.review-section ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.domain-list,
.rubric-grid {
  display: grid;
  gap: 12px;
}

.level-guide {
  display: grid;
  gap: 10px;
}

.level-guide.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
}

.level-guide-row {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 4px 10px;
  padding: 7px 0 7px 16px;
  border-bottom: 1px solid var(--line);
}

.level-guide-row::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 6px;
  border-radius: 999px;
  background: #9aa3af;
}

.level-guide-row:nth-child(1)::before {
  background: #b45353;
}

.level-guide-row:nth-child(2)::before {
  background: #c47b37;
}

.level-guide-row:nth-child(3)::before {
  background: #d0a334;
}

.level-guide-row:nth-child(4)::before {
  background: #6f9f6b;
}

.level-guide-row:nth-child(5)::before {
  background: #367eb3;
}

.level-guide-row:nth-child(6)::before {
  background: #6554b6;
}

.level-guide-row:nth-child(7)::before {
  background: #358a7b;
}

.level-guide-row:last-child {
  border-bottom: 0;
}

.level-guide-row span {
  color: var(--accent-dark);
  font-weight: 900;
}

.level-guide-row p {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.rubric-note {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.5;
}

.domain-score {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.domain-score:last-child {
  border-bottom: 0;
}

.domain-score div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.domain-score strong,
.rubric-item strong {
  color: var(--ink);
}

.domain-score span {
  color: var(--muted);
  font-weight: 750;
}

.rubric-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rubric-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.rubric-item p,
.rubric-item span {
  display: block;
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.rubric-item span {
  color: var(--accent-dark);
  font-weight: 750;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(17, 24, 35, 0.48);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  width: min(880px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  padding: 22px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-panel h2 {
  margin: 0;
}

.hint-panel {
  width: min(520px, 100%);
}

.hint-content {
  color: var(--ink);
  line-height: 1.55;
}

.hint-content p,
.hint-content ul {
  margin: 0;
}

.hint-content p + p,
.hint-content ul + p,
.hint-content p + ul {
  margin-top: 12px;
}

.hint-loading {
  color: var(--muted);
}

.confirm-panel {
  width: min(460px, 100%);
}

.confirm-panel p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.folder-stage {
  display: grid;
  place-items: center;
  height: calc(100vh - 104px);
  min-height: 0;
  touch-action: pan-y;
}

.case-folder {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1060px, 100%);
  height: 100%;
  min-height: 0;
  padding: 5px 22px 22px;
  border: 2px solid var(--folder-dark);
  border-radius: 8px;
  background:
    linear-gradient(0deg, rgba(75, 50, 16, 0.08), transparent 34%),
    var(--folder);
  box-shadow: var(--shadow);
}

.active-client-folder {
  perspective: 1400px;
}

.active-client-folder .folder-cover {
  position: absolute;
  inset: -2px;
  z-index: 4;
  border: 2px solid var(--folder-dark);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.2), transparent 18%, rgba(74, 43, 12, 0.14)),
    linear-gradient(0deg, rgba(75, 50, 16, 0.1), transparent 34%),
    var(--folder);
  box-shadow: 0 20px 42px rgba(29, 36, 48, 0.16);
  pointer-events: none;
  transform: translateX(calc(-100% + 10px)) scaleX(1.045) skewY(-0.55deg);
  transform-origin: right center;
}

.active-client-folder .folder-cover::before {
  content: "";
  position: absolute;
  top: 28px;
  left: 28px;
  width: 126px;
  height: 42px;
  border: 2px solid var(--folder-dark);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: var(--folder);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.22);
}

.active-client-folder .folder-cover::after {
  content: "CONFIDENTIAL CASE FILES";
  position: absolute;
  top: 44%;
  left: 50%;
  width: min(640px, 78%);
  padding: 12px 18px;
  border: 4px solid rgba(151, 31, 25, 0.72);
  color: rgba(151, 31, 25, 0.78);
  font-family: Impact, "Arial Black", Inter, ui-sans-serif, sans-serif;
  font-size: clamp(2rem, 5vw, 4.6rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 1px 0 rgba(151, 31, 25, 0.18);
  opacity: 0.78;
  mix-blend-mode: multiply;
  transform: translate(-50%, -50%) rotate(-18deg);
}

#clientsScreen.folder-opening .active-client-folder .folder-cover {
  animation: active-folder-open 860ms cubic-bezier(0.18, 0.78, 0.24, 1) 300ms both;
}

#clientsScreen.folder-closing .active-client-folder .folder-cover {
  animation: active-folder-close 460ms cubic-bezier(0.5, 0, 0.32, 1) both;
}

#clientsScreen.desk-leaving .active-client-folder .folder-cover {
  animation: none;
  transform: translateX(0) scaleX(1) skewY(0);
}

@keyframes active-folder-open {
  0% {
    opacity: 1;
    transform: translateX(0) scaleX(1) skewY(0);
  }
  42% {
    opacity: 1;
    transform: translateX(0) scaleX(1) skewY(0);
  }
  68% {
    opacity: 1;
    transform: translateX(calc(-62% + 10px)) scaleX(1.015) skewY(-0.25deg);
  }
  100% {
    opacity: 1;
    transform: translateX(calc(-100% + 10px)) scaleX(1.045) skewY(-0.55deg);
  }
}

@keyframes active-folder-close {
  0% {
    opacity: 1;
    transform: translateX(calc(-100% + 10px)) scaleX(1.045) skewY(-0.55deg);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scaleX(1) skewY(0);
  }
}

.referral-folder {
  --folder: #9fb7c8;
  --folder-dark: #5d7e94;
}

.archive-stage {
  position: relative;
  display: grid;
  place-items: center;
  height: calc(100vh - 104px);
  min-height: 560px;
  overflow: hidden;
  touch-action: pan-y;
}

.filing-cabinet {
  display: grid;
  grid-template-rows: 78px minmax(0, 1fr);
  width: min(1060px, 100%);
  height: 100%;
  perspective: 1200px;
}

.cabinet-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  border: 2px solid #4e4335;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  color: #f8efe1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent),
    #675846;
  box-shadow: 0 18px 36px rgba(29, 36, 48, 0.2);
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cabinet-top i {
  display: block;
  width: 96px;
  height: 14px;
  border-radius: 999px;
  background: #d8cab4;
  box-shadow: inset 0 2px 4px rgba(36, 27, 17, 0.35);
}

.cabinet-drawer {
  position: relative;
  display: block;
  min-height: 0;
  padding: 28px 42px 34px;
  overflow: hidden;
  border: 2px solid #4e4335;
  border-radius: 0 0 10px 10px;
  background:
    linear-gradient(180deg, rgba(16, 11, 7, 0.58), rgba(18, 13, 8, 0.22) 130px, rgba(7, 5, 4, 0.42) 100%),
    radial-gradient(ellipse at 50% 14%, rgba(255, 246, 214, 0.12), transparent 42%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent 18%, rgba(0, 0, 0, 0.08)),
    #8d7a61;
  box-shadow:
    inset 0 28px 42px rgba(20, 14, 8, 0.52),
    inset 0 -56px 70px rgba(10, 7, 4, 0.3),
    var(--shadow);
}

.cabinet-drawer::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  height: clamp(118px, 24%, 178px);
  border-top: 2px solid rgba(220, 210, 190, 0.18);
  background:
    linear-gradient(180deg, #f4efe4, #ded5c7) right 56px top 30px / 128px 40px no-repeat,
    linear-gradient(180deg, #9a9184, #5d574f) right 48px top 24px / 144px 52px no-repeat,
    radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, 0.09), transparent 38%),
    linear-gradient(180deg, #82796a, #5a544b 42%, #3c3833),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 5px);
  box-shadow:
    inset 0 4px 8px rgba(255, 255, 255, 0.16),
    inset 0 -24px 34px rgba(17, 15, 13, 0.34),
    0 -16px 28px rgba(11, 8, 5, 0.36);
  pointer-events: none;
}

.cabinet-drawer::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: clamp(28px, 5%, 44px);
  z-index: 5;
  width: min(250px, 34%);
  height: 26px;
  border-radius: 8px 8px 18px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 34%),
    linear-gradient(90deg, #5f5a52, #b7ad9f 16%, #8f8679 50%, #b5ab9d 84%, #5d574f);
  box-shadow:
    0 12px 18px rgba(18, 15, 12, 0.32),
    inset 0 2px 2px rgba(255, 255, 255, 0.36),
    inset 0 -4px 7px rgba(29, 24, 19, 0.34);
  transform: translateX(-50%);
  pointer-events: none;
}

.referral-folder .file-tab {
  border-color: var(--folder-dark);
  background: #c8d9e4;
  color: #18354b;
}

.referral-folder .file-tab.active {
  background: #f5fbff;
  color: #0f4970;
}

.referral-folder .file-page {
  --pen: #124f78;
  background-color: #fbfdff;
  background-image: repeating-linear-gradient(
    transparent 0,
    transparent 29px,
    rgba(37, 111, 150, 0.12) 30px
  );
}

.referral-folder .file-page::before {
  background: rgba(64, 129, 155, 0.28);
}

.referral-folder .file-page.referral-tray-empty {
  display: grid;
  place-items: center;
  padding: clamp(22px, 5vw, 58px);
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), transparent 28%),
    linear-gradient(180deg, rgba(17, 57, 84, 0.12), rgba(17, 57, 84, 0.28)),
    #87abc0;
  box-shadow:
    inset 0 0 0 2px rgba(35, 87, 116, 0.42),
    inset 0 18px 36px rgba(255, 255, 255, 0.2),
    inset 0 -22px 34px rgba(13, 48, 72, 0.2);
  color: #17384e;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.referral-folder .file-page.referral-tray-empty::before {
  content: "";
  position: absolute;
  inset: clamp(28px, 5vw, 56px) clamp(24px, 7vw, 86px);
  width: auto;
  border: 2px solid rgba(22, 69, 98, 0.28);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), transparent 32%),
    rgba(55, 108, 136, 0.16);
  box-shadow:
    inset 0 18px 30px rgba(15, 57, 83, 0.2),
    inset 0 -10px 18px rgba(255, 255, 255, 0.14),
    0 12px 24px rgba(15, 57, 83, 0.14);
}

.referral-folder .file-page.referral-tray-empty::after {
  content: "";
  position: absolute;
  top: auto;
  left: 50%;
  bottom: clamp(34px, 7vw, 76px);
  width: min(220px, 48%);
  height: 16px;
  border-radius: 0 0 999px 999px;
  background: rgba(20, 70, 101, 0.28);
  box-shadow: inset 0 -4px 8px rgba(255, 255, 255, 0.18);
  transform: translateX(-50%);
}

.referral-tray-message {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 8px;
  max-width: 260px;
  text-align: center;
}

.referral-tray-message strong {
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-weight: 950;
}

.referral-tray-message span {
  color: rgba(23, 56, 78, 0.78);
  font-size: 0.9rem;
  line-height: 1.4;
}

.tray-corner {
  position: absolute;
  z-index: 1;
  width: clamp(34px, 5vw, 58px);
  height: clamp(34px, 5vw, 58px);
  border-color: rgba(16, 67, 98, 0.34);
  pointer-events: none;
}

.tray-corner.top-left {
  top: clamp(18px, 4vw, 44px);
  left: clamp(18px, 4vw, 54px);
  border-top: 5px solid;
  border-left: 5px solid;
  border-radius: 16px 0 0;
}

.tray-corner.top-right {
  top: clamp(18px, 4vw, 44px);
  right: clamp(18px, 4vw, 54px);
  border-top: 5px solid;
  border-right: 5px solid;
  border-radius: 0 16px 0 0;
}

.tray-corner.bottom-left {
  left: clamp(18px, 4vw, 54px);
  bottom: clamp(18px, 4vw, 44px);
  border-left: 5px solid;
  border-bottom: 5px solid;
  border-radius: 0 0 0 16px;
}

.tray-corner.bottom-right {
  right: clamp(18px, 4vw, 54px);
  bottom: clamp(18px, 4vw, 44px);
  border-right: 5px solid;
  border-bottom: 5px solid;
  border-radius: 0 0 16px;
}

.archive-index {
  position: relative;
  --archive-file-body-top: 202px;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  padding: 14px 20px 42px;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(16, 11, 7, 0.22), rgba(17, 12, 8, 0.34) 56%, rgba(8, 6, 4, 0.62) 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 10px, transparent 10px calc(100% - 10px), rgba(0, 0, 0, 0.22) calc(100% - 10px)),
    rgba(40, 30, 18, 0.12);
  scrollbar-width: none;
}

.archive-index::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: var(--archive-file-body-top);
  left: 24px;
  right: 24px;
  bottom: 0;
  border-radius: 4px 4px 5px 5px;
  background:
    linear-gradient(180deg, rgba(238, 218, 136, 0.98), rgba(207, 187, 111, 0.78) 42%, rgba(124, 103, 55, 0.4) 78%, rgba(42, 31, 18, 0.3) 100%);
  box-shadow:
    0 -4px 8px rgba(83, 65, 31, 0.22),
    0 10px 28px rgba(17, 11, 6, 0.36),
    inset 12px 0 18px rgba(255, 255, 255, 0.11),
    inset -14px 0 22px rgba(51, 36, 18, 0.22),
    inset 0 -70px 78px rgba(20, 14, 8, 0.42);
  pointer-events: none;
}

.archive-index::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  height: calc(100% - var(--archive-file-body-top));
  background:
    linear-gradient(180deg, transparent, rgba(31, 23, 14, 0.12) 44%, rgba(14, 10, 6, 0.48) 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0 12px, transparent 12px calc(100% - 12px), rgba(0, 0, 0, 0.2) calc(100% - 12px));
  box-shadow: inset 0 -34px 42px rgba(15, 10, 6, 0.28);
  pointer-events: none;
}

.archive-index::-webkit-scrollbar {
  width: 0;
}

.archive-index-row {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 31px;
  margin: -3px 0 0;
  padding: 0;
  border: 0;
  color: #302719;
  background: transparent;
  text-align: left;
  box-shadow: none;
}

.archive-index-row.active {
  z-index: 2;
  transform: translateY(-1px);
  box-shadow: none;
}

.archive-index-row::before,
.archive-index-row::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
}

.archive-index-row::before {
  top: 20px;
  height: 10px;
  border: 1px solid rgba(92, 71, 38, 0.2);
  border-radius: 4px;
  background:
    linear-gradient(180deg, #eadca7, #d3bf84);
  box-shadow: 0 3px 6px rgba(39, 28, 15, 0.14);
}

.archive-index-row::after {
  top: 20px;
  height: 1px;
  background: rgba(86, 66, 34, 0.28);
}

.archive-index-row strong {
  --safe-tab-offset: max(0px, min(var(--tab-offset, 20px), calc(100% - 152px)));
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  max-width: min(230px, calc(100% - var(--safe-tab-offset) - 12px));
  height: 32px;
  margin-left: var(--safe-tab-offset);
  padding: 0 16px;
  overflow: hidden;
  border: 1px solid rgba(78, 55, 24, 0.22);
  border-bottom: 0;
  border-radius: 12px 12px 3px 3px;
  background:
    linear-gradient(180deg, #fff5bf 0 76%, #e6d39a);
  box-shadow:
    0 7px 12px rgba(39, 28, 15, 0.3),
    0 2px 0 rgba(255, 255, 255, 0.34) inset;
  font-size: 0.88rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-index-row.active strong {
  background:
    linear-gradient(180deg, #fff9d8 0 76%, #ead9a5);
  box-shadow:
    0 9px 16px rgba(39, 28, 15, 0.34),
    0 2px 0 rgba(255, 255, 255, 0.4) inset;
}

.archive-index-row span {
  display: none;
}

.archive-empty {
  color: rgba(52, 43, 32, 0.68);
  font-size: 0.82rem;
  line-height: 1.35;
}

.archive-page {
  position: absolute;
  top: 50px;
  left: max(22px, calc((100% - 1060px) / 2 + 22px));
  right: max(22px, calc((100% - 1060px) / 2 + 22px));
  bottom: 18px;
  z-index: 5;
  display: none;
  box-shadow: 0 24px 70px rgba(20, 14, 8, 0.38);
}

.archive-page.open {
  display: block;
  animation: archive-file-open 220ms ease-out both;
}

@keyframes archive-file-open {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.archive-watermark {
  position: absolute;
  top: 44%;
  left: 50%;
  z-index: 0;
  color: rgba(118, 104, 82, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 950;
  letter-spacing: 0.1em;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-16deg);
}

.folder-tabs {
  position: relative;
  z-index: 3;
  display: grid;
  align-items: end;
  gap: 0;
  max-width: 100%;
  overflow: visible;
  padding: 0;
}

.folder-tab-row {
  display: flex;
  align-items: end;
  gap: 6px;
  min-width: 0;
}

.folder-tab-row-back {
  position: relative;
  z-index: 1;
  margin: 0 0 -2px 54px;
}

.folder-tab-row-front {
  position: relative;
  z-index: 2;
}

.folder-action {
  position: absolute;
  top: 14px;
  right: 24px;
  z-index: 3;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(24, 53, 75, 0.28);
  border-radius: 999px;
  color: #ffffff;
  background: #256f96;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(29, 36, 48, 0.14);
}

.folder-action:hover {
  background: #174f72;
}

.folder-action.cooldown {
  border-color: rgba(71, 82, 92, 0.2);
  color: #52606d;
  background: #d9dee3;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.folder-action.cooldown:hover {
  background: #d9dee3;
}

.folder-action:disabled {
  cursor: default;
  opacity: 0.82;
}

.folder-action.cooldown::after {
  content: attr(data-wait);
  display: block;
  margin-top: -2px;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0.62;
}

.file-tab {
  flex: 0 1 112px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  max-width: 128px;
  padding: 7px 14px 6px;
  overflow: visible;
  border: 2px solid var(--folder-dark);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #e2c27d;
  color: #4e3718;
  font-weight: 900;
  text-align: left;
  font-size: 0.86rem;
  white-space: nowrap;
  box-shadow: 0 3px 0 rgba(88, 60, 22, 0.1);
}

.file-tab-label {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-tab.active {
  z-index: 4;
  margin-bottom: -2px;
  background: var(--paper);
  color: var(--accent-dark);
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.5) inset;
}

.file-tab.live-session {
  padding-right: 18px;
  border-color: #2f7f67;
  background: #dcefe4;
  color: #174f42;
}

.file-tab.live-session.active {
  background: #f3fbf6;
  color: #174f42;
}

.file-tab-live {
  position: absolute;
  top: -8px;
  right: -7px;
  z-index: 6;
  padding: 2px 5px;
  border-radius: 999px;
  color: #ffffff !important;
  background: #2f7f67;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 2px 4px rgba(33, 42, 34, 0.22);
  pointer-events: none;
}

.folder-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  height: 100%;
}

.file-page {
  border-radius: 6px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(84, 55, 20, 0.12);
}

.file-page {
  position: relative;
  --paper-rule: 72px;
  --writing-gap: 16px;
  padding: 28px 28px 28px calc(var(--paper-rule) + var(--writing-gap));
  min-height: 0;
  height: 100%;
  overflow: visible;
  background-image: repeating-linear-gradient(
    transparent 0,
    transparent 29px,
    rgba(35, 100, 170, 0.14) 30px
  );
  color: var(--pen);
  font-family: "Segoe Print", "Bradley Hand ITC", "Comic Sans MS", cursive;
}

body.clear-file-font .file-page,
body.clear-file-font .paper-link,
body.clear-file-font .cooldown-note {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.clear-file-font .file-page {
  line-height: 1.55;
}

.file-page::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--paper-rule);
  width: 2px;
  background: rgba(174, 74, 75, 0.32);
}

.file-page::after {
  content: "";
  position: absolute;
  top: calc(50% - 86px);
  left: calc(var(--paper-rule) / 2 - 11px);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 55% 45%, rgba(60, 37, 16, 0.28), transparent 62%),
    #d6d2c5;
  box-shadow:
    inset 0 2px 5px rgba(38, 24, 12, 0.32),
    0 150px 0 #d6d2c5,
    0 150px 0 1px rgba(38, 24, 12, 0.12);
}

.file-page.archive-page {
  position: absolute;
  top: 50px;
  left: max(22px, calc((100% - 1060px) / 2 + 22px));
  right: max(22px, calc((100% - 1060px) / 2 + 22px));
  bottom: 18px;
  z-index: 5;
  display: none;
  height: auto;
  box-shadow: 0 24px 70px rgba(20, 14, 8, 0.38);
}

.file-page.archive-page.open {
  display: block;
}

.file-page-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  min-width: 0;
}

.file-page-scroll {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  min-width: 0;
}

.file-page-scroll::-webkit-scrollbar,
.file-page-content::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.file-page-content > div:first-child {
  padding-right: 0;
}

.file-page .eyebrow {
  color: rgba(30, 85, 166, 0.78);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.file-page h3 {
  color: var(--pen);
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  font-weight: 700;
}

.file-heading {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.file-subhead {
  margin: 0;
}

.file-meta {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  gap: 8px 12px;
  color: var(--pen);
}

.file-meta.compact {
  grid-template-columns: max-content;
  margin-top: 4px;
}

.file-meta > div {
  display: grid;
  grid-template-columns: auto;
  gap: 2px;
  min-width: 0;
}

.file-meta span {
  color: rgba(30, 85, 166, 0.72);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.file-meta strong {
  color: var(--pen);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.difficulty-meta strong {
  font-size: 0.92rem;
  font-weight: 650;
}

.file-page p,
.file-page dd,
.file-page li,
.file-page span {
  color: var(--pen);
}

.file-profile {
  display: block;
}

.file-copy {
  clear: both;
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.file-section-label {
  color: rgba(30, 85, 166, 0.72);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.info-tile {
  padding: 6px 0 0;
  border: 0;
  border-bottom: 0;
  border-radius: 0;
  background: transparent;
}

.file-profile + .info-tile,
.info-tile + .info-tile {
  margin-top: 18px;
}

.info-tile dt {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(30, 85, 166, 0.7);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.68rem;
}

.info-tile dd {
  font-size: 1.02rem;
  overflow-wrap: anywhere;
}

.polaroid {
  position: relative;
  z-index: 2;
  float: right;
  width: 162px;
  margin: -26px 2px 18px 28px;
  padding: 10px 10px 26px;
  transform: rotate(2.5deg);
  background: #fffdf8;
  box-shadow: 0 10px 24px rgba(29, 36, 48, 0.18);
}

.portrait {
  display: block;
  width: 100%;
  height: 132px;
  object-fit: cover;
}

.polaroid figcaption {
  position: absolute;
  right: 12px;
  bottom: 7px;
  color: var(--pen);
  font-size: 0.85rem;
}

.paperclip {
  position: absolute;
  top: -24px;
  right: 18px;
  width: 18px;
  height: 54px;
  border: 3px solid #8c96a3;
  border-left-color: transparent;
  border-radius: 12px;
  transform: rotate(13deg);
  box-shadow: 1px 1px 0 rgba(255, 255, 255, 0.7);
}

.paperclip::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 3px;
  width: 10px;
  height: 36px;
  border: 2px solid #8c96a3;
  border-left-color: transparent;
  border-radius: 10px;
}

.session-list {
  display: grid;
  gap: 10px;
  max-height: none;
  overflow: visible;
}

.file-page-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.file-page-title-row h3 {
  margin-bottom: 0;
}

.session-top-action {
  flex: 0 0 auto;
  margin-top: 4px;
}

.session-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 12px;
  border: 1px solid #e2d7bd;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.7);
}

.session-row-main {
  display: grid;
  flex: 1 1 auto;
  gap: 8px;
  min-width: 0;
}

.session-summary {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.86rem;
}

.session-summary p {
  margin: 0;
  line-height: 1.45;
}

.session-summary span {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.therapy-journey-page p {
  max-width: 72ch;
}

.mini-transcript {
  display: grid;
  gap: 6px;
  max-height: 180px;
  margin-top: 10px;
  overflow: auto;
  scrollbar-width: none;
}

.mini-transcript::-webkit-scrollbar {
  width: 0;
}

.mini-transcript span {
  font-weight: 900;
}

.file-page-footer {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 38px;
  padding-top: 6px;
}

.file-page-footer.one-action {
  justify-content: flex-end;
}

.archive-profile-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.archive-profile-footer .paper-link:first-child {
  justify-self: start;
}

.archive-profile-footer .restore-link {
  justify-self: center;
}

.archive-profile-footer .paper-link:last-child {
  justify-self: end;
}

.quiet-link {
  opacity: 0.52;
}

.quiet-link:hover {
  opacity: 1;
}

.empty-file-page {
  display: grid;
  align-content: center;
  gap: 12px;
  min-height: inherit;
  text-align: left;
}

.empty-file-page p {
  max-width: 460px;
}

.loading-file-page {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 16px;
  min-height: 100%;
  padding: clamp(28px, 8vh, 72px) clamp(20px, 6vw, 72px);
  text-align: center;
}

.loading-file-page h3 {
  margin: 0;
}

.loading-file-page p {
  max-width: 460px;
  margin: 0;
}

.referral-progress {
  position: relative;
  width: min(420px, 100%);
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(37, 111, 150, 0.14);
}

.referral-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, #256f96, #73abc3);
  animation: referral-progress 1.1s ease-in-out infinite;
}

@keyframes referral-progress {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(260%);
  }
}

.paper-link {
  padding: 0;
  border: 0;
  color: var(--pen);
  background: transparent;
  font-family: "Segoe Print", "Bradley Hand ITC", "Comic Sans MS", cursive;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.paper-link:hover {
  color: var(--accent-dark);
}

.paper-link.restore-link {
  color: #8a421c;
  text-decoration-color: #8a421c;
}

.paper-link.restore-link:hover {
  color: #a65224;
  text-decoration-color: #a65224;
}

.cooldown-note {
  align-self: center;
  color: rgba(30, 85, 166, 0.72);
  font-family: "Segoe Print", "Bradley Hand ITC", "Comic Sans MS", cursive;
  font-weight: 700;
}

.cooldown-note.inline {
  margin: 12px 0 0;
}

.accept-action {
  min-height: 44px;
  padding: 0 18px;
  border: 2px solid rgba(30, 85, 166, 0.52);
  border-radius: 8px;
  color: #ffffff;
  background: var(--pen);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: 0 8px 18px rgba(29, 36, 48, 0.14);
}

.accept-action:hover {
  background: var(--accent-dark);
}

.accept-action:disabled,
.accept-action:disabled:hover {
  cursor: default;
  border-color: rgba(82, 96, 109, 0.28);
  color: #52606d;
  background: #d9dee3;
  box-shadow: none;
}

@media (max-width: 1180px) {
  .client-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .app-shell,
  .waiting-layout,
  .review-layout {
    grid-template-columns: 1fr;
  }

  .review-score-summary,
  .review-sections,
  .account-page {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 4;
    padding: 16px;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .therapist-card {
    display: none;
  }

  main {
    padding: 20px;
  }

  .info-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .file-page-content {
    margin-left: 0;
  }

}

@media (max-width: 760px) {
  .app-shell.in-session main {
    height: 100vh;
    height: 100dvh;
    padding: 12px;
  }

  .app-shell.in-session .session-header {
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
  }

  .session-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
  }

  .session-actions .secondary-action {
    min-height: 40px;
    padding: 0 10px;
    font-size: 0.86rem;
  }

  .app-shell.in-session .session-header h2 {
    max-width: 34vw;
    font-size: 1.15rem;
  }

  .session-workspace.lens-open {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
  }

  .session-workspace.lens-open.guide-bottom {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .supervisor-lens {
    order: -1;
  }

  .supervisor-lens.guide-bottom {
    order: 1;
  }

  .supervisor-lens.open {
    max-height: 24vh;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .supervisor-lens header {
    padding: 9px 12px 4px;
  }

  .guide-position-toggle {
    width: 24px;
    min-height: 24px;
    font-size: 0.78rem;
  }

  .supervisor-lens .eyebrow {
    font-size: 0.7rem;
  }

  .lens-scroll {
    gap: 8px;
    padding: 8px 10px 10px;
  }

  .lens-content {
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .chat-log {
    gap: 9px;
    padding: 10px 12px;
  }

  .message {
    padding: 10px 12px;
    font-size: 0.92rem;
    line-height: 1.4;
  }

  #sessionScreen.suggestions-on .mobile-suggested-replies {
    padding: 8px;
  }

  .suggested-replies-list {
    gap: 7px;
  }

  .suggested-reply {
    gap: 3px;
    min-height: 0;
    padding: 10px 11px;
    box-shadow: 0 2px 7px rgba(29, 36, 48, 0.08);
  }

  .suggested-reply span {
    font-size: 0.76rem;
  }

  .suggested-reply strong {
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.28;
  }
}

@media (max-width: 620px) {
  .screen-header,
  .session-header,
  .chat-composer,
  .session-row {
    align-items: stretch;
    flex-direction: column;
  }

  .screen-header {
    grid-template-columns: auto 1fr;
    gap: 12px;
  }

  .screen-header h2 {
    justify-self: center;
    grid-column: 1 / -1;
    grid-row: 1;
    font-size: 1.45rem;
  }

  .review-header .review-title-block {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .review-header .review-actions {
    grid-column: 1 / -1;
    justify-self: center;
  }

  .menu-wrap {
    grid-column: 1;
    grid-row: 1;
    z-index: 2;
  }

  .top-actions {
    grid-column: 1 / -1;
    justify-self: stretch;
    justify-content: space-between;
    gap: 10px;
  }

  .desk-link {
    font-size: 0.84rem;
  }

  .screen.desk-leaving {
    inset: 14px;
  }

  main {
    padding: 14px;
  }

  .client-grid {
    grid-template-columns: 1fr;
  }

  .app-shell.in-session main {
    height: 100vh;
    height: 100dvh;
    padding: 12px;
  }

  .app-shell.in-session .session-header {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .session-actions {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
  }

  .session-actions .secondary-action {
    padding: 0 10px;
    font-size: 0.86rem;
  }

  .app-shell.in-session .session-header h2 {
    max-width: 34vw;
    font-size: 1.15rem;
  }

  #sessionScreen.suggestions-on .mobile-suggested-replies {
    padding: 8px;
  }

  .chat-log {
    gap: 9px;
    padding: 10px 12px;
  }

  .message {
    padding: 10px 12px;
    font-size: 0.92rem;
    line-height: 1.4;
  }

  .session-workspace.lens-open {
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
  }

  .session-workspace.lens-open.guide-bottom {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .supervisor-lens {
    order: -1;
  }

  .supervisor-lens.guide-bottom {
    order: 1;
  }

  #sessionScreen:not(.guide-on) .supervisor-lens {
    display: none;
  }

  .supervisor-lens.open {
    max-height: 24vh;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .supervisor-lens header {
    padding: 9px 12px 4px;
  }

  .supervisor-lens .eyebrow {
    font-size: 0.7rem;
  }

  .lens-scroll {
    gap: 8px;
    padding: 8px 10px 10px;
  }

  .supervisor-lens .suggested-replies {
    display: none;
  }

  .lens-content {
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .suggested-replies-list {
    gap: 7px;
  }

  .suggested-reply {
    gap: 3px;
    min-height: 0;
    padding: 10px 11px;
    box-shadow: 0 2px 7px rgba(29, 36, 48, 0.08);
  }

  .suggested-reply span {
    font-size: 0.76rem;
  }

  .suggested-reply strong {
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.28;
  }

  .chat-composer {
    grid-template-columns: 1fr 78px;
  }

  .nav-item {
    justify-content: center;
    padding: 10px 8px;
    font-size: 0.85rem;
  }

  .nav-icon {
    display: none;
  }

  .message {
    max-width: 100%;
  }

  .score-hero {
    grid-template-columns: 1fr;
  }

  .score-help-link {
    justify-self: start;
  }

  .domain-score div:first-child,
  .rubric-grid,
  .level-guide.compact,
  .level-guide-row {
    grid-template-columns: 1fr;
  }

  .level-guide-row p {
    grid-column: auto;
  }

  .domain-score div:first-child {
    display: grid;
  }

  .folder-stage {
    place-items: start;
    height: calc(100vh - 96px);
    height: calc(100dvh - 96px);
    min-height: 0;
  }

  .case-folder {
    height: 100%;
    min-height: 0;
    padding: 5px 12px 12px;
  }

  .folder-tabs {
    max-width: calc(100% - 156px);
  }

  .active-client-folder .folder-tabs {
    max-width: none;
  }

  .folder-action {
    right: 12px;
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.8rem;
  }

  .file-tab {
    flex-basis: 78px;
    max-width: 92px;
    padding: 7px 10px 6px;
    font-size: 0.76rem;
  }

  .folder-tab-row-back {
    margin-left: 34px;
  }

  .folder-body,
  .file-page {
    min-height: 0;
    height: 100%;
  }

  .archive-stage {
    height: calc(100vh - 96px);
    height: calc(100dvh - 96px);
    min-height: 520px;
  }

  .filing-cabinet {
    grid-template-rows: 62px minmax(0, 1fr);
  }

  .cabinet-top {
    padding: 0 16px;
    font-size: 0.82rem;
  }

  .cabinet-top i {
    width: 62px;
  }

  .cabinet-drawer {
    padding: 14px;
  }

  .archive-index {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .archive-index-row {
    height: 31px;
    margin: -3px 0 0;
  }

  .archive-index-row strong {
    --safe-tab-offset: max(0px, min(var(--tab-offset, 20px), calc(100% - 128px)));
    min-width: 104px;
    max-width: min(180px, calc(100% - var(--safe-tab-offset) - 8px));
    padding: 0 14px;
    font-size: 0.84rem;
  }

  .archive-page {
    top: 44px;
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  .file-page.archive-page {
    top: 44px;
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  .file-page {
    --paper-rule: 52px;
    --writing-gap: 12px;
    padding: 20px 14px 20px calc(var(--paper-rule) + var(--writing-gap));
  }

  .file-page-content {
    gap: 12px;
    min-height: 0;
    height: 100%;
  }

  .file-page-content > div:first-child {
    padding-right: 0;
  }

  .file-meta {
    grid-template-columns: repeat(2, max-content);
    gap: 6px 10px;
    font-size: 0.88rem;
  }

  .file-page::after {
    top: calc(50% - 75px);
    left: calc(var(--paper-rule) / 2 - 9px);
    width: 18px;
    height: 18px;
    box-shadow:
      inset 0 2px 5px rgba(38, 24, 12, 0.32),
      0 132px 0 #d6d2c5,
      0 132px 0 1px rgba(38, 24, 12, 0.12);
  }

  .file-profile {
    display: block;
  }

  .polaroid {
    width: 126px;
    margin: -10px -4px 12px 14px;
    padding: 8px 8px 22px;
  }

  .portrait {
    height: 100px;
    font-size: 2.1rem;
  }

  .polaroid figcaption {
    font-size: 0.66rem;
  }

  .paperclip {
    right: 10px;
    height: 42px;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .session-list {
    max-height: none;
  }
}
