:root {
  --ink: #24352f;
  --ink-soft: #42564c;
  --muted: #7f8b83;
  --faint: #aeb7b0;
  --sage: #6f8e7a;
  --sage-dark: #315346;
  --sage-deep: #203b32;
  --sage-pale: #e9f0e9;
  --cream: #f4f1e8;
  --paper: #fffdf8;
  --white: #ffffff;
  --peach: #d99065;
  --peach-pale: #f7e6d8;
  --yellow: #e7c66a;
  --line: #e7e3d9;
  --line-strong: #d9d5c9;
  --danger: #ba5c52;
  --danger-pale: #fae9e6;
  --shadow-sm: 0 8px 24px rgba(45, 62, 53, 0.06);
  --shadow-md: 0 18px 50px rgba(45, 62, 53, 0.12);
  --shadow-lg: 0 30px 80px rgba(27, 47, 39, 0.18);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-xl: 34px;
  --sidebar-width: 254px;
  --font-sans: "Segoe UI Variable Text", "MiSans", "HarmonyOS Sans SC",
    "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --font-serif: "Kaiti SC", "STKaiti", "KaiTi", "FZKai-Z03",
    "Noto Serif SC", serif;
  --font-scale: 1;
}

html[data-theme="night"] {
  color-scheme: dark;
  --ink: #e8eee9;
  --ink-soft: #bdc9c0;
  --muted: #89988e;
  --faint: #65736a;
  --sage: #91b8a0;
  --sage-dark: #4d8268;
  --sage-deep: #081713;
  --sage-pale: #1d3329;
  --cream: #0e1612;
  --paper: #18211c;
  --white: #f9fdfa;
  --peach: #d29a73;
  --peach-pale: #34251d;
  --yellow: #d9b962;
  --line: #2a3730;
  --line-strong: #3a4a41;
  --danger: #e08478;
  --danger-pale: #38221f;
  --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.17);
  --shadow-md: 0 20px 55px rgba(0, 0, 0, 0.28);
}

html[data-theme="ocean"] {
  --ink: #203b42;
  --ink-soft: #405e64;
  --muted: #768e91;
  --faint: #9aacae;
  --sage: #639ba1;
  --sage-dark: #3f747b;
  --sage-deep: #21464d;
  --sage-pale: #dceced;
  --cream: #edf4f2;
  --paper: #fbfdfc;
  --peach: #ca8e67;
  --peach-pale: #f4e5db;
  --line: #dce7e5;
  --line-strong: #cbdad7;
}

html[data-theme="sakura"] {
  --ink: #4a333b;
  --ink-soft: #684b55;
  --muted: #987c86;
  --faint: #bca4ad;
  --sage: #b9788e;
  --sage-dark: #995d72;
  --sage-deep: #644251;
  --sage-pale: #f7e4ea;
  --cream: #fff4f5;
  --paper: #fffbfb;
  --white: #ffffff;
  --peach: #d29479;
  --peach-pale: #fae9e1;
  --line: #f0dfe3;
  --line-strong: #e3cdd4;
}

html[data-theme="lavender"] {
  --ink: #3c354a;
  --ink-soft: #5b526d;
  --muted: #8c839c;
  --faint: #b3abbe;
  --sage: #8f7eb2;
  --sage-dark: #715f97;
  --sage-deep: #433953;
  --sage-pale: #eee8f5;
  --cream: #f7f3fa;
  --paper: #fdfbff;
  --white: #ffffff;
  --peach: #c58e86;
  --peach-pale: #f5e7e4;
  --line: #e8def0;
  --line-strong: #d9cce4;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--cream);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 3%, rgba(231, 198, 106, 0.15), transparent 27%),
    var(--cream);
  font-family: var(--font-sans);
  font-size: calc(15px * var(--font-scale));
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition:
    color 0.28s ease,
    background-color 0.28s ease;
}

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
textarea,
select {
  outline: none;
}

textarea {
  resize: vertical;
}

svg {
  display: block;
}

::selection {
  color: var(--white);
  background: var(--sage);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #d6d8d1;
  background-clip: content-box;
}

.boot-screen {
  display: grid;
  min-height: 100vh;
  place-content: center;
  justify-items: center;
  color: var(--muted);
}

.boot-mark {
  display: grid;
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  border-radius: 22px;
  color: var(--white);
  background: var(--sage-dark);
  place-items: center;
  font-family: var(--font-serif);
  font-size: calc(30px * var(--font-scale));
  box-shadow: var(--shadow-md);
}

.boot-screen p {
  margin: 0;
  font-size: calc(13px * var(--font-scale));
  letter-spacing: 0.06em;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

.icon-lg {
  width: 24px;
  height: 24px;
}

.sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--sage);
  font-size: calc(11px * var(--font-scale));
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow.on-dark {
  color: rgba(255, 255, 255, 0.66);
}

/* Login */

.login-page {
  display: grid;
  min-height: 100vh;
  padding: 22px;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.85fr);
  gap: 22px;
}

.login-story {
  position: relative;
  display: flex;
  overflow: hidden;
  min-height: calc(100vh - 44px);
  padding: clamp(32px, 5vw, 72px);
  border-radius: var(--radius-xl);
  color: var(--white);
  background:
    radial-gradient(circle at 78% 16%, rgba(255, 255, 255, 0.1), transparent 22%),
    linear-gradient(145deg, var(--sage-dark) 0%, var(--sage-deep) 100%);
  flex-direction: column;
  justify-content: space-between;
  isolation: isolate;
}

.login-story::before,
.login-story::after {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  content: "";
}

.login-story::before {
  top: -180px;
  right: -170px;
  width: 470px;
  height: 470px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0 0 52px rgba(255, 255, 255, 0.025),
    0 0 0 108px rgba(255, 255, 255, 0.018);
}

.login-story::after {
  bottom: -220px;
  left: -190px;
  width: 430px;
  height: 430px;
  background: rgba(225, 169, 119, 0.08);
}

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

.brand-symbol {
  display: grid;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 15px;
  color: #28483d;
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.9), transparent 24%),
    linear-gradient(145deg, #f8e8c9, #dfb47e);
  backdrop-filter: blur(8px);
  place-items: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 8px 20px rgba(22, 43, 35, 0.2);
}

.brand-symbol svg {
  width: 32px;
  height: 32px;
}

.brand-text {
  display: grid;
  gap: 1px;
}

.brand-text strong {
  font-family: var(--font-serif);
  font-size: calc(20px * var(--font-scale));
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-wordmark {
  display: inline-flex;
  color: var(--white);
  font-family: var(--font-serif);
  align-items: baseline;
  line-height: 1;
  letter-spacing: 0.02em;
}

.brand-wordmark.large {
  font-size: 27px;
}

.brand-wordmark.inline {
  font-size: 19px;
  white-space: nowrap;
}

.brand-wordmark.compact {
  font-size: 16px;
}

.brand-seven {
  color: color-mix(in srgb, var(--yellow) 85%, white);
  font-family: "Segoe UI Symbol", "Georgia", serif;
  font-size: 1.22em;
  font-style: italic;
  font-weight: 800;
  letter-spacing: -0.08em;
  transform: rotate(-5deg);
}

.brand-wait {
  margin-left: 0.08em;
  font-weight: 700;
}

.brand-quote {
  color: rgba(255, 255, 255, 0.55);
  font-family: Georgia, serif;
  font-size: 0.72em;
}

.brand-quote:last-of-type {
  margin-right: 0.05em;
}

.login-visual {
  position: relative;
  display: grid;
  min-height: 430px;
  flex: 1;
  place-items: center;
}

.visual-seven {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.095);
  font-family: "Segoe UI Symbol", Georgia, serif;
  font-size: clamp(240px, 24vw, 390px);
  font-style: italic;
  font-weight: 800;
  line-height: 0.8;
  text-shadow: 0 30px 70px rgba(0, 0, 0, 0.1);
  transform: rotate(-8deg) translateX(-2%);
  user-select: none;
}

.visual-ring {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
}

.visual-ring.large {
  width: min(34vw, 430px);
  height: min(34vw, 430px);
}

.visual-ring.small {
  width: min(22vw, 270px);
  height: min(22vw, 270px);
  border-style: dashed;
  transform: rotate(18deg);
}

.visual-dot {
  position: absolute;
  top: 27%;
  right: 18%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--yellow) 84%, white);
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.035);
}

.brand-text small {
  color: rgba(255, 255, 255, 0.55);
  font-size: calc(9px * var(--font-scale));
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.story-main {
  position: relative;
  max-width: 600px;
  margin: 8vh 0 5vh;
}

.story-main h1 {
  max-width: 520px;
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(46px, 5.2vw, 76px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.13;
}

.story-main h1 em {
  position: relative;
  color: #f0d6a1;
  font-style: normal;
}

.story-main h1 em::after {
  position: absolute;
  right: 2px;
  bottom: -5px;
  left: 1px;
  height: 6px;
  border-top: 2px solid rgba(240, 214, 161, 0.65);
  border-radius: 50%;
  content: "";
  transform: rotate(-2deg);
}

.story-description {
  max-width: 430px;
  margin: 26px 0 0;
  color: rgba(255, 255, 255, 0.63);
  font-size: calc(15px * var(--font-scale));
  line-height: 1.9;
}

.story-illustration {
  position: absolute;
  z-index: -1;
  right: -20px;
  bottom: 6vh;
  width: min(330px, 38%);
  opacity: 0.78;
}

.story-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.class-seats {
  display: flex;
  align-items: center;
  gap: 16px;
}

.seat-faces {
  display: flex;
}

.mini-face {
  display: grid;
  width: 31px;
  height: 31px;
  margin-left: -8px;
  border: 2px solid #29483d;
  border-radius: 50%;
  color: var(--white);
  background: var(--face-color, var(--sage));
  font-size: calc(10px * var(--font-scale));
  font-weight: 700;
  place-items: center;
}

.mini-face:first-child {
  margin-left: 0;
}

.mini-face.more {
  color: var(--sage-dark);
  background: #f0d6a1;
}

.class-seats p {
  margin: 0;
  color: rgba(255, 255, 255, 0.56);
  font-size: calc(11px * var(--font-scale));
  line-height: 1.55;
}

.class-seats strong {
  display: block;
  color: var(--white);
  font-size: calc(12px * var(--font-scale));
}

.privacy-pill {
  display: flex;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.04);
  align-items: center;
  gap: 7px;
  font-size: calc(10px * var(--font-scale));
  white-space: nowrap;
}

.login-panel {
  position: relative;
  display: flex;
  min-height: calc(100vh - 44px);
  padding: clamp(32px, 5vw, 76px);
  align-items: center;
  justify-content: center;
}

.login-theme {
  position: absolute;
  top: 26px;
  right: 30px;
}

.login-form-wrap {
  width: min(100%, 410px);
}

.login-header {
  margin-bottom: 32px;
}

.login-header h2 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: calc(34px * var(--font-scale));
  font-weight: 600;
  letter-spacing: -0.03em;
}

.login-header p {
  margin: 0;
  color: var(--muted);
  font-size: calc(13px * var(--font-scale));
}

.login-tabs {
  display: grid;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.7);
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.login-tab {
  display: flex;
  height: 43px;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: calc(13px * var(--font-scale));
  font-weight: 600;
  transition: 0.2s ease;
}

.login-tab:hover {
  color: var(--ink);
}

.login-tab.active {
  color: var(--white);
  background: var(--sage-dark);
  box-shadow: 0 6px 16px rgba(49, 83, 70, 0.18);
}

