:root {
  color-scheme: light;
  --ink: #173f40;
  --muted: #506f6d;
  --deep: #114e51;
  --teal: #087a77;
  --mint: #c5eee1;
  --wash: #eaf6f1;
  --line: #cddfd9;
  --paper: #fffefa;
  --free: #dcf0dc;
  --free-ink: #295a3d;
  --busy: #e9ecea;
  --busy-ink: #505e59;
  color: var(--ink);
  background: #f6f8f4;
  font-family: "DM Sans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { min-width: 300px; margin: 0; }
button, input, textarea, select { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { color: inherit; border: 0; background: none; font-weight: 600; cursor: pointer; }
button:disabled { cursor: default; }
:where(button, a, input, textarea, select, summary):focus-visible { outline: 3px solid #1d9990; outline-offset: 3px; }
a { color: inherit; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 3.2vw, 2.7rem); line-height: 1.2; letter-spacing: -.04em; }
h2 { font-size: 1.25rem; line-height: 1.4; }

.topbar { background: var(--deep); color: #f2faf4; }
.bar-inner, #app { width: min(100%, 1392px); margin: auto; padding-inline: clamp(22px, 4.5vw, 72px); }
.bar-inner { height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-size: 1.32rem; font-weight: 720; letter-spacing: .035em; white-space: nowrap; }
.brand-mark { width: 52px; height: 50px; display: grid; place-items: center; flex: none; border-radius: 16px 17px 15px 18px; background: var(--mint); }
.brand-mark img { display: block; width: 46px; height: 43px; transform: rotate(-5deg); }
.header-right, .user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-chip { max-width: 200px; white-space: nowrap; overflow: hidden; font-size: .93rem; padding: 2px 4px; }
.initial { display: grid; place-items: center; flex: none; width: 29px; height: 29px; border: 1px solid #82aa9f; border-radius: 50%; background: #2a6666; color: #e3f6ed; }
.header-right .quiet { color: #d4e9e2; font-size: .88rem; }
.header-right .quiet:hover, .user-chip:hover { background: #215b5c; }
.topbar :focus-visible { outline-color: #a1e4cf; }
#app { padding-bottom: 50px; }

.primary, .secondary, .quiet, .icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 43px; padding: 9px 17px; border-radius: 11px; line-height: 1.4; }
.primary { background: var(--teal); color: white; border: 1px solid transparent; }
.primary:hover { background: #056963; }
.secondary, .icon-btn { background: var(--paper); border: 1px solid #b6cfc6; color: var(--deep); }
.quiet { color: var(--muted); }
.secondary:hover, .quiet:hover, .icon-btn:hover { background: var(--wash); }
.icon-btn { min-height: 35px; width: 35px; padding: 1px; font-size: 1.35rem; line-height: 1; }
.primary:disabled, .secondary:disabled { opacity: .65; }
.wide { width: 100%; margin-top: 23px; }
.muted, .empty-copy { color: var(--muted); font-size: .94rem; line-height: 1.65; }

.auth-layout { display: grid; grid-template-columns: minmax(0, 1.07fr) minmax(0, 1fr); margin: clamp(24px, 7vh, 75px) auto 0; max-width: 1000px; border-radius: 27px; border: 1px solid var(--line); overflow: hidden; background: var(--paper); box-shadow: 0 12px 35px #1649460e; }
.auth-side { padding: clamp(30px, 5vw, 69px) clamp(26px, 4.1vw, 62px); align-self: center; }
.auth-tabs { display: inline-flex; margin-bottom: 24px; padding: 4px; gap: 4px; background: var(--wash); border: 1px solid #d4e9df; border-radius: 30px; }
.auth-tabs button { padding: 5px 20px; border-radius: 20px; color: var(--muted); font-size: .9rem; }
.auth-tabs button[aria-pressed=true] { background: var(--paper); color: var(--deep); box-shadow: 0 1px 5px #144d4626; }
.auth-help { margin: 10px 0 25px; color: var(--muted); line-height: 1.7; font-size: .96rem; }
label { display: grid; gap: 7px; color: var(--ink); font-size: .89rem; font-weight: 620; }
label + label, .field-group + label, .field-group + .field-group, label + .field-group { margin-top: 15px; }
input, select, textarea { min-width: 0; width: 100%; min-height: 43px; padding: 10px 12px; background: white; color: var(--ink); border: 1px solid #b7cfc7; border-radius: 10px; font-size: 1rem; font-weight: 400; }
input::placeholder, textarea::placeholder { color: #677f79; }
textarea { min-height: 68px; resize: vertical; }
.error { background: #ffede5; color: #863d2e; margin: 14px 0; padding: 12px 14px; border-radius: 10px; font-size: .93rem; overflow-wrap: anywhere; }

.art-panel { min-height: 490px; display: grid; place-items: center; position: relative; overflow: hidden; isolation: isolate; background: #a5dccf; }
.paper-grain { position: absolute; inset: 0; z-index: -2; background-image: linear-gradient(#ecfff649 1px, transparent 1px), linear-gradient(90deg, #ecfff649 1px, transparent 1px); background-size: 22px 22px; }
.art-panel::before, .art-panel::after { content: ""; position: absolute; z-index: -1; width: 150px; height: 140px; border: 2px dashed #2d817146; border-radius: 50%; rotate: -30deg; }
.art-panel::before { left: -95px; top: 76px; }
.art-panel::after { right: -111px; bottom: 28px; width: 215px; height: 112px; }
.art-stack { position: relative; width: 72%; max-width: 345px; margin: 67px 0 0; transform: rotate(-5deg); }
.paper { position: relative; padding: 24px 21px 17px; background: #fffbee; border: 1.5px solid #42827b; border-radius: 6px 7px 16px 10px; box-shadow: 2px 4px #fffbea, 3px 6px #5c9186, 5px 8px #fffbea, 6px 10px #5c9186, 13px 22px 26px #104a462b; }
.peeking-cat { position: absolute; top: -86px; right: 12%; z-index: 2; width: 112px; height: 104px; transform: rotate(9deg); pointer-events: none; }
.peeking-cat img { display: block; width: 100%; height: 100%; }
.peeking-cat i { position: absolute; bottom: -1px; left: 4px; width: 24px; height: 15px; border: 2px solid var(--deep); border-radius: 57% 46% 50% 55%; background: #fffae9; transform: rotate(-18deg); }
.peeking-cat i:last-child { left: auto; right: 7px; transform: rotate(10deg); }
.ring { position: absolute; top: -10px; width: 10px; height: 19px; border: 1.5px solid #36655e; border-radius: 7px; background: #7aa79b; }
.ring-a { left: 18px; }
.ring-b { right: 18px; }
.paper-tags { display: flex; justify-content: space-between; color: #52726b; font-size: .72rem; font-weight: 650; }
.paper-title { margin: 7px 0 12px; font-size: clamp(1.65rem, 3vw, 2.15rem); font-weight: 720; letter-spacing: -.045em; }
.paper-days { display: grid; grid-template-columns: repeat(7, 1fr); padding-bottom: 12px; border-bottom: 1px dashed #bbcdbf; margin-bottom: 12px; }
.paper-day { display: grid; justify-items: center; gap: 2px; color: #516d68; padding: 4px 0; font-size: .72rem; }
.paper-day b { font: 650 .96rem/1.3 "DM Sans", system-ui, sans-serif; }
.paper-day:first-child { color: white; background: var(--teal); border-radius: 8px; }
.sample-slot { display: flex; align-items: center; gap: 9px; padding: 9px 10px; margin: 6px 0; border-radius: 7px; background: var(--free); color: var(--free-ink); font-size: .77rem; }
.sample-slot b { margin-right: auto; font-size: .84rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sample-busy { background: var(--busy); color: var(--busy-ink); }

.tabs { display: flex; gap: 6px; margin: 22px 0; padding: 0 0 12px; border-bottom: 1px solid var(--line); }
.tabs button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 16px; border-radius: 12px; white-space: nowrap; color: var(--muted); font-size: .92rem; }
.tabs button:hover { background: #e9f3ee; }
.tabs button[aria-current=page] { color: #105c59; background: #d8efe5; }
.tabs svg { flex: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.page-head, .dialog-head, .record, .action-line, .dialog-foot, .legend { display: flex; align-items: center; gap: 12px; }
.page-head, .dialog-head, .record { justify-content: space-between; }
.page-head { margin: 26px 0 20px; }
.page-head h1 { overflow-wrap: anywhere; }
.page-head .muted { margin-top: 7px; }
.action-line, .dialog-foot { flex-wrap: wrap; }
.page-head > .action-line { flex: none; }
.sheet { background: var(--paper); border: 1px solid #c3d8cf; border-radius: 18px; overflow: hidden; box-shadow: 0 4px 16px #16494607; }
.legend { color: var(--muted); font-size: .85rem; gap: 6px; }
.legend .dot:nth-of-type(2) { margin-left: 9px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.free { background: #5d9e6b; }
.dot.busy { background: #8e9893; }
.sheet { padding: 24px; }
.sheet + .sheet { margin-top: 16px; }
.empty-copy { padding: 6px 0; }
.record { border-bottom: 1px solid var(--line); padding: 14px 0; flex-wrap: wrap; overflow-wrap: anywhere; }
.record:last-child, .favorite:last-child { border-bottom: 0; }
.record > div:first-child { min-width: 0; }
.record strong, .record-title { display: block; }
.record small, .read-note { display: block; color: var(--muted); margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tool-form { max-width: 480px; }
.tool-form .action-line { margin-top: 14px; }
.sheet h2 + .muted { margin: 6px 0 15px; }
.record-action { min-height: 36px; padding: 7px 10px; font-size: .88rem; }
.favorite { border-bottom: 1px solid var(--line); width: 100%; text-align: left; padding: 14px 5px; }

dialog { width: min(450px, 94vw); max-width: 94vw; max-height: 90vh; max-height: 90dvh; margin: auto; padding: 22px 24px; border: 1px solid #b4d3c8; border-radius: 19px; background: var(--paper); color: var(--ink); box-shadow: 0 20px 70px #143f3f45; overflow: auto; }
dialog::backdrop { background: #123f4280; }
.dialog-head { margin-bottom: 17px; }
.dialog-foot { justify-content: flex-end; margin-top: 18px; }
.dialog-foot button { min-width: 68px; }
.field-group { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-group label + label { margin: 0; }
.optional-note { margin-top: 12px; }
summary { cursor: pointer; }
.optional-note summary { width: fit-content; padding: 4px 2px; color: var(--teal); font-size: .88rem; font-weight: 620; }
.optional-note[open] summary { margin-bottom: 4px; }
.private-hint { font-size: .81rem; font-weight: 400; color: var(--muted); }
#notice-body { line-height: 1.7; overflow-wrap: anywhere; white-space: pre-wrap; }
#notice-body input { margin-top: 8px; }
#toast { position: fixed; z-index: 5; bottom: 20px; left: 50%; transform: translateX(-50%); border-radius: 12px; background: var(--deep); color: white; max-width: 90%; padding: 9px 15px; font-size: .91rem; pointer-events: none; }
#toast:empty { display: none; }
.loading { color: var(--muted); padding: 18px 0; }

/* Keep the selected date, its actions, and its appointments in one panel. */
body:has(#workspace:not([hidden])) .topbar { background: #f6f8f4; color: var(--ink); }
body:has(#workspace:not([hidden])) .header-right .quiet { color: var(--muted); }
body:has(#workspace:not([hidden])) .header-right button:hover { background: #deebe3; }
body:has(#workspace:not([hidden])) .topbar :focus-visible { outline-color: var(--teal); }
body:has(#workspace:not([hidden])) .bar-inner { height: 65px; }
#workspace .tabs { margin-top: 2px; margin-bottom: 17px; }
.agenda-board { background: var(--paper); border: 1px solid #cfdfd7; border-radius: 22px; overflow: hidden; }
.agenda-banner {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: clamp(13px, 1.8vw, 24px); padding: clamp(21px, 3.2vw, 40px);
  color: #fcfff9; background: #134f4d;
}
.agenda-banner::before {
  content: ""; width: clamp(52px, 5.6vw, 70px); aspect-ratio: 1;
  border-radius: 31%; background: #cfefda url("/teal-cat.svg?v=2") center / 76% auto no-repeat;
  transform: rotate(-4deg);
}
.agenda-banner h1 { overflow-wrap: anywhere; font-weight: 740; font-size: clamp(1.7rem, 3.2vw, 2.65rem); }
.agenda-banner p { color: #d3e8dd; margin-top: 5px; font-size: .97rem; line-height: 1.5; }
.agenda-banner .action-line { justify-content: end; gap: 8px; }
.agenda-banner .primary { background: #d3f1c6; color: #194f42; }
.agenda-banner .primary:hover { background: #e2f8d8; }
.agenda-banner .secondary { background: transparent; border-color: #70a09a; color: #eef9f3; }
.agenda-banner .secondary:hover { background: #296461; }
.agenda-body { padding: clamp(17px, 3vw, 37px); }
.agenda-toolbar, .agenda-controls, .agenda-heading, .agenda-heading > div:first-child { display: flex; align-items: center; }
.agenda-toolbar, .agenda-heading { justify-content: space-between; gap: 12px; }
.agenda-toolbar { flex-wrap: wrap; }
.agenda-toolbar h2 { font-size: clamp(1.16rem, 2vw, 1.6rem); letter-spacing: -.035em; }
.agenda-controls { gap: 7px; }
.agenda-controls .icon-btn { width: 39px; min-height: 39px; }
.date-jump { display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; color: var(--muted); }
.date-jump > span { white-space: nowrap; font-size: .875rem; }
.date-jump input { cursor: pointer; min-height: 39px; width: 9.4rem; padding: 5px 8px; font-size: .9rem; }
.date-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(4px, .85vw, 11px); margin-top: 15px; }
.date-card {
  position: relative; display: grid; place-content: center; justify-items: center; gap: 4px;
  min-width: 0; min-height: clamp(66px, 8.2vw, 97px); padding: 8px 2px;
  color: var(--ink); background: white; border: 1px solid #cadcd4; border-radius: 14px;
}
.date-card > span { font-size: .92rem; font-weight: 470; }
.date-card > b { font-size: clamp(1.45rem, 2.5vw, 2.02rem); line-height: 1.18; font-variant-numeric: tabular-nums; }
.date-card:hover { background: #eff8f2; border-color: #79a89e; }
.date-card[aria-pressed=true] { color: #fffef9; background: #165753; border-color: #165753; }
.date-card .today-label { display: block; min-height: 1.15em; color: #095f58; font-size: .78rem; line-height: 1.15; font-weight: 650; }
.date-card[aria-pressed=true] .today-label { color: #e1ffd7; }
.agenda-heading { margin-top: clamp(23px, 3vw, 38px); padding-bottom: 13px; }
.agenda-heading > div:first-child { gap: 11px; flex-wrap: wrap; }
.agenda-heading h2 { font-size: clamp(1.18rem, 2vw, 1.62rem); font-weight: 720; }
.agenda-heading > div:first-child > span { color: var(--muted); font-size: .95rem; }
.agenda-heading .legend { flex-basis: auto; white-space: nowrap; }
.agenda-list { border-top: 1px solid var(--line); }
.agenda-row {
  display: grid; grid-template-columns: 34px minmax(100px, 1.04fr) minmax(165px, .92fr) minmax(90px, 1fr) 40px;
  gap: clamp(8px, 1.25vw, 20px); align-items: center; min-height: 78px; padding: 14px 0;
}
.agenda-row + .agenda-row { border-top: 1px solid var(--line); }
.row-title, .row-note { min-width: 0; overflow-wrap: anywhere; }
.row-title { line-height: 1.45; }
.row-title strong { font-size: clamp(1rem, 1.45vw, 1.16rem); font-weight: 690; }
.row-title small { display: block; color: var(--muted); font-size: .84rem; margin-top: 3px; }
.row-note { white-space: pre-wrap; color: #4c6965; line-height: 1.55; font-size: .94rem; }
.time-pill { justify-self: start; display: inline-flex; align-items: center; flex-wrap: nowrap; gap: 7px; padding: 9px 10px; border-radius: 10px; font-size: .86rem; white-space: nowrap; }
.time-pill b { font-size: 1rem; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.time-pill.free { background: var(--free); color: var(--free-ink); }
.time-pill.busy { background: var(--busy); color: var(--busy-ink); }
.time-pill.free .dot { background: #548a5b; }
.time-pill.busy .dot { background: #7c8780; }
.done-toggle, .row-edit { display: grid; align-items: center; justify-items: center; color: var(--muted); width: 100%; min-height: 40px; padding: 0; border-radius: 9px; }
.done-toggle::before { content: ""; width: 19px; height: 19px; box-sizing: border-box; background: #fff; border: 1.5px solid #88a49b; border-radius: 50%; }
.done-toggle[aria-checked=true]::before { border-color: #176559; background: #176559 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3.5 8 3 3 6-6' fill='none' stroke='white' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat; }
.done-toggle:hover, .row-edit:hover { background-color: var(--wash); color: var(--deep); }
.is-done .row-title strong { text-decoration: line-through; color: var(--muted); }
.row-edit svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.agenda-empty { text-align: center; padding: clamp(28px, 6vw, 58px) 12px; color: var(--muted); line-height: 1.65; font-size: .97rem; }
.sync-option { display: flex; align-items: center; gap: 9px; margin-top: 12px; min-height: 38px; cursor: pointer; font-weight: 520; }
.sync-option input { appearance: auto; accent-color: var(--teal); flex: none; width: 17px; height: 17px; min-height: 0; margin: 0; padding: 0; }
.sync-option small { display: block; margin-top: 2px; font-weight: 400; font-size: .81rem; color: var(--muted); }

@media (max-width: 960px) {
  .art-stack { width: 79%; }
  .auth-side { padding: 35px 27px; }
}
@media (max-width: 680px) {
  .bar-inner { height: 62px; padding-inline: 16px; }
  #app { padding: 0 13px 26px; }
  .brand { font-size: 1.1rem; gap: 8px; }
  .brand-mark { width: 41px; height: 39px; border-radius: 13px; }
  .brand-mark img { width: 38px; height: 36px; }
  .header-right { gap: 2px; }
  .header-right .quiet { padding: 7px; }
  .user-chip { max-width: 108px; gap: 5px; font-size: .87rem; }
  .initial { width: 25px; height: 25px; }
  .auth-layout { max-width: 430px; grid-template-columns: 1fr; border-radius: 19px; margin-top: 18px; }
  .art-panel { height: 136px; min-height: 0; display: block; }
  .art-stack { position: absolute; width: 175px; top: 39px; left: calc(50% - 118px); max-width: unset; margin: 0; }
  .paper { padding: 12px 13px; }
  .paper-tags { font-size: .55rem; }
  .paper-title { font-size: 1.12rem; margin: 5px 0 7px; }
  .paper-days { margin: 0; border: 0; }
  .paper-day { padding: 1px 0; }
  .paper-day b { font-size: .76rem; }
  .peeking-cat { width: 83px; height: 77px; top: -14px; right: -62px; transform: rotate(21deg); }
  .peeking-cat i { display: none; }
  .auth-side { padding: 22px; width: 100%; }
  .auth-tabs { margin-bottom: 14px; }
  .auth-help { margin: 6px 0 18px; }
  .tabs { justify-content: space-between; margin: 12px 0; padding-bottom: 9px; gap: 2px; }
  .tabs button { flex: 1 1 auto; gap: 4px; min-height: 37px; padding: 5px 4px; font-size: .8rem; border-radius: 9px; }
  .tabs svg { width: 15px; height: 15px; }
  .page-head { flex-direction: column; align-items: start; margin: 18px 0 14px; gap: 13px; }
  .page-head h1 { font-size: 1.85rem; }
  .page-head .muted { font-size: .85rem; margin-top: 4px; }
  .action-line { gap: 7px; }
  .primary, .secondary, .quiet { min-height: 39px; padding: 8px 13px; }
  .sheet { border-radius: 14px; }
  .icon-btn { width: 30px; min-height: 32px; border-radius: 8px; }
  .legend { font-size: .77rem; gap: 4px; }
  .legend .dot:nth-of-type(2) { margin-left: 3px; }
  .sheet { padding: 16px; }
  dialog { padding: 17px; }
  .field-group { gap: 9px; }
  body:has(#workspace:not([hidden])) .bar-inner { height: 58px; }
  #workspace .tabs { margin-bottom: 12px; }
  .agenda-board { border-radius: 17px; }
  .agenda-banner { grid-template-columns: auto minmax(0, 1fr); gap: 10px 13px; padding: 18px; }
  .agenda-banner::before { width: 47px; }
  .agenda-banner .action-line { grid-column: 1 / -1; justify-content: start; }
  .agenda-banner h1 { font-size: 1.64rem; }
  .agenda-banner p { font-size: .87rem; }
  .agenda-body { padding: 16px 12px 8px; }
  .agenda-toolbar { gap: 8px; }
  .agenda-controls { gap: 4px; margin-left: auto; }
  .agenda-controls .icon-btn { width: 31px; min-height: 34px; }
  .date-jump { gap: 4px; }
  .date-jump input { width: 8.15rem; min-height: 34px; padding: 3px 5px; font-size: .875rem; }
  .date-card { border-radius: 9px; gap: 2px; min-height: 60px; }
  .date-card > span { font-size: .8rem; }
  .date-card > b { font-size: 1.35rem; }
  .agenda-heading { margin-top: 24px; gap: 4px; padding-bottom: 10px; }
  .agenda-heading > div:first-child { gap: 6px; }
  .agenda-heading > div:first-child > span { font-size: .83rem; }
  .agenda-row {
    grid-template-columns: 29px minmax(0, 1fr) auto 31px;
    grid-template-areas: "check title time edit" ". note note .";
    column-gap: 6px; row-gap: 0; padding: 11px 0; min-height: 65px;
  }
  .done-toggle, .done-spacer { grid-area: check; }
  .row-title { grid-area: title; }
  .row-note { grid-area: note; font-size: .86rem; }
  .row-note:not(:empty) { margin-top: 3px; }
  .row-edit, .row-edit-spacer { grid-area: edit; }
  .time-pill { grid-area: time; gap: 4px; padding: 6px; font-size: .77rem; }
  .time-pill b { font-size: .86rem; }
  .time-pill .dot { width: 6px; height: 6px; }
  .row-title strong { font-size: .97rem; }
  .row-title small { font-size: .78rem; }
}
@media (max-width: 500px) {
  .date-jump > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
@media (max-width: 365px) {
  .tabs svg { display: none; }
  .legend { flex-basis: 100%; }
  .user-chip { max-width: 80px; }
  .agenda-toolbar h2 { font-size: 1.06rem; }
  .agenda-body { padding-inline: 9px; }
  .agenda-row { grid-template-columns: 24px minmax(0,1fr) auto 25px; column-gap: 3px; }
}
@media (prefers-reduced-motion: no-preference) {
  button, a { transition: background-color .15s, color .15s, box-shadow .15s; }
}

.tabs button[data-tab="admin"] { margin-inline-start: auto; }
.staff-center { padding: clamp(15px, 2.7vw, 32px); background: var(--paper); border: 1px solid var(--line); border-radius: 18px; }
.staff-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(7px, 1.4vw, 17px); }
.staff-stats > div { display: grid; align-content: center; gap: 6px; min-width: 0; padding: clamp(12px, 2vw, 23px); background: var(--wash); border-radius: 13px; }
.staff-stats > div:first-child { background: var(--deep); color: #fffefa; }
.staff-stats small { font-size: .9rem; }
.staff-stats b { font-size: clamp(1.5rem, 3vw, 2.4rem); font-variant-numeric: tabular-nums; letter-spacing: -.035em; line-height: 1.15; }
.staff-search { display: grid; grid-template-columns: minmax(0, 1fr) minmax(9rem, .36fr) auto; align-items: end; gap: 12px; margin: 25px 0 16px; }
.staff-search > label { margin: 0; min-width: 0; }
.staff-search button { min-height: 43px; }
.staff-notice { margin-block: 12px; color: var(--muted); font-size: .92rem; line-height: 1.6; overflow-wrap: anywhere; }
.staff-users { border-top: 1px solid var(--line); }
.staff-row { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .95fr) minmax(0, .85fr) minmax(9rem, auto); align-items: center; gap: 16px; min-height: 79px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.staff-row > div { min-width: 0; overflow-wrap: anywhere; }
.staff-identity { display: grid; gap: 3px; }
.staff-identity strong { font-size: 1.04rem; }
.staff-identity small, .staff-pass { font-size: .9rem; color: var(--muted); }
.staff-state { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.staff-state span { padding: 2px 8px; border-radius: 7px; background: #edf4ef; color: #355d55; font-size: .85rem; line-height: 1.5; }
.staff-row .action-line { justify-content: flex-end; gap: 5px; }
.staff-row .action-line:empty { display: none; }
.staff-pager { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding-top: 16px; color: var(--muted); font-size: .92rem; }
.staff-pager button:disabled { color: #788582; background: transparent; }
.staff-details summary { color: var(--deep); font-size: 1rem; font-weight: 650; }
.staff-details[open] > summary { margin-bottom: 14px; }

@media (max-width: 760px) {
  .staff-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "identity state" "password password" "actions actions"; gap: 7px 12px; }
  .staff-identity { grid-area: identity; }
  .staff-state { grid-area: state; justify-content: flex-end; }
  .staff-pass { grid-area: password; }
  .staff-row .action-line { grid-area: actions; justify-content: flex-start; }
}
@media (max-width: 570px) {
  .tabs:has(button[data-tab="admin"]:not([hidden])) { overflow-x: auto; justify-content: flex-start; }
  .tabs:has(button[data-tab="admin"]:not([hidden])) button { min-height: 40px; flex: 1 0 auto; }
  .tabs:has(button[data-tab="admin"]:not([hidden])) svg { display: none; }
  .staff-search { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-block: 17px 13px; }
  .staff-search > :first-child { grid-column: 1 / -1; }
  .staff-stats > div { padding: 11px 8px; }
  .staff-stats small { font-size: .83rem; }
  .staff-row .action-line button { min-height: 40px; }
  .staff-pager { justify-content: center; }
}
