:root {
  color-scheme: light;
  --ink: #302832;
  --muted: #706972;
  --line: #e2dfe1;
  --plum: #49233e;
  --paper: #faf9f8;
  font: 14px/1.5 Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
button, input, select {
  min-height: 40px;
  border-radius: 7px;
  border: 1px solid #d7d0d6;
  background: #fff;
  color: var(--ink);
  padding: 7px 12px;
}
button { cursor: pointer; font-weight: 600; }
button:hover { border-color: #a1869c; background: #faf7fa; }
button.primary { background: var(--plum); color: #fff; border-color: var(--plum); }
button.primary:hover { background: #623053; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid #94738a; outline-offset: 2px; }
.sp-header {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; flex-wrap: wrap;
  gap: 12px 32px; padding: 8px clamp(16px,4vw,54px); background: white; border-bottom: 1px solid var(--line);
}
.sp-header > img { display: block; width: 145px; height: auto; }
.sp-header nav { display: flex; align-self: stretch; gap: 5px; }
.sp-header nav button { color: var(--muted); border: 0; border-bottom: 2px solid transparent; border-radius: 0; }
.sp-header nav button[aria-current] { color: var(--plum); border-color: var(--plum); }
#identity { margin-left: auto; display: flex; gap: 12px; align-items: center; min-width: 0; }
#staff-name { overflow-wrap: anywhere; font-weight: 600; }
#logout { color: #943b4a; background: #fff9fa; }
main { width: min(1120px,100%); margin: 0 auto; padding: clamp(18px,3.5vw,42px) clamp(16px,3vw,36px); }
h1,h2 { margin: 0; line-height: 1.25; color: var(--ink); }
h1 { font-size: clamp(21px,3vw,27px); }
h2 { font-size: 20px; }
.sp-heading,.dialog-actions,#head-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.sp-heading { justify-content: space-between; align-items: end; margin-bottom: 16px; }
.salon { margin: 0 0 2px; color: var(--muted); overflow-wrap: anywhere; }
#status:empty,#auth-status:empty,#edit-error:empty { display: none; }
#auth-status,#edit-error { color: #8c2a3a; }
#status,#loading { color: var(--muted); }
#auth-hint { margin: 6px 0 0; color: var(--muted); }
.sp-list,.empty,.auth-card,dialog {
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 5px #34253708; background: white;
}
.sp-list { margin: 0; padding: 0; list-style: none; }
.sp-list li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 15px; }
.sp-list li + li { border-top: 1px solid var(--line); }
.sp-list li > div { min-width: 0; overflow-wrap: anywhere; }
.sp-list li > div span { display: block; color: var(--muted); }
.appointment-list time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.appointment-list li > div { flex: 1; }
.visit-status { color: var(--muted); }
.empty { padding: 18px; color: var(--muted); }
.auth-card { max-width: 414px; margin: clamp(20px,8vh,80px) auto; padding: clamp(20px,3vw,30px); }
#auth-form, #edit-fields { display: grid; gap: 14px; margin-top: 20px; }
label { display: grid; gap: 4px; font-weight: 600; }
label input,label select { width: 100%; min-width: 0; font-weight: 400; }
dialog { color: var(--ink); width: min(430px,calc(100% - 24px)); padding: 22px; max-height: 90dvh; }
dialog::backdrop { background: #30233273; }
.dialog-actions { margin-top: 18px; justify-content: flex-end; }
@media (max-width: 720px) {
  .sp-header { gap: 4px 10px; justify-content: space-between; }
  .sp-header nav { order: 3; width: 100%; }
  #staff-name { max-width: 110px; font-size: 12px; }
  .sp-header > img { width: 123px; }
  #identity { gap: 6px; }
  .sp-heading { align-items: start; flex-direction: column; }
  #head-actions input { max-width: 100%; }
}
@media (max-width: 460px) {
  .appointment-list li { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: start; }
  .appointment-list .visit-status { grid-column: 2; }
  #identity { max-width: calc(100% - 133px); }
}