.login-fields {
  display: grid;
  margin-top: 27px;
  gap: 18px;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group > label {
  font-size: calc(12px * var(--font-scale));
  font-weight: 700;
  letter-spacing: 0.025em;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.field-hint {
  color: var(--faint);
  font-size: calc(10px * var(--font-scale));
  font-weight: 400;
}

.input-shell {
  position: relative;
}

.input-shell > .icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 17px;
  height: 17px;
  color: var(--faint);
  pointer-events: none;
  transform: translateY(-50%);
}

.text-input,
.select-input,
.text-area {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--paper);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.text-input,
.select-input {
  height: 49px;
  padding: 0 14px;
}

.input-shell .text-input {
  padding-left: 42px;
}

.text-area {
  min-height: 120px;
  padding: 13px 14px;
  line-height: 1.7;
}

.text-input::placeholder,
.text-area::placeholder {
  color: #b5bcb6;
}

.text-input:focus,
.select-input:focus,
.text-area:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 4px rgba(111, 142, 122, 0.1);
}

.select-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237f8b83' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  place-items: center;
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: var(--ink);
  background: var(--sage-pale);
}

.password-toggle .icon {
  width: 17px;
  height: 17px;
}

.input-shell:has(.password-toggle) .text-input {
  padding-right: 48px;
}

.login-error {
  display: flex;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--danger);
  background: var(--danger-pale);
  align-items: center;
  gap: 8px;
  font-size: calc(12px * var(--font-scale));
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  min-height: 44px;
  padding: 0 17px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: calc(13px * var(--font-scale));
  font-weight: 700;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.primary-button {
  color: var(--white);
  background: var(--sage-dark);
  box-shadow: 0 8px 18px rgba(49, 83, 70, 0.14);
}

.primary-button:hover {
  background: var(--sage-deep);
  box-shadow: 0 10px 24px rgba(49, 83, 70, 0.2);
  transform: translateY(-1px);
}

.primary-button.warm {
  color: #3c3027;
  background: #efcf98;
  box-shadow: 0 8px 18px rgba(235, 197, 132, 0.18);
}

.primary-button.warm:hover {
  background: #f4d9ae;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  background: var(--paper);
}

.secondary-button:hover {
  border-color: #bfc7c0;
  background: var(--white);
}

.ghost-button {
  min-height: 38px;
  padding: 0 12px;
  color: var(--ink-soft);
  background: transparent;
}

.ghost-button:hover {
  background: var(--sage-pale);
}

.danger-button {
  color: var(--danger);
  background: var(--danger-pale);
}

.danger-button:hover {
  background: #f6d9d5;
}

.button-wide {
  width: 100%;
  height: 50px;
}

.demo-card {
  margin-top: 24px;
  padding: 15px;
  border: 1px dashed #d7d1c2;
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.58);
}

.demo-title {
  display: flex;
  margin-bottom: 9px;
  color: var(--ink-soft);
  align-items: center;
  gap: 7px;
  font-size: calc(11px * var(--font-scale));
  font-weight: 700;
}

.demo-title .icon {
  width: 14px;
  height: 14px;
}

.demo-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: calc(10px * var(--font-scale));
}

.demo-row + .demo-row {
  margin-top: 7px;
}

.demo-row span {
  color: var(--muted);
}

.demo-row code {
  padding: 3px 6px;
  border-radius: 5px;
  color: var(--ink-soft);
  background: #f0eee6;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: calc(10px * var(--font-scale));
}

.demo-row button {
  padding: 2px 0;
  color: var(--sage);
  background: transparent;
  font-size: calc(10px * var(--font-scale));
  font-weight: 700;
}

.login-note {
  margin: 18px 0 0;
  color: var(--faint);
  font-size: calc(10px * var(--font-scale));
  text-align: center;
  text-decoration: none;
}

/* App shell */

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  overflow: hidden;
  height: 100vh;
  padding: 26px 18px 20px;
  color: rgba(255, 255, 255, 0.74);
  background: var(--sage-deep);
  flex-direction: column;
}

.sidebar::after {
  position: absolute;
  right: -110px;
  bottom: 13%;
  width: 240px;
  height: 240px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 50%;
  box-shadow:
    0 0 0 34px rgba(255, 255, 255, 0.018),
    0 0 0 72px rgba(255, 255, 255, 0.012);
  content: "";
  pointer-events: none;
}

.sidebar-brand {
  display: flex;
  padding: 3px 8px 26px;
  align-items: center;
  gap: 11px;
}

.sidebar-logo {
  display: grid;
  width: 39px;
  height: 39px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 13px;
  color: #26453a;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.9), transparent 28%),
    linear-gradient(145deg, #f7e6c5, #d8aa76);
  place-items: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 7px 16px rgba(5, 18, 13, 0.22);
}

.sidebar-logo svg {
  width: 29px;
  height: 29px;
}

.sidebar-brand strong {
  display: block;
  color: var(--white);
  font-family: var(--font-serif);
  font-size: calc(17px * var(--font-scale));
  letter-spacing: 0.06em;
}

.sidebar-brand small {
  color: rgba(255, 255, 255, 0.38);
  font-size: calc(8px * var(--font-scale));
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.side-section-label {
  margin: 1px 12px 9px;
  color: rgba(255, 255, 255, 0.32);
  font-size: calc(8px * var(--font-scale));
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.side-nav {
  display: grid;
  gap: 5px;
}

.side-nav + .side-section-label {
  margin-top: 25px;
}

.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border-radius: 11px;
  color: rgba(255, 255, 255, 0.58);
  background: transparent;
  align-items: center;
  gap: 11px;
  font-size: calc(12px * var(--font-scale));
  font-weight: 600;
  text-align: left;
  transition: 0.2s ease;
}

.nav-item:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.055);
}

.nav-item.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
}

.nav-item.active::before {
  position: absolute;
  top: 14px;
  left: 0;
  width: 3px;
  height: 18px;
  border-radius: 0 5px 5px 0;
  background: #eacb91;
  content: "";
}

.nav-item .icon {
  width: 18px;
  height: 18px;
}

.nav-badge {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  color: var(--sage-deep);
  background: #eacb91;
  font-size: calc(9px * var(--font-scale));
  font-weight: 800;
  line-height: 19px;
  text-align: center;
}

.nav-badge.soft {
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-spacer {
  flex: 1;
}

.side-quote {
  position: relative;
  z-index: 1;
  margin: 0 2px 17px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.035);
}

.side-quote .icon {
  width: 17px;
  height: 17px;
  margin-bottom: 9px;
  color: #eacb91;
}

.side-quote p {
  margin: 0;
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--font-serif);
  font-size: calc(10px * var(--font-scale));
  line-height: 1.8;
}

.sidebar-profile {
  display: grid;
  padding: 11px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  grid-template-columns: 38px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 9px;
}

.profile-avatar,
.avatar {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--white);
  background: var(--avatar-a, #769a83);
  background-image: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.2),
    transparent 55%
  );
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.profile-avatar {
  width: 38px;
  height: 38px;
  font-size: calc(12px * var(--font-scale));
}

.profile-avatar,
.topbar-avatar {
  padding: 0;
  border: 0;
  cursor: pointer;
}

.profile-avatar img,
.avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.topbar-avatar {
  display: grid;
  overflow: hidden;
  border-radius: 50%;
  background: transparent;
  place-items: center;
}

.topbar-avatar .avatar {
  width: 32px;
  height: 32px;
}

.profile-copy {
  min-width: 0;
}

.profile-copy strong {
  display: block;
  overflow: hidden;
  color: var(--white);
  font-size: calc(11px * var(--font-scale));
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy span {
  display: flex;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.37);
  align-items: center;
  gap: 5px;
  font-size: calc(8px * var(--font-scale));
}

.online-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #87c69a;
  box-shadow: 0 0 0 2px rgba(135, 198, 154, 0.13);
}

.online-dot.offline {
  background: #a2aaa4;
  box-shadow: none;
}

.profile-logout {
  display: grid;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.35);
  background: transparent;
  place-items: center;
}

.profile-logout:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.07);
}

.profile-logout .icon {
  width: 15px;
  height: 15px;
}

.main-shell {
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: 72px;
  padding: 0 clamp(24px, 4vw, 54px);
  border-bottom: 1px solid rgba(217, 213, 201, 0.75);
  background: rgba(244, 241, 232, 0.86);
  backdrop-filter: blur(16px);
  align-items: center;
  justify-content: space-between;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-title strong {
  font-family: var(--font-serif);
  font-size: calc(16px * var(--font-scale));
  font-weight: 600;
  letter-spacing: 0.03em;
}

.topbar-title span {
  color: var(--faint);
  font-size: calc(10px * var(--font-scale));
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 13px;
}

.date-chip {
  display: flex;
  color: var(--muted);
  align-items: center;
  gap: 7px;
  font-size: calc(10px * var(--font-scale));
}

.date-chip .icon {
  width: 14px;
  height: 14px;
}

.topbar-divider {
  width: 1px;
  height: 20px;
  background: var(--line-strong);
}

.topbar-presence {
  display: flex;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.72);
  align-items: center;
  gap: 7px;
  font-size: calc(9px * var(--font-scale));
}

.mobile-brand {
  display: none;
}

.content {
  width: 100%;
  max-width: 1460px;
  min-height: calc(100vh - 72px);
  padding: clamp(25px, 3.6vw, 50px) clamp(22px, 4vw, 54px) 52px;
  margin: 0 auto;
}

.panel,
.stat-card,
.quick-link,
.letter-card,
.admin-letter-card,
.account-stat {
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    background-color 0.25s ease;
}

.panel:hover,
.stat-card:hover,
.account-stat:hover {
  border-color: var(--line-strong);
  box-shadow: 0 13px 32px rgba(35, 52, 43, 0.08);
}

.theme-toggle {
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.page-heading {
  display: flex;
  margin-bottom: 26px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.page-heading h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(27px, 2.5vw, 36px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.page-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: calc(12px * var(--font-scale));
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.mobile-bottom-nav {
  display: none;
}

/* Dashboard */

.hero-panel {
  position: relative;
  display: grid;
  overflow: hidden;
  min-height: 230px;
  padding: clamp(28px, 4vw, 45px);
  border-radius: var(--radius-lg);
  color: var(--white);
  background:
    radial-gradient(circle at 92% 8%, rgba(238, 210, 160, 0.2), transparent 25%),
    linear-gradient(125deg, #315346 0%, #3e6555 68%, #527865 100%);
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.hero-panel::before {
  position: absolute;
  top: -155px;
  right: -35px;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  box-shadow:
    0 0 0 45px rgba(255, 255, 255, 0.025),
    0 0 0 92px rgba(255, 255, 255, 0.016);
  content: "";
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-copy h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(33px, 4vw, 50px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 520px;
  margin: 13px 0 22px;
  color: rgba(255, 255, 255, 0.56);
  font-size: calc(12px * var(--font-scale));
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.hero-actions .primary-button {
  color: var(--sage-deep);
  background: #f0d3a1;
  box-shadow: none;
}

.hero-actions .primary-button:hover {
  background: #f6dfb9;
}

.hero-actions .secondary-button {
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.07);
}

.hero-actions .secondary-button:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
}

.hero-orbit {
  position: relative;
  z-index: 1;
  display: grid;
  width: 198px;
  height: 198px;
  margin-left: auto;
  place-items: center;
}

.hero-orbit::before,
.hero-orbit::after {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  content: "";
}

.hero-orbit::before {
  inset: 0;
}

.hero-orbit::after {
  inset: 22px;
  border-style: dashed;
}

.orbit-center {
  display: grid;
  width: 121px;
  height: 121px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(4px);
  place-items: center;
  text-align: center;
}

.orbit-center strong {
  display: block;
  font-family: var(--font-serif);
  font-size: calc(34px * var(--font-scale));
  font-weight: 500;
  line-height: 1;
}

.orbit-center span {
  display: block;
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.52);
  font-size: calc(8px * var(--font-scale));
  letter-spacing: 0.11em;
}

.orbit-dot {
  position: absolute;
  display: grid;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--sage-deep);
  background: #f0d3a1;
  place-items: center;
  font-size: calc(10px * var(--font-scale));
  font-weight: 800;
}

.orbit-dot.one {
  top: 3px;
  right: 17px;
}

.orbit-dot.two {
  bottom: 9px;
  left: 7px;
  color: var(--white);
  background: #d8956d;
}

.overview-grid {
  display: grid;
  margin-top: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  position: relative;
  display: flex;
  overflow: hidden;
  min-height: 104px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.8);
  align-items: center;
  gap: 15px;
  box-shadow: 0 5px 18px rgba(48, 62, 54, 0.025);
}

.stat-icon {
  display: grid;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: var(--sage-dark);
  background: var(--sage-pale);
  place-items: center;
}

.stat-card:nth-child(2) .stat-icon {
  color: #9a6a47;
  background: var(--peach-pale);
}

.stat-card:nth-child(3) .stat-icon {
  color: #8d752c;
  background: #faf1d6;
}

.stat-card:nth-child(4) .stat-icon {
  color: #657287;
  background: #eaedf2;
}

.stat-icon .icon {
  width: 19px;
  height: 19px;
}

.stat-value {
  display: block;
  font-family: var(--font-serif);
  font-size: calc(24px * var(--font-scale));
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.stat-label {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: calc(10px * var(--font-scale));
}

.stat-trend {
  position: absolute;
  top: 17px;
  right: 16px;
  color: var(--faint);
  font-size: calc(8px * var(--font-scale));
}

.dashboard-lower {
  display: grid;
  margin-top: 18px;
  grid-template-columns: minmax(0, 1.45fr) minmax(285px, 0.55fr);
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.84);
  box-shadow: 0 5px 20px rgba(45, 62, 53, 0.025);
}

.panel-header {
  display: flex;
  min-height: 63px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.panel-title h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: calc(15px * var(--font-scale));
  font-weight: 700;
}

.topbar-tool {
  display: grid;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--paper);
  place-items: center;
}

.topbar-tool:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  transform: rotate(8deg);
}

.settings-body {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.settings-controls {
  display: grid;
  gap: 22px;
}

.settings-preview {
  overflow: hidden;
  min-height: 230px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 90% 8%, color-mix(in srgb, var(--peach) 25%, transparent), transparent 30%),
    var(--sage-pale);
}

.preview-window-bar {
  display: flex;
  margin-bottom: 36px;
  gap: 5px;
}

.preview-window-bar i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
  opacity: 0.55;
}

.settings-preview > strong {
  display: block;
  font-family: var(--font-serif);
  font-size: calc(18px * var(--font-scale));
}

.settings-preview > p {
  margin: 5px 0 20px;
  color: var(--muted);
  font-size: calc(8px * var(--font-scale));
}

.preview-chat {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.preview-chat > div {
  display: grid;
  padding: 8px 10px;
  border-radius: 4px 12px 12px 12px;
  background: var(--paper);
  gap: 3px;
}

.preview-chat small {
  color: var(--faint);
  font-size: calc(7px * var(--font-scale));
}

.preview-chat b {
  font-size: calc(9px * var(--font-scale));
  font-weight: 500;
}

.settings-section {
  display: grid;
  gap: 13px;
}

.settings-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-heading > .icon {
  width: 18px;
  height: 18px;
  color: var(--sage);
}

.settings-heading strong {
  display: block;
  font-size: calc(11px * var(--font-scale));
}

.settings-heading span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: calc(8px * var(--font-scale));
}

.segmented-control {
  display: grid;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f3f1ea;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
}

.segmented-control button {
  height: 34px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: calc(9px * var(--font-scale));
  font-weight: 700;
}

.segmented-control button.active {
  color: var(--white);
  background: var(--sage-dark);
  box-shadow: var(--shadow-sm);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.theme-option {
  display: grid;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: var(--paper);
  justify-items: center;
  gap: 6px;
  font-size: calc(8px * var(--font-scale));
  font-weight: 700;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.theme-option:hover {
  transform: translateY(-2px);
}

.theme-option.active {
  border-color: var(--sage);
  color: var(--ink);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--sage) 20%, transparent);
}

.theme-swatch {
  display: block;
  width: 100%;
  height: 29px;
  border-radius: 7px;
}

.theme-swatch-light {
  background:
    radial-gradient(circle at 24% 28%, #fff 0 2px, transparent 3px),
    linear-gradient(135deg, #fbf8ef, #d8c5a1);
  background-size: 12px 12px, auto;
}

.theme-swatch-night {
  background:
    radial-gradient(circle at 22% 25%, #f4dba0 0 1px, transparent 2px),
    linear-gradient(135deg, #0b1611, #426e5a);
  background-size: 13px 13px, auto;
}

.theme-swatch-ocean {
  background:
    repeating-linear-gradient(-12deg, transparent 0 6px, rgba(255, 255, 255, 0.18) 6px 7px),
    linear-gradient(135deg, #e7f2f0, #5d939a);
}

.theme-swatch-sakura {
  background:
    radial-gradient(ellipse at 24% 28%, #fff 0 2px, transparent 3px),
    radial-gradient(ellipse at 72% 68%, #f6d9df 0 2px, transparent 3px),
    linear-gradient(135deg, #fff1f2, #d99eb0);
  background-size: 15px 15px, 19px 19px, auto;
}

.theme-swatch-lavender {
  background:
    radial-gradient(circle at 25% 30%, #fff 0 1px, transparent 2px),
    linear-gradient(135deg, #f3edf8, #9b88b8);
  background-size: 11px 11px, auto;
}

.settings-row {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.switch-control {
  position: relative;
  width: 42px;
  height: 24px;
  padding: 0;
  border-radius: 999px;
  background: #d8d9d3;
  flex: 0 0 auto;
  transition: background 0.2s ease;
}

.switch-control i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.switch-control.active {
  background: var(--sage-dark);
}

.switch-control.active i {
  transform: translateX(18px);
}

.panel-title .icon {
  width: 16px;
  height: 16px;
  color: var(--sage);
}

.text-link {
  display: inline-flex;
  padding: 5px 0;
  color: var(--sage);
  background: transparent;
  align-items: center;
  gap: 4px;
  font-size: calc(10px * var(--font-scale));
  font-weight: 700;
}

.text-link:hover {
  color: var(--sage-dark);
}

.text-link .icon {
  width: 13px;
  height: 13px;
}

.message-preview-list {
  display: grid;
  padding: 6px 10px 10px;
}

.message-preview {
  display: grid;
  width: 100%;
  padding: 13px 10px;
  border-radius: 12px;
  color: inherit;
  background: transparent;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  transition: background 0.18s ease;
}

.message-preview:hover {
  background: #f4f4ed;
}

.avatar {
  width: 40px;
  height: 40px;
  font-size: calc(11px * var(--font-scale));
}

.avatar.lg {
  width: 48px;
  height: 48px;
  font-size: calc(13px * var(--font-scale));
}

.avatar.sm {
  width: 30px;
  height: 30px;
  font-size: calc(9px * var(--font-scale));
}

.avatar.xs {
  width: 25px;
  height: 25px;
  border: 2px solid var(--paper);
  font-size: calc(8px * var(--font-scale));
}

.avatar-status {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 10px;
  height: 10px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: #7cbb91;
}

.avatar-status.offline {
  background: #bdc3bd;
}

.message-preview-copy {
  min-width: 0;
}

.message-preview-line {
  display: flex;
  margin-bottom: 2px;
  align-items: center;
  gap: 7px;
}

.message-preview-line strong {
  font-size: calc(11px * var(--font-scale));
}

.message-preview-line span {
  overflow: hidden;
  max-width: 130px;
  color: var(--faint);
  font-size: calc(8px * var(--font-scale));
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-preview-copy p {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: calc(10px * var(--font-scale));
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-time {
  align-self: flex-start;
  padding-top: 3px;
  color: var(--faint);
  font-size: calc(8px * var(--font-scale));
  white-space: nowrap;
}

.empty-mini {
  display: grid;
  min-height: 200px;
  padding: 32px;
  color: var(--muted);
  place-content: center;
  justify-items: center;
  text-align: center;
}

.empty-mini .icon {
  width: 30px;
  height: 30px;
  margin-bottom: 10px;
  color: #c4cbc5;
}

.empty-mini p {
  margin: 0;
  font-size: calc(11px * var(--font-scale));
}

.side-stack {
  display: grid;
  align-content: start;
  gap: 18px;
}

.online-panel {
  padding: 19px 20px 20px;
}

.online-panel-header {
  display: flex;
  margin-bottom: 17px;
  align-items: center;
  justify-content: space-between;
}

.online-panel-header h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: calc(14px * var(--font-scale));
}

.live-label {
  display: flex;
  color: var(--sage);
  align-items: center;
  gap: 5px;
  font-size: calc(8px * var(--font-scale));
  font-weight: 700;
}

.live-label::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #73ad82;
  box-shadow: 0 0 0 3px rgba(115, 173, 130, 0.13);
  content: "";
}

.online-avatars {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.online-avatar {
  position: relative;
}

.online-avatar .avatar {
  width: 35px;
  height: 35px;
  font-size: calc(9px * var(--font-scale));
}

.online-avatar::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 8px;
  height: 8px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: #79b98e;
  content: "";
}

.online-names {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: calc(9px * var(--font-scale));
  line-height: 1.65;
}

.online-names strong {
  color: var(--ink-soft);
}

.quick-links {
  display: grid;
  gap: 8px;
}

.quick-link {
  display: flex;
  width: 100%;
  min-height: 70px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.8);
  align-items: center;
  gap: 11px;
  text-align: left;
}

.quick-link:hover {
  border-color: #d1d8d1;
  background: var(--white);
}

.quick-link-icon {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  color: var(--sage-dark);
  border: 1px solid color-mix(in srgb, var(--line-strong) 72%, transparent);
  background: var(--paper);
  place-items: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 5px 14px rgba(41, 57, 48, 0.07);
}

.quick-link:nth-child(2) .quick-link-icon {
  background: var(--paper);
}

.quick-link:nth-child(3) .quick-link-icon {
  background: var(--paper);
}

.quick-link-icon .icon {
  width: 22px;
  height: 22px;
}

.quick-link-icon .art-icon {
  width: 35px;
  height: 35px;
}

.quick-link strong {
  display: block;
  font-size: calc(10px * var(--font-scale));
}

.quick-link span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: calc(8px * var(--font-scale));
}

.quick-link > .icon {
  width: 14px;
  height: 14px;
  margin-left: auto;
  color: var(--faint);
}

/* Messages */

.chat-page {
  height: calc(100vh - 72px - 50px - 97px);
  min-height: 535px;
  max-height: 780px;
}

.chat-shell {
  display: grid;
  overflow: hidden;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  grid-template-columns: 310px minmax(0, 1fr);
}

.contact-pane {
  display: flex;
  overflow: hidden;
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #fbfaf5;
  flex-direction: column;
}

.contact-header {
  padding: 19px 16px 12px;
}

.contact-heading-row {
  display: flex;
  margin-bottom: 14px;
  align-items: center;
  justify-content: space-between;
}

.contact-heading-row h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: calc(17px * var(--font-scale));
}

.contact-heading-row span {
  color: var(--faint);
  font-size: calc(8px * var(--font-scale));
}

.search-shell {
  position: relative;
}

.search-shell .icon {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 14px;
  height: 14px;
  color: var(--faint);
  transform: translateY(-50%);
}

.search-input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 33px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-size: calc(10px * var(--font-scale));
}

.search-input:focus {
  border-color: #bcc8bf;
  box-shadow: 0 0 0 3px rgba(111, 142, 122, 0.08);
}

.mode-switch {
  display: grid;
  padding: 4px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f2f0e8;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
}

.mode-switch button {
  height: 30px;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: calc(9px * var(--font-scale));
  font-weight: 700;
}

.mode-switch button.active {
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 2px 8px rgba(45, 62, 53, 0.07);
}

.contact-list {
  overflow-y: auto;
  padding: 3px 8px 12px;
}

.contact-item {
  position: relative;
  display: grid;
  width: 100%;
  padding: 11px 9px;
  border-radius: 11px;
  color: inherit;
  background: transparent;
  grid-template-columns: 39px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.contact-item:hover {
  background: #f1f3ec;
}

.contact-item.active {
  background: var(--sage-pale);
}

.contact-item .avatar {
  width: 39px;
  height: 39px;
  font-size: calc(10px * var(--font-scale));
}

.contact-copy {
  min-width: 0;
}

.contact-name-row {
  display: flex;
  margin-bottom: 2px;
  align-items: center;
  gap: 6px;
}

.contact-name-row strong {
  overflow: hidden;
  font-size: calc(10px * var(--font-scale));
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-tag {
  padding: 1px 5px;
  border-radius: 4px;
  color: #966647;
  background: var(--peach-pale);
  font-size: calc(7px * var(--font-scale));
  font-weight: 700;
  white-space: nowrap;
}

.audit-tag {
  color: var(--sage);
  background: var(--sage-pale);
}

.contact-copy p {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: calc(8px * var(--font-scale));
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-meta {
  align-self: stretch;
  padding-top: 2px;
  text-align: right;
}

.contact-meta time {
  display: block;
  color: var(--faint);
  font-size: calc(7px * var(--font-scale));
  white-space: nowrap;
}

.unread-count {
  display: inline-grid;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  margin-top: 7px;
  border-radius: 999px;
  color: var(--white);
  background: var(--peach);
  place-items: center;
  font-size: calc(7px * var(--font-scale));
  font-weight: 800;
}

.chat-panel {
  display: flex;
  overflow: hidden;
  min-width: 0;
  background:
    radial-gradient(circle at 15% 30%, rgba(111, 142, 122, 0.055), transparent 27%),
    #fffcf7;
  flex-direction: column;
}

.chat-empty {
  display: grid;
  height: 100%;
  padding: 30px;
  color: var(--muted);
  place-content: center;
  justify-items: center;
  text-align: center;
}

.chat-empty-art {
  position: relative;
  display: grid;
  width: 90px;
  height: 90px;
  margin-bottom: 21px;
  border: 1px solid #e3ded1;
  border-radius: 50%;
  background: #faf6eb;
  place-items: center;
}

.chat-empty-art::after {
  position: absolute;
  inset: 11px;
  border: 1px dashed #dbd5c6;
  border-radius: 50%;
  content: "";
}

.chat-empty-art .icon {
  width: 28px;
  height: 28px;
  color: #aeb9af;
}

.chat-empty h2 {
  margin: 0 0 6px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: calc(18px * var(--font-scale));
}

.chat-empty p {
  max-width: 280px;
  margin: 0;
  font-size: calc(10px * var(--font-scale));
  line-height: 1.7;
}

.chat-top {
  display: flex;
  min-height: 68px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.88);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-person {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.chat-person .avatar {
  width: 39px;
  height: 39px;
  font-size: calc(10px * var(--font-scale));
}

.chat-person-copy {
  min-width: 0;
}

.chat-person-copy strong {
  display: block;
  overflow: hidden;
  font-size: calc(11px * var(--font-scale));
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-person-copy span {
  display: flex;
  margin-top: 3px;
  color: var(--muted);
  align-items: center;
  gap: 5px;
  font-size: calc(8px * var(--font-scale));
}

.chat-top-badge {
  display: flex;
  padding: 6px 9px;
  border-radius: 999px;
  color: #8a6a48;
  background: #f8eddc;
  align-items: center;
  gap: 5px;
  font-size: calc(8px * var(--font-scale));
  font-weight: 700;
  white-space: nowrap;
}

.chat-top-badge .icon {
  width: 12px;
  height: 12px;
}

.mobile-back {
  display: none;
  width: 32px;
  height: 32px;
  margin-left: -8px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  place-items: center;
}

.message-scroll {
  overflow-y: auto;
  padding: 24px clamp(18px, 3vw, 34px);
  flex: 1;
}

.date-divider {
  display: flex;
  margin: 0 0 22px;
  color: var(--faint);
  align-items: center;
  gap: 12px;
  font-size: calc(8px * var(--font-scale));
  text-align: center;
}

.date-divider::before,
.date-divider::after {
  height: 1px;
  background: #eeebe3;
  content: "";
  flex: 1;
}

.message-row {
  display: flex;
  margin-bottom: 17px;
  align-items: flex-end;
  gap: 8px;
}

.message-row.mine {
  flex-direction: row-reverse;
}

.message-row .avatar {
  width: 27px;
  height: 27px;
  margin-bottom: 2px;
  font-size: calc(7px * var(--font-scale));
}

.bubble-wrap {
  max-width: min(68%, 510px);
}

.bubble-author {
  margin: 0 0 4px 4px;
  color: var(--faint);
  font-size: calc(7px * var(--font-scale));
}

.message-row.mine .bubble-author {
  margin-right: 4px;
  text-align: right;
}

.bubble {
  padding: 10px 13px;
  border: 1px solid #e8e4da;
  border-radius: 5px 15px 15px 15px;
  color: var(--ink-soft);
  background: var(--white);
  font-size: calc(11px * var(--font-scale));
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message-row.mine .bubble {
  border-color: transparent;
  border-radius: 15px 5px 15px 15px;
  color: var(--white);
  background: var(--sage-dark);
}

.bubble-time {
  display: block;
  margin-top: 4px;
  color: var(--faint);
  font-size: calc(7px * var(--font-scale));
}

.message-row.mine .bubble-time {
  text-align: right;
}

.bubble-sticker {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.message-row.mine .bubble-sticker .bubble-time {
  color: var(--muted);
}

.chat-sticker {
  display: block;
  font-size: calc(48px * var(--font-scale));
  line-height: 1.15;
}

.chat-media {
  display: block;
  overflow: hidden;
  width: min(280px, 65vw);
  padding: 0;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.08);
}

.chat-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: contain;
}

.chat-caption {
  display: block;
  margin-top: 7px;
  color: inherit;
  font-size: calc(10px * var(--font-scale));
}

.bubble-image {
  padding: 4px !important;
}

.bubble-audio {
  min-width: 220px;
}

.voice-bubble {
  display: flex;
  min-width: 210px;
  min-height: 38px;
  padding: 4px 7px;
  border: 0;
  border-radius: 9px;
  color: inherit;
  background: transparent;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.voice-play {
  display: grid;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--white);
  background: var(--sage-dark);
  place-items: center;
  flex: 0 0 auto;
}

.message-row.mine .voice-play {
  color: var(--sage-dark);
  background: rgba(255, 255, 255, 0.9);
}

.voice-play .icon {
  width: 13px;
  height: 13px;
}

.voice-wave {
  display: flex;
  height: 26px;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.voice-wave i {
  width: 2px;
  height: var(--wave-height);
  border-radius: 999px;
  background: currentColor;
  opacity: 0.58;
  transform-origin: center;
}

.voice-bubble.playing .voice-wave i {
  animation: voice-wave 0.75s ease-in-out infinite alternate;
}

.voice-bubble.playing .voice-wave i:nth-child(2n) {
  animation-delay: 0.12s;
}

.voice-bubble.playing .voice-wave i:nth-child(3n) {
  animation-delay: 0.24s;
}

.voice-duration {
  color: currentColor;
  font-size: calc(8px * var(--font-scale));
  opacity: 0.66;
  white-space: nowrap;
}

@keyframes voice-wave {
  from {
    transform: scaleY(0.5);
    opacity: 0.4;
  }
  to {
    transform: scaleY(1.08);
    opacity: 0.9;
  }
}

.empty-chat-stream {
  display: grid;
  height: 100%;
  color: var(--faint);
  place-content: center;
  justify-items: center;
  text-align: center;
}

.empty-chat-stream .icon {
  width: 27px;
  height: 27px;
  margin-bottom: 10px;
  color: #ccd1cb;
}

.empty-chat-stream p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: calc(12px * var(--font-scale));
}

.composer {
  position: relative;
  padding: 12px 18px 15px;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.94);
}

.composer-tools {
  display: flex;
  min-height: 30px;
  margin: 0 1px 7px;
  align-items: center;
  gap: 4px;
}

.composer-tool {
  position: relative;
  display: grid;
  width: 29px;
  height: 29px;
  padding: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  place-items: center;
}

.composer-tool:hover,
.composer-tool.recording {
  color: var(--sage-dark);
  background: var(--sage-pale);
}

.composer-tool.recording {
  color: var(--danger);
  background: var(--danger-pale);
}

.composer-tool input,
.sticker-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.voice-status {
  margin-left: 3px;
  color: var(--danger);
  font-size: calc(8px * var(--font-scale));
  font-weight: 700;
}

.emoji-panel,
.sticker-panel {
  position: absolute;
  z-index: 10;
  right: 18px;
  bottom: calc(100% - 4px);
  display: grid;
  width: min(320px, calc(100% - 36px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
  box-shadow: var(--shadow-md);
  gap: 3px;
}

.emoji-panel[hidden],
.sticker-panel[hidden] {
  display: none;
}

.emoji-panel {
  display: flex;
  width: min(370px, calc(100% - 36px));
  flex-direction: column;
}

.sticker-panel {
  grid-template-columns: repeat(4, 1fr);
}

.emoji-panel button,
.sticker-panel button {
  display: grid;
  min-height: 34px;
  padding: 3px;
  border-radius: 8px;
  background: transparent;
  place-items: center;
  font-size: calc(20px * var(--font-scale));
}

.emoji-grid {
  display: grid;
  overflow-y: auto;
  max-height: 228px;
  padding: 2px 1px 7px;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 2px;
}

.emoji-tabs {
  display: grid;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 2px;
}

.emoji-tabs button {
  min-height: 26px;
  padding: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: calc(7px * var(--font-scale));
  font-weight: 700;
}

.emoji-tabs button.active {
  color: var(--sage-dark);
  background: var(--sage-pale);
}

.emoji-empty {
  display: grid;
  min-height: 145px;
  color: var(--muted);
  grid-column: 1 / -1;
  place-content: center;
  justify-items: center;
  gap: 8px;
  font-size: calc(8px * var(--font-scale));
}

.sticker-panel button {
  min-height: 54px;
  font-size: calc(34px * var(--font-scale));
}

.emoji-panel button:hover,
.sticker-panel button:hover {
  background: var(--sage-pale);
}

.sticker-upload {
  display: flex;
  min-height: 54px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  color: var(--muted);
  grid-column: span 2;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: calc(8px * var(--font-scale));
  cursor: pointer;
}

.composer-shell {
  display: flex;
  min-height: 43px;
  padding: 5px 5px 5px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--white);
  align-items: flex-end;
  gap: 8px;
}

.composer-shell:focus-within {
  border-color: #aebdb2;
  box-shadow: 0 0 0 3px rgba(111, 142, 122, 0.07);
}

.composer textarea {
  width: 100%;
  max-height: 100px;
  padding: 7px 0 5px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: calc(11px * var(--font-scale));
  line-height: 1.6;
}

.composer textarea::placeholder {
  color: #b5bcb6;
}

.send-button {
  display: grid;
  width: 35px;
  height: 35px;
  border-radius: 9px;
  color: var(--white);
  background: var(--sage-dark);
  place-items: center;
  flex: 0 0 auto;
}

.send-button:hover {
  background: var(--sage-deep);
}

.send-button .icon {
  width: 15px;
  height: 15px;
}

.composer-hint {
  margin: 6px 2px 0;
  color: var(--faint);
  font-size: calc(7px * var(--font-scale));
  text-align: right;
}

.audit-banner {
  display: flex;
  min-height: 58px;
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  color: #8a6a48;
  background: #fbf2e4;
  align-items: center;
  gap: 9px;
}

.audit-banner .icon {
  width: 16px;
  height: 16px;
}

.audit-banner p {
  margin: 0;
  font-size: calc(9px * var(--font-scale));
  line-height: 1.6;
}

/* Mailbox */

.mailbox-hero {
  position: relative;
  display: flex;
  overflow: hidden;
  min-height: 153px;
  padding: 28px 31px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  color: var(--white);
  background:
    radial-gradient(circle at 86% 13%, color-mix(in srgb, var(--peach) 26%, transparent), transparent 26%),
    linear-gradient(100deg, var(--sage-deep), var(--sage-dark)),
    repeating-linear-gradient(
      -35deg,
      transparent,
      transparent 14px,
      rgba(255, 255, 255, 0.05) 14px,
      rgba(255, 255, 255, 0.05) 15px
    );
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}

.mailbox-hero::after {
  position: absolute;
  top: -110px;
  right: 10%;
  width: 310px;
  height: 310px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  box-shadow: 0 0 0 38px rgba(255, 255, 255, 0.02);
  content: "";
}

.mailbox-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 660px;
}

.mailbox-hero h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(27px, 3vw, 38px);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.mailbox-hero p:not(.eyebrow) {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.53);
  font-size: calc(11px * var(--font-scale));
}

.mailbox-stamp {
  position: relative;
  z-index: 1;
  display: grid;
  width: 86px;
  height: 65px;
  padding: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.34);
  color: #efd5a4;
  background: rgba(255, 255, 255, 0.04);
  place-items: center;
  font-family: var(--font-serif);
  font-size: calc(12px * var(--font-scale));
  text-align: center;
  transform: rotate(3deg);
}

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

.letter-card {
  position: relative;
  display: flex;
  overflow: hidden;
  min-height: 290px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(
      color-mix(in srgb, var(--paper) 94%, transparent),
      color-mix(in srgb, var(--paper) 94%, transparent)
    ),
    repeating-linear-gradient(
      transparent,
      transparent 27px,
      color-mix(in srgb, var(--ink) 7%, transparent) 27px,
      color-mix(in srgb, var(--ink) 7%, transparent) 28px
    );
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.letter-card::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 76px;
  height: 76px;
  background: linear-gradient(
    225deg,
    color-mix(in srgb, var(--sage-pale) 90%, transparent) 50%,
    transparent 50%
  );
  content: "";
}

.letter-card.locked {
  color: var(--ink);
  background:
    radial-gradient(
      circle at 80% 10%,
      color-mix(in srgb, var(--yellow) 18%, transparent),
      transparent 24%
    ),
    var(--cream);
}

.letter-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.letter-label {
  display: flex;
  color: var(--sage);
  align-items: center;
  gap: 6px;
  font-size: calc(8px * var(--font-scale));
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.letter-label .icon {
  width: 12px;
  height: 12px;
}

.letter-date {
  color: var(--faint);
  font-size: calc(8px * var(--font-scale));
}

.letter-card h3 {
  position: relative;
  margin: 29px 0 12px;
  font-family: var(--font-serif);
  font-size: calc(20px * var(--font-scale));
  font-weight: 600;
  line-height: 1.45;
}

.letter-card p.letter-preview {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: calc(11px * var(--font-scale));
  line-height: 1.9;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.letter-card-footer {
  display: flex;
  padding-top: 17px;
  margin-top: auto;
  border-top: 1px solid rgba(217, 211, 197, 0.68);
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.letter-signature {
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: calc(9px * var(--font-scale));
}

.read-letter-button {
  display: inline-flex;
  padding: 6px 0;
  color: var(--sage-dark);
  background: transparent;
  align-items: center;
  gap: 4px;
  font-size: calc(9px * var(--font-scale));
  font-weight: 700;
}

.read-letter-button .icon {
  width: 12px;
  height: 12px;
}

.locked-letter-body {
  display: flex;
  margin: auto 0;
  align-items: center;
  gap: 17px;
}

.wax-seal {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  border: 4px double rgba(88, 63, 55, 0.22);
  border-radius: 50%;
  color: #f4dfc6;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.15), transparent 30%),
    color-mix(in srgb, var(--peach) 82%, #7b5048);
  place-items: center;
  box-shadow: 0 6px 13px rgba(84, 56, 47, 0.16);
  flex: 0 0 auto;
  transform: rotate(-7deg);
}

.wax-seal .icon {
  width: 20px;
  height: 20px;
}

.locked-copy strong {
  display: block;
  margin-bottom: 5px;
  font-family: var(--font-serif);
  font-size: calc(14px * var(--font-scale));
}

.locked-copy p {
  margin: 0;
  color: var(--muted);
  font-size: calc(9px * var(--font-scale));
  line-height: 1.65;
}

.countdown {
  margin-top: 10px;
  color: var(--peach);
  font-size: calc(9px * var(--font-scale));
  font-weight: 700;
  letter-spacing: 0.02em;
}

.student-mailbox-empty {
  display: grid;
  min-height: 290px;
  padding: 40px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--muted);
  background: rgba(255, 253, 248, 0.5);
  grid-column: 1 / -1;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.student-mailbox-empty .icon {
  width: 31px;
  height: 31px;
  margin-bottom: 11px;
  color: #c4cbc5;
}

.student-mailbox-empty p {
  max-width: 330px;
  margin: 0;
  font-size: calc(10px * var(--font-scale));
  line-height: 1.7;
}

.admin-mailbox-layout {
  display: grid;
  grid-template-columns: minmax(310px, 0.72fr) minmax(0, 1.28fr);
  align-items: start;
  gap: 18px;
}

.compose-mail-panel {
  position: sticky;
  top: 90px;
  overflow: hidden;
}

.compose-mail-panel .panel-header {
  padding: 0 20px;
}

.letter-form {
  display: grid;
  padding: 18px 20px 21px;
  gap: 15px;
}

.letter-form label {
  font-size: calc(10px * var(--font-scale));
  font-weight: 700;
}

.letter-form .text-area {
  min-height: 121px;
  font-family: var(--font-serif);
  font-size: calc(11px * var(--font-scale));
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.recipient-head {
  display: flex;
  margin-bottom: 8px;
  align-items: center;
  justify-content: space-between;
}

.recipient-all {
  display: flex;
  color: var(--sage);
  align-items: center;
  gap: 5px;
  font-size: calc(9px * var(--font-scale));
  cursor: pointer;
}

.recipient-all input {
  accent-color: var(--sage-dark);
}

.recipient-scroll {
  display: grid;
  overflow-y: auto;
  max-height: 145px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfaf5;
  grid-template-columns: 1fr 1fr;
  gap: 2px 8px;
}

.recipient-check {
  display: flex;
  min-width: 0;
  padding: 5px 3px;
  color: var(--muted);
  align-items: center;
  gap: 6px;
  font-size: calc(9px * var(--font-scale));
  font-weight: 400;
  cursor: pointer;
}

.recipient-check input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--sage-dark);
}

.recipient-check span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-note {
  padding: 9px 10px;
  border-radius: 9px;
  color: #7b6b4f;
  background: #faf2df;
  font-size: calc(8px * var(--font-scale));
  line-height: 1.65;
}

.admin-letter-list {
  display: grid;
  gap: 12px;
}

.admin-letter-card {
  position: relative;
  overflow: hidden;
  padding: 21px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.86);
  box-shadow: 0 4px 15px rgba(45, 62, 53, 0.025);
}

.admin-letter-top {
  display: flex;
  margin-bottom: 15px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-letter-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: calc(16px * var(--font-scale));
  font-weight: 600;
}

.status-badge {
  display: inline-flex;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  align-items: center;
  gap: 5px;
  font-size: calc(8px * var(--font-scale));
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.locked {
  color: #8a6a48;
  background: #f8eddc;
}

.status-badge.unlocked {
  color: var(--sage-dark);
  background: var(--sage-pale);
}

.status-badge.active {
  color: var(--sage-dark);
  background: var(--sage-pale);
}

.status-badge.inactive {
  color: #8c8e89;
  background: #eeece7;
}

.status-badge.disabled {
  color: var(--danger);
  background: var(--danger-pale);
}

.admin-letter-meta {
  display: flex;
  flex-wrap: wrap;
  color: var(--muted);
  align-items: center;
  gap: 14px;
  font-size: calc(8px * var(--font-scale));
}

.admin-letter-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.admin-letter-meta .icon {
  width: 12px;
  height: 12px;
}

.recipient-stack {
  display: flex;
  margin-top: 14px;
  align-items: center;
}

.recipient-stack .avatar {
  margin-left: -6px;
}

.recipient-stack .avatar:first-child {
  margin-left: 0;
}

.recipient-more-text {
  margin-left: 7px;
  color: var(--muted);
  font-size: calc(8px * var(--font-scale));
}

.admin-letter-preview {
  display: -webkit-box;
  overflow: hidden;
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: calc(10px * var(--font-scale));
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.admin-letter-actions {
  display: flex;
  padding-top: 13px;
  margin-top: 15px;
  border-top: 1px solid var(--line);
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.admin-letter-actions button {
  display: inline-flex;
  height: 30px;
  padding: 0 8px;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  align-items: center;
  gap: 5px;
  font-size: calc(8px * var(--font-scale));
}

.admin-letter-actions button:hover {
  color: var(--ink);
  background: #f2f1eb;
}

.admin-letter-actions button.danger-text:hover {
  color: var(--danger);
  background: var(--danger-pale);
}

.admin-letter-actions .icon {
  width: 12px;
  height: 12px;
}

/* Accounts */

.account-overview {
  display: grid;
  margin-bottom: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.account-stat {
  display: flex;
  padding: 19px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.83);
  align-items: center;
  gap: 13px;
}

.account-stat .stat-icon {
  width: 38px;
  height: 38px;
}

.account-stat strong {
  display: block;
  font-family: var(--font-serif);
  font-size: calc(22px * var(--font-scale));
}

.account-stat span {
  display: block;
  color: var(--muted);
  font-size: calc(9px * var(--font-scale));
}

.account-panel {
  overflow: hidden;
}

.reset-request-panel {
  margin-bottom: 18px;
  border-color: color-mix(in srgb, var(--peach) 34%, var(--line));
  background:
    radial-gradient(circle at 95% 0%, color-mix(in srgb, var(--peach) 14%, transparent), transparent 26%),
    var(--paper);
}

.reset-request-list {
  display: grid;
  padding: 8px 18px 15px;
}

.reset-request-item {
  display: grid;
  min-height: 60px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}

.reset-request-item:last-child {
  border-bottom: 0;
}

.reset-request-item strong {
  display: block;
  font-size: calc(10px * var(--font-scale));
}

.reset-request-item span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: calc(8px * var(--font-scale));
}

.reset-request-item .secondary-button {
  min-height: 32px;
  font-size: calc(8px * var(--font-scale));
}

.member-directory {
  overflow: hidden;
}

.member-grid {
  display: grid;
  padding: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.member-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.member-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 11px 28px rgba(31, 47, 39, 0.07);
  transform: translateY(-2px);
}

.member-card-top {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.member-card-top .avatar {
  width: 42px;
  height: 42px;
  font-size: calc(10px * var(--font-scale));
}

.member-card-name {
  min-width: 0;
}

.member-card-name strong {
  display: block;
  overflow: hidden;
  font-size: calc(11px * var(--font-scale));
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-card-name span {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: calc(8px * var(--font-scale));
}

.member-card-meta {
  display: flex;
  padding: 12px 0;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  justify-content: space-between;
  gap: 10px;
  font-size: calc(8px * var(--font-scale));
}

.member-card-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.member-card-actions {
  display: grid;
  margin-top: 11px;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.member-card-actions button {
  display: flex;
  min-height: 30px;
  padding: 0 6px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--sage-pale);
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: calc(8px * var(--font-scale));
  font-weight: 600;
}

.member-card-actions button:hover {
  color: var(--ink);
}

.account-toolbar {
  display: flex;
  min-height: 67px;
  padding: 0 19px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.account-filters {
  display: flex;
  align-items: center;
  gap: 5px;
}

.filter-button {
  height: 29px;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: calc(9px * var(--font-scale));
  font-weight: 600;
}

.filter-button:hover {
  background: #f3f2ec;
}

.filter-button.active {
  color: var(--sage-dark);
  background: var(--sage-pale);
}

.account-toolbar .search-shell {
  width: 210px;
}

.account-table-wrap {
  overflow-x: auto;
}

.account-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.account-table th {
  padding: 12px 18px;
  color: var(--faint);
  background: #faf9f4;
  font-size: calc(8px * var(--font-scale));
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: left;
  white-space: nowrap;
}

.account-table td {
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  font-size: calc(9px * var(--font-scale));
  vertical-align: middle;
}

.account-table tbody tr {
  transition: background 0.15s ease;
}

.account-table tbody tr:hover {
  background: #fcfbf7;
}

.account-student {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-student .avatar {
  width: 33px;
  height: 33px;
  font-size: calc(9px * var(--font-scale));
}

.account-student strong {
  display: block;
  font-size: calc(10px * var(--font-scale));
}

.account-student span {
  display: block;
  color: var(--faint);
  font-size: calc(8px * var(--font-scale));
}

.online-state {
  display: inline-flex;
  color: var(--muted);
  align-items: center;
  gap: 6px;
  font-size: calc(8px * var(--font-scale));
}

.online-state .online-dot {
  width: 5px;
  height: 5px;
}

.account-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.table-action {
  display: grid;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  place-items: center;
}

.table-action:hover {
  color: var(--ink);
  background: #f1f1eb;
}

.table-action.danger:hover {
  color: var(--danger);
  background: var(--danger-pale);
}

.table-action .icon {
  width: 14px;
  height: 14px;
}

.credential-button {
  display: inline-flex;
  min-height: 30px;
  padding: 0 8px;
  border-radius: 7px;
  color: var(--ink-soft);
  background: #f3f2ec;
  align-items: center;
  gap: 4px;
  font-size: calc(8px * var(--font-scale));
  font-weight: 600;
  white-space: nowrap;
}

.credential-button:hover {
  background: var(--sage-pale);
}

.credential-button.danger {
  color: var(--danger);
  background: var(--danger-pale);
}

.credential-button .icon {
  width: 12px;
  height: 12px;
}

.account-empty {
  display: grid;
  min-height: 200px;
  color: var(--muted);
  place-content: center;
  font-size: calc(10px * var(--font-scale));
}

/* Modal and toast */

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  padding: 24px;
  background: rgba(24, 39, 33, 0.48);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  animation: fade-in 0.18s ease both;
}

.modal-card {
  overflow: hidden;
  width: min(100%, 520px);
  max-height: calc(100vh - 48px);
  border-radius: 21px;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.22s ease both;
}

.modal-card.wide {
  width: min(100%, 780px);
}

.modal-header {
  display: flex;
  min-height: 65px;
  padding: 0 21px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: calc(18px * var(--font-scale));
}

.modal-close {
  display: grid;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  place-items: center;
}

.modal-close:hover {
  color: var(--ink);
  background: #f1f1eb;
}

.modal-close .icon {
  width: 17px;
  height: 17px;
}

.modal-body {
  overflow-y: auto;
  max-height: calc(100vh - 180px);
  padding: 23px;
}

.modal-body p {
  margin: 0;
  color: var(--ink-soft);
  font-size: calc(12px * var(--font-scale));
  line-height: 1.8;
}

.modal-actions {
  display: flex;
  padding: 15px 21px;
  border-top: 1px solid var(--line);
  background: #fbfaf5;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.letter-read-header {
  padding: 14px 18px;
  border-radius: 13px;
  color: var(--white);
  background: var(--sage-dark);
}

.letter-read-header p {
  color: rgba(255, 255, 255, 0.53);
}

.letter-read-header h3 {
  margin: 6px 0 0;
  font-family: var(--font-serif);
  font-size: calc(23px * var(--font-scale));
  font-weight: 500;
}

.letter-read-meta {
  display: flex;
  margin: 14px 0 18px;
  color: var(--muted);
  gap: 16px;
  font-size: calc(9px * var(--font-scale));
}

.letter-read-copy {
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: calc(13px * var(--font-scale));
  line-height: 2.1;
  white-space: pre-wrap;
}

.letter-read-signature {
  margin-top: 28px;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: calc(11px * var(--font-scale));
  text-align: right;
}

.image-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.selected-file {
  display: inline-flex;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 7px;
  color: var(--muted);
  background: #f2f1eb;
  align-items: center;
  gap: 4px;
  font-size: calc(8px * var(--font-scale));
}

.selected-file .icon {
  width: 12px;
  height: 12px;
}

.letter-image-strip {
  position: relative;
  display: flex;
  overflow: hidden;
  height: 78px;
  margin-top: 13px;
  border-radius: 10px;
  gap: 4px;
}

.letter-image-strip img {
  width: 30%;
  min-width: 0;
  height: 100%;
  object-fit: cover;
  flex: 1;
}

.letter-image-strip span {
  position: absolute;
  right: 7px;
  bottom: 7px;
  display: grid;
  min-width: 24px;
  height: 22px;
  padding: 0 5px;
  border-radius: 6px;
  color: var(--white);
  background: rgba(28, 42, 35, 0.72);
  place-items: center;
  font-size: calc(8px * var(--font-scale));
}

.letter-gallery {
  display: grid;
  margin-top: 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.letter-gallery img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  object-fit: cover;
}

.avatar-edit-preview {
  display: flex;
  justify-content: center;
}

.avatar-edit-preview .avatar {
  width: 76px;
  height: 76px;
  font-size: calc(19px * var(--font-scale));
}

.album-review-panel {
  padding-bottom: 16px;
  margin-bottom: 22px;
  border-color: #e6d7bd;
  background: #fcf7ec;
}

.album-review-grid {
  display: grid;
  padding: 15px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.album-review-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}

.album-review-image {
  display: block;
  width: 100%;
  padding: 0;
  background: #1b2721;
}

.album-review-image img {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
}

.album-review-copy {
  padding: 12px 14px 14px;
}

.album-review-copy strong {
  font-size: calc(10px * var(--font-scale));
}

.album-review-copy > span {
  margin-left: 6px;
  color: var(--faint);
  font-size: calc(8px * var(--font-scale));
}

.album-review-copy p {
  margin: 7px 0 10px;
  color: var(--muted);
  font-size: calc(9px * var(--font-scale));
  line-height: 1.7;
}

.album-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.album-review-actions button {
  min-height: 30px;
  padding: 0 10px;
  font-size: calc(8px * var(--font-scale));
}

.album-timeline {
  position: relative;
  max-width: 900px;
  padding-left: 55px;
  margin: 20px auto 0;
}

.album-timeline::before {
  position: absolute;
  top: 10px;
  bottom: 15px;
  left: 34px;
  width: 1px;
  background: #d8d9d1;
  content: "";
}

.album-month {
  position: relative;
  padding: 17px 0 12px;
  color: var(--sage-dark);
  font-family: var(--font-serif);
  font-size: calc(18px * var(--font-scale));
  font-weight: 700;
}

.album-month::before {
  position: absolute;
  top: 20px;
  left: -28px;
  width: 12px;
  height: 12px;
  border: 3px solid var(--cream);
  border-radius: 50%;
  background: var(--sage);
  content: "";
}

.album-entry {
  position: relative;
  display: grid;
  padding: 0 0 20px;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 20px;
}

.album-time {
  padding-top: 14px;
  text-align: right;
}

.album-time strong {
  display: block;
  font-family: var(--font-serif);
  font-size: calc(22px * var(--font-scale));
  line-height: 1;
}

.album-time span {
  color: var(--faint);
  font-size: calc(8px * var(--font-scale));
}

.album-dot {
  position: absolute;
  top: 18px;
  left: -26px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--cream);
  border-radius: 50%;
  background: var(--peach);
}

.album-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--paper);
  box-shadow: 0 6px 20px rgba(45, 62, 53, 0.045);
}

.album-photo {
  display: block;
  width: 100%;
  padding: 0;
  background: #1b2721;
}

.album-photo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
}

.album-card-copy {
  padding: 14px 17px 15px;
}

.album-card-copy > p {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: calc(12px * var(--font-scale));
  line-height: 1.8;
  white-space: pre-wrap;
}

.album-author {
  display: flex;
  color: var(--faint);
  align-items: center;
  gap: 6px;
  font-size: calc(8px * var(--font-scale));
}

.album-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.image-download-button {
  display: inline-flex;
  color: var(--sage);
  align-items: center;
  gap: 5px;
  font-size: calc(9px * var(--font-scale));
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.image-download-button:hover {
  color: var(--sage-dark);
}

.image-download-button .icon {
  width: 13px;
  height: 13px;
}

.avatar-crop-stage {
  position: relative;
  overflow: hidden;
  width: min(100%, 320px);
  margin: 0 auto 17px;
  border-radius: 18px;
  background: #e9e5da;
  touch-action: none;
}

.avatar-crop-stage canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: grab;
  touch-action: none;
}

.avatar-crop-stage canvas:active {
  cursor: grabbing;
}

.avatar-crop-mask {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(17, 27, 22, 0.42);
  pointer-events: none;
}

.avatar-crop-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-crop-controls .file-button {
  flex: 0 0 auto;
}

.zoom-control {
  display: flex;
  height: 40px;
  padding: 0 11px;
  border-radius: 10px;
  color: var(--muted);
  background: var(--sage-pale);
  align-items: center;
  gap: 8px;
  flex: 1;
}

.zoom-control input {
  width: 100%;
  accent-color: var(--sage-dark);
}

.crop-tip {
  margin: 12px 0 0 !important;
  color: var(--muted);
  font-size: 9px !important;
  text-align: center;
}

.upload-image-preview {
  overflow: hidden;
  border-radius: 13px;
  background: #1b2721;
}

.upload-image-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
}

.theme-toggle {
  display: inline-flex;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--paper);
  align-items: center;
  gap: 5px;
  font-size: calc(8px * var(--font-scale));
  font-weight: 700;
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.image-lightbox {
  display: grid;
  padding: 0;
  background: #18221d;
  place-items: center;
}

.image-lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
}

.profile-page {
  display: grid;
  gap: 18px;
}

.profile-cover {
  position: relative;
  display: flex;
  overflow: hidden;
  min-height: 205px;
  padding: 34px;
  border-radius: var(--radius-lg);
  color: var(--white);
  background:
    radial-gradient(circle at 88% 14%, color-mix(in srgb, var(--peach) 40%, transparent), transparent 22%),
    linear-gradient(125deg, var(--sage-dark), color-mix(in srgb, var(--sage) 76%, #fff));
  align-items: center;
  gap: 22px;
  isolation: isolate;
}

.profile-cover::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0 1px,
    transparent 1.5px
  );
  background-size: 27px 27px;
  content: "";
  mask-image: linear-gradient(90deg, transparent, #000);
}

.profile-orbit {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
}

.profile-orbit.one {
  top: -90px;
  right: 5%;
  width: 260px;
  height: 260px;
}

.profile-orbit.two {
  right: 15%;
  bottom: -130px;
  width: 220px;
  height: 220px;
}

.profile-main-avatar {
  display: grid;
  width: 96px;
  height: 96px;
  padding: 0;
  border: 4px solid rgba(255, 255, 255, 0.36);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2);
  place-items: center;
  flex: 0 0 auto;
}

.profile-main-avatar .avatar {
  width: 100%;
  height: 100%;
  font-size: 23px;
}

.profile-main-copy {
  min-width: 0;
  max-width: 520px;
  flex: 1;
}

.profile-main-copy h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: calc(34px * var(--font-scale));
  font-weight: 600;
}

.profile-main-copy p {
  overflow: hidden;
  margin: 7px 0 12px;
  color: rgba(255, 255, 255, 0.7);
  font-size: calc(10px * var(--font-scale));
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-online {
  display: inline-flex;
  color: rgba(255, 255, 255, 0.65);
  align-items: center;
  gap: 6px;
  font-size: calc(8px * var(--font-scale));
}

.profile-edit-button {
  display: inline-flex;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.09);
  align-items: center;
  gap: 6px;
  font-size: calc(9px * var(--font-scale));
  font-weight: 700;
  white-space: nowrap;
}

.profile-edit-button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.profile-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 18px;
}

.profile-info-panel {
  overflow: hidden;
}

.profile-info-list {
  display: grid;
  padding: 7px 20px 14px;
}

.profile-info-row {
  display: grid;
  min-height: 50px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.profile-info-row:last-child {
  border-bottom: 0;
}

.profile-info-row > span {
  color: var(--muted);
  font-size: calc(9px * var(--font-scale));
}

.profile-info-row > strong {
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: calc(10px * var(--font-scale));
  font-weight: 600;
}

.profile-info-row a {
  color: var(--sage);
  text-decoration: none;
}

.profile-side-card {
  display: grid;
  padding: 23px;
  align-content: start;
  gap: 12px;
}

.profile-side-icon {
  display: grid;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: var(--sage-dark);
  background: var(--sage-pale);
  place-items: center;
}

.profile-side-card h2 {
  margin: 8px 0 0;
  font-family: var(--font-serif);
  font-size: calc(18px * var(--font-scale));
}

.profile-side-card p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: calc(9px * var(--font-scale));
  line-height: 1.8;
}

.profile-edit-form {
  display: grid;
  gap: 16px;
}

.toast {
  position: fixed;
  z-index: 200;
  right: 24px;
  bottom: 24px;
  display: flex;
  min-width: 220px;
  max-width: 360px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--white);
  background: var(--sage-deep);
  box-shadow: var(--shadow-md);
  align-items: center;
  gap: 9px;
  font-size: calc(11px * var(--font-scale));
  animation: toast-in 0.25s ease both;
}

.toast .icon {
  width: 16px;
  height: 16px;
  color: #efd2a1;
}

.toast.error {
  background: #703d37;
}

.loading-screen {
  display: grid;
  min-height: 100vh;
  padding: 30px;
  color: var(--muted);
  place-content: center;
  justify-items: center;
  text-align: center;
}

.loading-mark {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
  border-radius: 18px;
  color: var(--white);
  background: var(--sage-dark);
  place-items: center;
  font-family: var(--font-serif);
  font-size: calc(24px * var(--font-scale));
  box-shadow: var(--shadow-md);
}

.loading-screen p {
  margin: 0;
  font-size: calc(12px * var(--font-scale));
}

.setup-form .login-header {
  margin-bottom: 24px;
}

.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.setup-note {
  padding: 13px 14px;
  border-radius: 12px;
  color: #75664e;
  background: #fbf1dc;
  font-size: calc(10px * var(--font-scale));
  line-height: 1.75;
}

.setup-note strong {
  color: #604b2d;
}

.account-code {
  display: inline-flex;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink-soft);
  background: #f6f4ed;
  align-items: center;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: calc(9px * var(--font-scale));
}

.inline-empty {
  display: flex;
  min-height: 80px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.6);
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: calc(10px * var(--font-scale));
  text-align: center;
}

.inline-empty .icon {
  width: 18px;
  height: 18px;
  color: #b7c0b9;
}

.onboarding-banner {
  display: flex;
  padding: 20px 22px;
  border: 1px solid #eadbbd;
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 95% 0%, rgba(231, 198, 106, 0.2), transparent 28%),
    #fbf5e8;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

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

.onboarding-icon {
  display: grid;
  width: 43px;
  height: 43px;
  border-radius: 13px;
  color: #8e713d;
  background: #f4e7ca;
  place-items: center;
  flex: 0 0 auto;
}

.onboarding-icon .icon {
  width: 19px;
  height: 19px;
}

.onboarding-copy h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: calc(15px * var(--font-scale));
}

.onboarding-copy p {
  margin: 4px 0 0;
  color: #887a63;
  font-size: calc(10px * var(--font-scale));
  line-height: 1.7;
}

.import-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: start;
  gap: 18px;
}

.import-panel {
  overflow: hidden;
}

.import-body {
  display: grid;
  padding: 22px;
  gap: 16px;
}

.import-help {
  color: var(--muted);
  font-size: calc(10px * var(--font-scale));
  line-height: 1.8;
}

.import-help code {
  padding: 2px 5px;
  border-radius: 5px;
  color: var(--ink-soft);
  background: #f0eee6;
  font-family: "SFMono-Regular", Consolas, monospace;
}

.csv-input {
  width: 100%;
  min-height: 260px;
  padding: 15px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  color: var(--ink);
  background: #fffefb;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: calc(11px * var(--font-scale));
  line-height: 1.7;
  resize: vertical;
}

.csv-input:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 4px rgba(111, 142, 122, 0.1);
}

.import-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.file-button {
  position: relative;
  display: inline-flex;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink-soft);
  background: var(--paper);
  align-items: center;
  gap: 7px;
  font-size: calc(10px * var(--font-scale));
  font-weight: 700;
  cursor: pointer;
}

.file-button:hover {
  background: var(--white);
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.import-status {
  display: flex;
  min-height: 22px;
  color: var(--muted);
  align-items: center;
  gap: 6px;
  font-size: calc(9px * var(--font-scale));
}

.import-status .icon {
  width: 13px;
  height: 13px;
}

.guide-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.84);
}

.guide-card h3 {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: calc(15px * var(--font-scale));
}

.guide-steps {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  gap: 14px;
  counter-reset: steps;
}

.guide-steps li {
  position: relative;
  padding-left: 30px;
  color: var(--muted);
  font-size: calc(9px * var(--font-scale));
  line-height: 1.75;
  counter-increment: steps;
}

.guide-steps li::before {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 21px;
  height: 21px;
  border-radius: 7px;
  color: var(--sage-dark);
  background: var(--sage-pale);
  content: counter(steps);
  place-items: center;
  font-size: calc(8px * var(--font-scale));
  font-weight: 800;
}

.guide-steps strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-soft);
  font-size: calc(10px * var(--font-scale));
}

.modal-field {
  display: grid;
  margin-top: 16px;
  gap: 7px;
}

.modal-field label {
  font-size: calc(10px * var(--font-scale));
  font-weight: 700;
}

.danger-text {
  color: var(--danger);
}

.status-dot-copy {
  display: flex;
  align-items: center;
  gap: 6px;
}

.inbox-legend {
  display: flex;
  margin-top: 12px;
  color: var(--faint);
  align-items: center;
  gap: 7px;
  font-size: calc(8px * var(--font-scale));
}

.inbox-legend .online-dot {
  width: 5px;
  height: 5px;
}

html[data-theme="night"] body {
  background:
    radial-gradient(circle at 92% 2%, rgba(158, 119, 80, 0.13), transparent 25%),
    var(--cream);
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.13) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(229, 196, 133, 0.1) 0 1px, transparent 1.5px);
  background-position:
    0 0,
    19px 27px;
  background-size:
    58px 58px,
    83px 83px;
}

html[data-theme="sakura"] body {
  background:
    radial-gradient(ellipse at 8% 12%, rgba(221, 154, 174, 0.15) 0 7px, transparent 8px),
    radial-gradient(ellipse at 91% 18%, rgba(238, 185, 198, 0.18) 0 10px, transparent 11px),
    radial-gradient(ellipse at 75% 82%, rgba(226, 164, 181, 0.1) 0 6px, transparent 7px),
    var(--cream);
  background-size:
    95px 95px,
    140px 140px,
    110px 110px,
    auto;
}

html[data-theme="lavender"] body {
  background:
    radial-gradient(circle at 15% 20%, rgba(143, 126, 178, 0.13) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 65%, rgba(197, 142, 134, 0.1) 0 2px, transparent 3px),
    var(--cream);
  background-size:
    44px 44px,
    67px 67px,
    auto;
}

html[data-theme="ocean"] body {
  background:
    radial-gradient(ellipse 120% 40% at 50% 0%, rgba(104, 155, 161, 0.16), transparent 65%),
    repeating-linear-gradient(
      -12deg,
      transparent 0 22px,
      rgba(82, 130, 135, 0.035) 22px 23px
    ),
    var(--cream);
}

html[data-theme="sakura"] .sidebar {
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.1) 0 8px, transparent 9px),
    radial-gradient(circle at 82% 72%, rgba(255, 255, 255, 0.06) 0 12px, transparent 13px),
    linear-gradient(155deg, #7d5364, #593d49);
}

html[data-theme="lavender"] .sidebar {
  background:
    linear-gradient(30deg, transparent 46%, rgba(255, 255, 255, 0.025) 47% 53%, transparent 54%),
    linear-gradient(150deg, #544969, #352e42);
}

html[data-theme="sakura"] .hero-panel {
  background:
    radial-gradient(circle at 8% 18%, rgba(255, 255, 255, 0.22) 0 12px, transparent 13px),
    radial-gradient(circle at 86% 15%, rgba(255, 255, 255, 0.12) 0 24px, transparent 25px),
    linear-gradient(125deg, #965f74, #bb8195);
}

html[data-theme="lavender"] .hero-panel {
  background:
    linear-gradient(35deg, transparent 45%, rgba(255, 255, 255, 0.04) 46% 54%, transparent 55%),
    linear-gradient(125deg, #685b82, #8c7aaa);
}

html[data-theme="sakura"] .login-story {
  background:
    radial-gradient(ellipse at 22% 16%, rgba(255, 255, 255, 0.13) 0 7px, transparent 8px),
    radial-gradient(ellipse at 82% 72%, rgba(255, 255, 255, 0.08) 0 10px, transparent 11px),
    linear-gradient(145deg, #8d5b6d, #5c3b47);
  background-size:
    72px 72px,
    110px 110px,
    auto;
}

html[data-theme="lavender"] .login-story {
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 255, 255, 0.11) 0 1px, transparent 2px),
    linear-gradient(35deg, transparent 46%, rgba(255, 255, 255, 0.025) 47% 53%, transparent 54%),
    linear-gradient(145deg, #5b4d70, #342b42);
  background-size:
    34px 34px,
    auto,
    auto;
}

html[data-theme="ocean"] .login-story {
  background:
    repeating-linear-gradient(-12deg, transparent 0 25px, rgba(255, 255, 255, 0.035) 25px 26px),
    linear-gradient(145deg, #4e7c83, #254952);
}

html[data-theme="night"] .login-story {
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.18) 0 1px, transparent 2px),
    radial-gradient(circle at 76% 68%, rgba(235, 202, 138, 0.13) 0 1px, transparent 2px),
    linear-gradient(145deg, #16352c, #071510);
  background-size:
    47px 47px,
    79px 79px,
    auto;
}

html[data-theme="sakura"] .panel,
html[data-theme="sakura"] .stat-card,
html[data-theme="sakura"] .quick-link,
html[data-theme="lavender"] .panel,
html[data-theme="lavender"] .stat-card,
html[data-theme="lavender"] .quick-link {
  border-color: var(--line);
}

html[data-theme="night"] .topbar {
  border-bottom-color: rgba(255, 255, 255, 0.06);
  background: rgba(14, 22, 18, 0.88);
}

html[data-theme="night"] .panel,
html[data-theme="night"] .stat-card,
html[data-theme="night"] .quick-link,
html[data-theme="night"] .account-stat,
html[data-theme="night"] .admin-letter-card,
html[data-theme="night"] .letter-card {
  background: rgba(24, 33, 28, 0.9);
}

html[data-theme="night"] .contact-pane,
html[data-theme="night"] .chat-panel {
  background: #131c17;
}

html[data-theme="night"] .chat-top,
html[data-theme="night"] .composer {
  background: rgba(24, 33, 28, 0.96);
}

html[data-theme="night"] .contact-item:hover,
html[data-theme="night"] .message-preview:hover {
  background: rgba(255, 255, 255, 0.045);
}

html[data-theme="night"] .contact-item.active {
  background: #1d3329;
}

html[data-theme="night"] .text-input,
html[data-theme="night"] .select-input,
html[data-theme="night"] .text-area,
html[data-theme="night"] .search-input,
html[data-theme="night"] .csv-input,
html[data-theme="night"] .composer-shell {
  color: var(--ink);
  background: #121b17;
}

html[data-theme="night"] .message-preview:hover,
html[data-theme="night"] .login-tabs,
html[data-theme="night"] .mode-switch,
html[data-theme="night"] .account-table th,
html[data-theme="night"] .modal-actions {
  background: #121b17;
}

html[data-theme="night"] .account-table tbody tr:hover {
  background: #1a251f;
}

html[data-theme="night"] .onboarding-banner,
html[data-theme="night"] .album-review-panel {
  border-color: #4b3e2b;
  background: #201d15;
}

html[data-theme="night"] .modal-card {
  background: var(--paper);
}

html[data-theme="night"] .segmented-control {
  background: #111a15;
}

html[data-theme="night"] .bubble {
  border-color: var(--line);
  color: var(--ink-soft);
  background: #1d2922;
}

html[data-theme="night"] .message-row.mine .bubble {
  background: #3f755d;
}

html[data-theme="night"] .letter-card {
  border-color: #374037;
}

html[data-theme="night"] .letter-card::before {
  background: linear-gradient(225deg, #263028 50%, transparent 50%);
}

html[data-theme="night"] .album-card {
  border-color: var(--line);
  background: var(--paper);
}

html[data-theme="night"] .album-photo {
  background: #0c1210;
}

html[data-theme="night"] .image-lightbox {
  background: #080d0b;
}

html[data-theme="ocean"] .hero-panel {
  background:
    radial-gradient(circle at 92% 8%, rgba(255, 255, 255, 0.15), transparent 25%),
    linear-gradient(125deg, #31616a 0%, #487b81 68%, #6d999c 100%);
}

@keyframes content-reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.28s;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* Responsive */

@media (max-width: 1120px) {
  :root {
    --sidebar-width: 225px;
  }

  .sidebar {
    padding-right: 12px;
    padding-left: 12px;
  }

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

  .hero-orbit {
    width: 174px;
    height: 174px;
  }

  .orbit-center {
    width: 108px;
    height: 108px;
  }

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

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

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

@media (max-width: 900px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-story {
    min-height: 430px;
  }

  .login-visual {
    min-height: 300px;
  }

  .story-main {
    margin: 7vh 0 4vh;
  }

  .story-illustration {
    bottom: 14vh;
    width: 220px;
  }

  .login-panel {
    min-height: auto;
    padding: 50px 12px 60px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    height: 64px;
    padding: 0 20px;
  }

  .topbar-title {
    display: none;
  }

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

  .mobile-brand .sidebar-logo {
    width: 34px;
    height: 34px;
    color: #28483d;
    background: linear-gradient(145deg, #f7e6c5, #d8aa76);
  }

  .mobile-brand .sidebar-logo svg {
    width: 25px;
    height: 25px;
  }

  .mobile-brand strong {
    font-family: var(--font-serif);
    font-size: calc(15px * var(--font-scale));
  }

  .date-chip,
  .topbar-divider {
    display: none;
  }

  .content {
    min-height: calc(100vh - 64px);
    padding: 24px 20px 90px;
  }

  .mobile-bottom-nav {
    position: fixed;
    z-index: 50;
    right: 12px;
    bottom: 12px;
    left: 12px;
    display: grid;
    min-height: 62px;
    padding: 6px;
    border: 1px solid rgba(217, 213, 201, 0.8);
    border-radius: 18px;
    background: rgba(255, 253, 248, 0.94);
    box-shadow: 0 12px 32px rgba(35, 54, 46, 0.15);
    backdrop-filter: blur(16px);
    grid-template-columns: repeat(4, 1fr);
  }

  .mobile-bottom-nav.student {
    grid-template-columns: repeat(4, 1fr);
  }

  .mobile-bottom-nav.admin {
    grid-template-columns: repeat(5, 1fr);
  }

  .mobile-nav-btn {
    position: relative;
    display: flex;
    border-radius: 12px;
    color: var(--muted);
    background: transparent;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: calc(8px * var(--font-scale));
  }

  .mobile-nav-btn.active {
    color: var(--sage-dark);
    background: var(--sage-pale);
  }

  .mobile-nav-btn .icon {
    width: 18px;
    height: 18px;
  }

  .mobile-nav-badge {
    position: absolute;
    top: 4px;
    left: calc(50% + 8px);
    display: grid;
    min-width: 15px;
    height: 15px;
    padding: 0 3px;
    border-radius: 999px;
    color: var(--white);
    background: var(--peach);
    place-items: center;
    font-size: calc(7px * var(--font-scale));
  }

  .page-heading {
    margin-bottom: 19px;
  }

  .dashboard-lower {
    grid-template-columns: 1fr;
  }

  .side-stack {
    grid-template-columns: 1fr 1fr;
  }

  .chat-page {
    height: calc(100dvh - 64px - 24px - 150px - 86px);
    min-height: 340px;
  }

  .chat-shell {
    border-radius: 20px;
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .admin-mailbox-layout {
    grid-template-columns: 1fr;
  }

  .compose-mail-panel {
    position: static;
  }

  .import-layout {
    grid-template-columns: 1fr;
  }

  .album-review-grid {
    grid-template-columns: 1fr;
  }

  .settings-body {
    grid-template-columns: 1fr;
  }

  .settings-preview {
    min-height: 180px;
  }

  .profile-content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .login-page {
    padding: 12px;
  }

  .login-story {
    min-height: 390px;
    padding: 28px 25px;
    border-radius: 24px;
  }

  .login-visual {
    min-height: 250px;
  }

  .visual-seven {
    font-size: 210px;
  }

  .visual-ring.large {
    width: 250px;
    height: 250px;
  }

  .visual-ring.small {
    width: 160px;
    height: 160px;
  }

  .story-main h1 {
    font-size: calc(42px * var(--font-scale));
  }

  .story-description {
    margin-top: 17px;
    font-size: calc(12px * var(--font-scale));
  }

  .story-illustration {
    display: none;
  }

  .story-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .login-panel {
    padding: 40px 5px 46px;
  }

  .login-header h2 {
    font-size: calc(30px * var(--font-scale));
  }

  .hero-panel {
    min-height: 270px;
    padding: 28px 24px;
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    font-size: calc(34px * var(--font-scale));
  }

  .hero-orbit {
    position: absolute;
    right: -48px;
    bottom: -55px;
    width: 185px;
    height: 185px;
    opacity: 0.32;
  }

  .hero-copy > p:not(.eyebrow) {
    max-width: 280px;
  }

  .overview-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .stat-card {
    min-height: 92px;
    padding: 14px;
    gap: 10px;
  }

  .stat-icon {
    width: 35px;
    height: 35px;
    border-radius: 10px;
  }

  .stat-value {
    font-size: calc(20px * var(--font-scale));
  }

  .stat-trend {
    display: none;
  }

  .side-stack {
    grid-template-columns: 1fr;
  }

  .message-preview {
    grid-template-columns: 37px minmax(0, 1fr);
  }

  .message-time {
    display: none;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-heading .heading-actions {
    width: 100%;
  }

  .page-heading .heading-actions button {
    flex: 1;
  }

  .chat-page {
    height: calc(100dvh - 64px - 24px - 150px - 86px);
    min-height: 320px;
  }

  .chat-shell {
    position: relative;
    display: block;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .contact-pane {
    height: 100%;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--paper);
  }

  .chat-panel {
    display: none;
  }

  .chat-shell.has-chat .contact-pane {
    display: none;
  }

  .chat-shell.has-chat .chat-panel {
    display: flex;
    height: 100%;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
  }

  .chat-page.audit .chat-shell .contact-pane {
    display: flex;
  }

  .chat-page.audit .chat-shell .chat-panel {
    display: none;
  }

  .chat-page.audit .chat-shell.has-chat .contact-pane {
    display: none;
  }

  .chat-page.audit .chat-shell.has-chat .chat-panel {
    display: flex;
  }

  .mobile-back {
    display: grid;
  }

  .mailbox-hero {
    min-height: 180px;
    padding: 25px 22px;
    align-items: flex-start;
    flex-direction: column;
  }

  .mailbox-stamp {
    position: absolute;
    right: 20px;
    bottom: 18px;
    width: 64px;
    height: 51px;
    font-size: calc(9px * var(--font-scale));
  }

  .mailbox-student-grid {
    grid-template-columns: 1fr;
  }

  .letter-card {
    min-height: 270px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

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

  .onboarding-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .onboarding-banner .primary-button {
    width: 100%;
  }

  .import-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .import-actions .primary-button,
  .import-actions .file-button {
    width: 100%;
    justify-content: center;
  }

  .album-timeline {
    padding-left: 43px;
  }

  .album-timeline::before {
    left: 24px;
  }

  .album-entry {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .album-time {
    display: flex;
    padding: 0 0 3px 29px;
    align-items: baseline;
    gap: 6px;
    text-align: left;
  }

  .album-time strong {
    font-size: calc(18px * var(--font-scale));
  }

  .album-dot {
    top: 5px;
    left: -22px;
  }

  .album-month::before {
    left: -25px;
  }

  .profile-cover {
    min-height: 250px;
    padding: 27px 22px;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .profile-main-avatar {
    width: 78px;
    height: 78px;
  }

  .profile-main-copy h1 {
    font-size: calc(27px * var(--font-scale));
  }

  .profile-main-copy p {
    white-space: normal;
  }

  .profile-edit-button {
    width: 100%;
    justify-content: center;
  }

  .profile-info-row {
    grid-template-columns: 88px minmax(0, 1fr);
  }

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

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

  .recipient-scroll {
    grid-template-columns: 1fr 1fr;
  }

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

  .account-stat {
    padding: 14px 16px;
  }

  .account-toolbar {
    height: auto;
    padding: 13px;
    align-items: stretch;
    flex-direction: column;
  }

  .account-toolbar .search-shell {
    width: 100%;
  }

  .account-filters {
    overflow-x: auto;
  }

  .filter-button {
    white-space: nowrap;
  }

  .member-grid {
    padding: 11px;
    grid-template-columns: 1fr;
  }

  .reset-request-item {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .reset-request-item .secondary-button {
    grid-column: 1 / -1;
  }

  .chat-person .avatar {
    width: 34px;
    height: 34px;
  }

  .chat-top {
    padding: 0 13px;
  }

  .chat-top-badge {
    display: none;
  }

  .message-scroll {
    padding: 18px 13px;
  }

  .bubble-wrap {
    max-width: 80%;
  }

  .composer {
    padding: 10px 11px 12px;
  }

  .topbar-right .topbar-presence {
    display: none;
  }

  .theme-toggle span {
    display: none;
  }

  .theme-toggle {
    width: 32px;
    padding: 0;
    justify-content: center;
  }

  .toast {
    right: 14px;
    bottom: 86px;
    left: 14px;
    max-width: none;
  }
}

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

html[data-motion="off"] *,
html[data-motion="off"] *::before,
html[data-motion="off"] *::after {
  scroll-behavior: auto !important;
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}
