/* Neutral default surfaces; alternate themes tint the same clean surfaces. */
:root {
  color-scheme: dark;
  --tint: #a8b8ff;
  --surface-tint: 0%;
  --bg: #232428;
  --bg-glow: var(--bg);
  --panel: color-mix(in srgb, var(--tint) var(--surface-tint), #27282d);
  --panel-2: var(--panel);
  --card: color-mix(in srgb, var(--tint) var(--surface-tint), #303136);
  --card-selected: color-mix(in srgb, var(--tint) 20%, #303136);
  --hover: color-mix(in srgb, var(--tint) var(--surface-tint), #3b3d44);
  --text: #f2f3f5;
  --muted: #b6bac3;
  --subtle: #9399a5;
  --border: #404249;
  --input: color-mix(in srgb, var(--tint) var(--surface-tint), #35373e);
  --disabled: #2c2d32;
  --button: var(--card);
  --button-hover: var(--hover);
  --button-text: var(--text);
  --accent: var(--tint);
  --accent-hover: color-mix(in srgb, var(--tint) 85%, white);
  --accent-soft: var(--card-selected);
  --accent-text: #1e2332;
  --primary-fill: color-mix(in srgb, var(--tint) 25%, #303136);
  --primary-text: #f2f3ff;
  --primary-hover: color-mix(in srgb, var(--tint) 38%, #303136);
  --success: #79d9a6;
  --success-bg: #293e33;
  --success-text: #9fe2bc;
  --busy: #e1bb80;
  --busy-bg: #423728;
  --busy-text: #e1bb80;
  --past: #59616d;
  --timeline-bg: #222328;
  --shadow: none;
  --radius: 10px;
  --radius-small: 7px;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4f6;
  --panel: color-mix(in srgb, var(--tint) var(--surface-tint), #f8f9fb);
  --card: color-mix(in srgb, var(--tint) var(--surface-tint), #e7e9ed);
  --card-selected: color-mix(in srgb, var(--tint) 20%, #e7e9ed);
  --hover: color-mix(in srgb, var(--tint) var(--surface-tint), #dce0e6);
  --text: #22252b;
  --muted: #5a606b;
  --subtle: #6d7480;
  --border: #d0d4dc;
  --input: color-mix(in srgb, var(--tint) var(--surface-tint), #e1e4e9);
  --disabled: #e7e9ed;
  --accent: color-mix(in srgb, var(--tint) 50%, #172135);
  --accent-hover: color-mix(in srgb, var(--tint) 35%, #172135);
  --accent-text: #fff;
  --primary-fill: color-mix(in srgb, var(--tint) 28%, #dde2ed);
  --primary-text: #26304f;
  --primary-hover: color-mix(in srgb, var(--tint) 40%, #dde2ed);
  --success: #207149;
  --success-bg: #dceee2;
  --success-text: #207149;
  --busy: #89602e;
  --busy-bg: #f0e5d6;
  --busy-text: #89602e;
  --past: #8e96a1;
  --timeline-bg: #d5dae2;
}
html[data-accent-theme="violet"] { --tint: #b8a6e7; --surface-tint: 8%; }
html[data-accent-theme="rose"] { --tint: #e6a4b7; --surface-tint: 8%; }
html[data-accent-theme="mint"] { --tint: #94d4b2; --surface-tint: 8%; }
html[data-accent-theme="orange"] { --tint: #dfb084; --surface-tint: 8%; }
html[data-theme="dark"][data-accent-theme="violet"] { --bg: #292730; }
html[data-theme="dark"][data-accent-theme="rose"] { --bg: #2d272c; }
html[data-theme="dark"][data-accent-theme="mint"] { --bg: #262d2b; }
html[data-theme="dark"][data-accent-theme="orange"] { --bg: #2c2929; }
html[data-theme="light"][data-accent-theme="violet"] { --bg: #f0eef5; }
html[data-theme="light"][data-accent-theme="rose"] { --bg: #f5eef1; }
html[data-theme="light"][data-accent-theme="mint"] { --bg: #edf4f0; }
html[data-theme="light"][data-accent-theme="orange"] { --bg: #f5f1ed; }

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: radial-gradient(circle at 86% -8%, var(--bg-glow) 0, transparent 34rem), var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color 220ms ease, color 180ms ease;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="time"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 28px max(28px, env(safe-area-inset-bottom));
}

.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

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

.brand-dot {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 14%, transparent);
  flex: 0 0 auto;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.brand-copy h1 {
  font-size: clamp(2rem, 4vw, 2.55rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.brand-copy > p {
  color: var(--muted);
  margin-top: 7px;
  font-size: 0.98rem;
}

.theme-controls {
  display: flex;
  gap: 7px;
}

.icon-button,
.secondary-button,
.primary-button {
  cursor: pointer;
  border-radius: 10px;
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.icon-button:active,
.secondary-button:active,
.primary-button:active {
  transform: translateY(1px) scale(0.99);
}

.icon-button {
  min-width: 42px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--button);
  color: var(--button-text);
  font-size: 1.1rem;
  font-weight: 800;
}

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

.icon-button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.control-bar {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.live-control {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.91rem;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.live-control input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  margin: 0;
}

.field-group {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

select,
input[type="time"] {
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--input);
  color: var(--text);
  padding: 0 11px;
  outline: none;
}

select:focus,
input[type="time"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

select:disabled,
input[type="time"]:disabled {
  background: var(--disabled);
  color: var(--subtle);
  cursor: not-allowed;
}

.primary-button {
  min-height: 38px;
  padding: 0 16px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 800;
}

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

.secondary-button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--border);
  background: var(--button);
  color: var(--button-text);
  font-weight: 750;
}

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

.secondary-button.compact {
  min-height: 31px;
  padding: 0 11px;
  font-size: 0.8rem;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(340px, 4fr);
  gap: 16px;
  min-height: min(690px, calc(100vh - 210px));
}

.people-panel,
.detail-panel {
  min-width: 0;
  overflow: hidden;
}

.people-panel {
  display: flex;
  flex-direction: column;
}

.people-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 0;
}

.people-heading-row h2 {
  font-size: 1.42rem;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.people-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--success-bg);
  color: var(--success-text);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-line {
  color: var(--muted);
  padding: 7px 18px 12px;
  font-size: 0.88rem;
}

.people-list {
  overflow-y: auto;
  overscroll-behavior-y: auto;
  scrollbar-gutter: stable;
  padding: 1px 11px 11px;
  flex: 1;
  min-height: 0;
}

.people-list::-webkit-scrollbar {
  width: 10px;
}

.people-list::-webkit-scrollbar-track {
  background: transparent;
}

.people-list::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 42%, transparent);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}

.person-card {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 13px;
  margin: 8px 0;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.person-card:hover {
  background: var(--hover);
  transform: translateY(-1px);
}

.person-card.selected {
  background: var(--card-selected);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.person-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
}

.person-status-dot.busy {
  background: var(--busy);
}

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

.person-name {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
}

.person-detail {
  display: block;
  color: var(--muted);
  font-size: 0.79rem;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-badge {
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 0.72rem;
  line-height: 1.12;
  font-weight: 850;
  text-align: center;
  white-space: nowrap;
}

.status-badge.free {
  background: var(--success-bg);
  color: var(--success-text);
}

.status-badge.busy {
  background: var(--busy-bg);
  color: var(--busy-text);
}

.empty-list,
.empty-detail,
.data-error {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
}

.empty-list h3,
.empty-detail h2,
.data-error h3 {
  font-size: 1.1rem;
  letter-spacing: -0.015em;
}

.empty-list p,
.empty-detail p,
.data-error p {
  color: var(--muted);
  margin-top: 6px;
  max-width: 330px;
  line-height: 1.45;
}

.empty-symbol {
  color: var(--subtle);
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.detail-panel {
  padding-bottom: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.detail-header {
  padding: 21px 22px 7px;
}

.detail-header h2 {
  font-size: 1.48rem;
  letter-spacing: -0.035em;
}

.detail-status-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 9px;
}

.until-copy {
  color: var(--muted);
  font-size: 0.88rem;
}

.detail-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 11px;
  margin: 10px 22px;
  padding: 13px 14px;
}

.detail-label {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.detail-label.busy {
  color: var(--busy);
}

.detail-headline {
  margin-top: 6px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}

.detail-copy {
  color: var(--muted);
  margin-top: 5px;
  font-size: 0.86rem;
  line-height: 1.45;
  white-space: pre-line;
}

.timeline-card {
  padding-bottom: 10px;
}

.timeline {
  position: relative;
  height: 104px;
  margin-top: 7px;
  overflow: hidden;
}

.timeline-axis {
  position: absolute;
  left: 2px;
  right: 2px;
  top: 43px;
  height: 8px;
  border-radius: 999px;
  background: var(--timeline-bg);
}

.timeline-class {
  position: absolute;
  top: 33px;
  height: 28px;
  min-width: 16px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-size: 0.62rem;
  font-weight: 850;
  color: #fff;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.timeline-class.past {
  background: var(--past);
  color: var(--text);
}

.timeline-class.current {
  background: var(--busy);
  color: #111827;
}

.timeline-class.future {
  background: var(--accent);
}

.timeline-time {
  position: absolute;
  top: 68px;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 0.65rem;
  white-space: nowrap;
}

.timeline-time.start {
  transform: translateX(0);
}

.timeline-time.end {
  transform: translateX(-100%);
}

.timeline-marker {
  position: absolute;
  top: 20px;
  bottom: 34px;
  width: 2px;
  background: var(--success);
  transform: translateX(-50%);
  z-index: 3;
}

.timeline-marker::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  transform: translateX(-50%);
}

.timeline-marker-label {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  color: var(--success);
  font-size: 0.65rem;
  font-weight: 850;
  white-space: nowrap;
}

.data-error-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--busy-bg);
  color: var(--busy-text);
  font-weight: 900;
  margin-bottom: 12px;
}

.data-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: center;
  margin-top: 16px;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.file-button input {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 110;
  pointer-events: none;
  background: var(--text);
  color: var(--bg);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 750;
  box-shadow: 0 10px 30px rgba(0,0,0,.24);
}

@media (max-width: 880px) {
  .app-shell {
    padding-left: 18px;
    padding-right: 18px;
  }

  .control-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto;
  }

  .field-group {
    min-width: 0;
  }

  .field-group select,
  .field-group input {
    width: 100%;
    min-width: 0;
  }

  .main-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .people-panel {
    min-height: 420px;
    max-height: 58vh;
  }

  .detail-panel {
    min-height: 420px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding-left: 12px;
    padding-right: 12px;
    padding-top: max(18px, env(safe-area-inset-top));
  }

  .app-header {
    align-items: center;
  }

  .brand-copy > p {
    font-size: 0.87rem;
    max-width: 250px;
  }

  .theme-controls {
    gap: 5px;
  }

  .icon-button {
    min-width: 39px;
    height: 38px;
  }

  .control-bar {
    grid-template-columns: 1fr 1fr;
    gap: 11px;
    padding: 13px;
  }

  .live-control {
    grid-column: 1 / -1;
  }

  .field-group {
    display: block;
  }

  .field-group > span {
    display: block;
    margin-bottom: 6px;
  }

  .people-heading-row {
    align-items: flex-start;
    padding: 16px 14px 0;
  }

  .people-actions {
    flex-wrap: wrap;
    gap: 6px;
  }

  .people-heading-row h2 {
    font-size: 1.25rem;
  }

  .status-line {
    padding-left: 14px;
    padding-right: 14px;
  }

  .people-list {
    padding-left: 7px;
    padding-right: 7px;
  }

  .person-card {
    padding: 10px 11px;
    gap: 9px;
  }

  .person-detail {
    font-size: 0.74rem;
  }

  .status-badge {
    font-size: 0.65rem;
    padding: 6px 7px;
  }

  .detail-card {
    margin-left: 14px;
    margin-right: 14px;
  }

  .detail-header {
    padding-left: 14px;
    padding-right: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* Local schedule-data UI */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-data-button {
  height: 40px;
  min-height: 40px;
}

.visually-hidden {
  position: fixed !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.data-setup {
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 34px 26px;
}

.data-setup-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.6rem;
  font-weight: 900;
  border: 0;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}

.data-setup-icon:hover { filter: brightness(1.1); }
.data-setup-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.data-setup h3 {
  font-size: 1.14rem;
  letter-spacing: -0.02em;
}

.data-setup-message {
  color: var(--muted);
  max-width: 385px;
  margin: 7px 0 17px;
  line-height: 1.5;
  font-size: 0.91rem;
}

.data-setup-message strong {
  color: var(--text);
}

.local-only-note {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 14px;
}

.local-only-note span {
  color: var(--success);
  font-size: 0.64rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 8, 15, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

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

.modal-backdrop.import-progress-overlay {
  z-index: 1000;
  background: rgba(0, 0, 0, .78);
  touch-action: pan-y;
  overscroll-behavior: contain;
}

.import-progress-card {
  width: min(380px, 100%);
  box-sizing: border-box;
  padding: 28px 24px;
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  text-align: center;
  max-height: 100%;
  overflow-y: auto;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .35);
}

.import-progress-card h2 { margin: 0 0 12px; font-size: 1.15rem; font-weight: 500; }
#importProgressMessage { margin: 0; line-height: 1.55; overflow-wrap: anywhere; }
.import-progress-note { margin: 14px 0 0; color: var(--muted); font-size: .85rem; }
#importProgressOverlay [hidden] { display: none !important; }
.import-picture-name { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); text-align: left; }
.import-picture-name input { width: 100%; min-height: 44px; font-size: 16px; }
.import-picture-name button { margin-top: 14px; min-height: 44px; }
.import-progress-spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 18px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: import-progress-spin .9s linear infinite;
}
@keyframes import-progress-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .import-progress-spinner { animation: none; } }

.schedule-modal {
  width: min(520px, 100%);
  padding: 21px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.32);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.modal-header h2 {
  font-size: 1.34rem;
  letter-spacing: -0.03em;
}

.modal-header p {
  color: var(--muted);
  margin-top: 6px;
  font-size: 0.86rem;
  line-height: 1.45;
  max-width: 410px;
}

.modal-close {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--button);
  color: var(--text);
  font-size: 1.45rem;
  line-height: 1;
}

.modal-close:hover {
  background: var(--button-hover);
}

.storage-status {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  padding: 14px;
}

.storage-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.storage-status-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.055em;
}

.storage-status-value {
  margin-top: 5px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.storage-status-meta {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 5px;
  line-height: 1.4;
}

.local-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success-text);
  font-size: 0.72rem;
  font-weight: 850;
}

.local-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.modal-actions {
  display: flex;
  gap: 9px;
  margin-top: 14px;
}

.modal-actions > button {
  flex: 1;
}

.danger-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid color-mix(in srgb, #e24b4b 50%, var(--border));
  background: color-mix(in srgb, #e24b4b 10%, var(--button));
  color: color-mix(in srgb, #ff6666 75%, var(--text));
  font-weight: 800;
}

.danger-button:hover:not(:disabled) {
  background: color-mix(in srgb, #e24b4b 17%, var(--button));
}

.danger-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.privacy-footnote {
  color: var(--subtle);
  font-size: 0.76rem;
  line-height: 1.45;
  margin-top: 13px;
}

@media (max-width: 640px) {
  .app-header {
    gap: 10px;
  }

  .header-actions {
    gap: 5px;
  }

  .header-data-button {
    padding: 0 9px;
    font-size: 0.78rem;
  }

  .schedule-modal {
    padding: 18px;
  }

  .modal-actions {
    flex-direction: column;
  }
}

.secondary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .app-header {
    flex-wrap: wrap;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: -2px;
  }
}

/* PDF import + sharing manager */
.schedule-modal {
  width: min(620px, 100%);
  max-height: min(82vh, 760px);
  overflow-y: auto;
}

.setup-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: center;
}

.setup-actions > button {
  min-height: 42px;
}

.schedule-action-section {
  margin-top: 14px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--card) 88%, var(--bg));
}

.schedule-action-section h3 {
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  margin: 3px 0 5px;
}

.schedule-action-section > p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.48;
}

.section-kicker {
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.wide-action {
  width: 100%;
  min-height: 43px;
}

.parser-status {
  min-height: 0;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.parser-status:empty {
  display: none;
}

.parser-status[data-tone="working"] { color: var(--accent); }
.parser-status[data-tone="success"] { color: var(--success-text); }
.parser-status[data-tone="warning"] { color: var(--busy-text); }
.parser-status[data-tone="error"] { color: color-mix(in srgb, #ef5b5b 78%, var(--text)); }

.image-review[hidden] { display: none; }
.image-review details { margin: 12px 0; }
.image-review summary { cursor: pointer; color: var(--accent); }
.image-review img { display: block; max-width: 100%; height: auto; margin-top: 10px; border-radius: 6px; }
.review-name { margin: 14px 0; }
.review-classes { display: grid; gap: 12px; margin-bottom: 14px; }
.review-class { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.review-class legend { padding: 0 5px; color: var(--muted); font-size: 0.8rem; }
.review-class .field-group { min-width: 0; }
.review-class input, .review-class select, .review-name input { width: 100%; min-width: 0; max-width: 100%; min-height: 44px; box-sizing: border-box; }
.review-class > button { justify-self: start; }
.review-actions { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 380px) { .review-class { grid-template-columns: minmax(0, 1fr); } }

.database-actions {
  margin-top: 0;
}

.database-actions > button {
  min-height: 40px;
}

.people-manager-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 3px 0 9px;
}

.people-manager-heading h3 {
  margin: 0;
}

.people-manager-list {
  display: grid;
  gap: 7px;
}

.people-manager-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--input);
  border: 1px solid var(--border);
}

.people-manager-copy {
  min-width: 0;
}

.people-manager-name {
  font-size: 0.86rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.people-manager-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.people-manager-empty {
  margin: 0;
  padding: 11px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.mini-danger-button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, #e24b4b 42%, var(--border));
  background: transparent;
  color: color-mix(in srgb, #ee6262 72%, var(--text));
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.mini-danger-button:hover {
  background: color-mix(in srgb, #e24b4b 10%, transparent);
}

.remove-all-button {
  width: 100%;
  margin-top: 14px;
  min-height: 40px;
}

@media (max-width: 640px) {
  .schedule-modal {
    max-height: 86vh;
  }

  .setup-actions,
  .database-actions {
    flex-direction: column;
    width: 100%;
  }

  .setup-actions > button,
  .database-actions > button {
    width: 100%;
  }

  .people-manager-row {
    align-items: flex-start;
  }
}


/* v6 — settings, notifications, creator credit, and motion polish */
.creator-credit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 16px 0 2px;
  color: var(--subtle);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.creator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.8;
}

.settings-modal {
  width: min(620px, 100%);
  max-height: min(84vh, 780px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 21px;
}

.settings-section {
  margin-top: 14px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--card) 88%, var(--bg));
}

.settings-section h3 {
  margin: 3px 0 0;
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.settings-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-description {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.48;
}

.settings-note {
  margin-top: 10px;
  color: var(--subtle);
  font-size: 0.74rem;
  line-height: 1.45;
}

.settings-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}

.notification-status {
  margin-top: 11px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.notification-status[data-tone="success"] {
  border-color: color-mix(in srgb, var(--success) 36%, var(--border));
  background: color-mix(in srgb, var(--success-bg) 72%, var(--input));
  color: var(--success-text);
}

.notification-status[data-tone="error"] {
  border-color: color-mix(in srgb, #e24b4b 38%, var(--border));
  background: color-mix(in srgb, #e24b4b 8%, var(--input));
  color: color-mix(in srgb, #ff7676 72%, var(--text));
}

.switch-control {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
}

.switch-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  display: block;
  width: 50px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--button);
  transition: background-color 160ms ease, border-color 160ms ease;
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.18);
  transition: transform 170ms ease;
}

.switch-control input:checked + .switch-track {
  border-color: var(--accent);
  background: var(--accent);
}

.switch-control input:checked + .switch-track .switch-thumb {
  transform: translateX(20px);
  background: #fff;
}

.switch-control input:focus-visible + .switch-track {
  outline: 3px solid color-mix(in srgb, var(--accent) 25%, transparent);
  outline-offset: 2px;
}

.notification-people-list {
  display: grid;
  gap: 7px;
  margin-top: 11px;
}

.notification-person-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 11px;
  min-width: 0;
  padding: 9px 10px 9px 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--input);
}

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

.notification-person-name {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 820;
  overflow-wrap: anywhere;
}

.notification-person-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.bell-button {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--text);
  cursor: pointer;
  font-size: 1.05rem;
  transition: background-color 120ms ease, border-color 120ms ease, opacity 120ms ease;
}

.bell-button:hover {
  background: color-mix(in srgb, var(--accent-soft) 74%, var(--hover));
  border-color: var(--accent);
}

.bell-button.muted {
  border-color: var(--border);
  background: var(--button);
  opacity: 0.7;
}

.appearance-settings-section {
  padding-bottom: 14px;
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.icon-button:focus-visible,
.modal-close:focus-visible,
.bell-button:focus-visible,
.danger-button:focus-visible,
.mini-danger-button:focus-visible,
.person-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent);
  outline-offset: 2px;
}

.toast {
  max-width: min(440px, calc(100vw - 24px));
  text-align: center;
  white-space: normal;
}

@media (hover: hover) and (pointer: fine) {
  .creator-credit {
    transition: color 160ms ease;
  }

  .creator-credit:hover {
    color: var(--muted);
  }
}

@media (max-width: 720px) {
  .schedule-modal,
  .settings-modal {
    width: min(100%, 620px);
    max-height: calc(100dvh - 24px);
  }

  .settings-inline-actions > button {
    min-height: 44px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }

  .app-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 12px;
  }

  .brand-copy > p {
    max-width: none;
  }

  .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    margin-top: 0;
  }

  .header-data-button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    font-size: 0.82rem;
  }

  .theme-controls {
    flex: 0 0 auto;
  }

  .icon-button {
    width: 42px;
    min-width: 42px;
    height: 44px;
  }

  .control-bar {
    gap: 9px;
  }

  select,
  input[type="time"] {
    min-height: 44px;
    font-size: 16px;
  }

  .primary-button,
  .secondary-button {
    min-height: 44px;
  }

  .people-panel {
    min-height: 380px;
    max-height: none;
  }

  .people-heading-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }

  .people-actions {
    justify-content: space-between;
    width: 100%;
    flex-wrap: nowrap;
  }

  .people-actions .compact {
    min-height: 38px;
  }

  .person-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 11px 10px;
  }

  .person-name {
    font-size: 0.96rem;
  }

  .person-detail {
    font-size: 0.72rem;
  }

  .detail-panel {
    min-height: 360px;
  }

  .modal-backdrop {
    padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
    align-items: center;
  }

  .schedule-modal,
  .settings-modal {
    width: 100%;
    max-height: calc(100dvh - max(16px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom)));
    padding: 16px;
    border-radius: 15px;
  }

  .modal-header {
    gap: 12px;
  }

  .modal-header p {
    font-size: 0.8rem;
  }

  .schedule-action-section,
  .settings-section {
    padding: 13px;
  }

  .settings-section-heading {
    gap: 12px;
  }

  .settings-description {
    font-size: 0.81rem;
  }

  .notification-person-row {
    min-height: 58px;
  }

  .database-actions,
  .setup-actions,
  .settings-inline-actions {
    width: 100%;
  }

  .settings-inline-actions > button,
  .database-actions > button,
  .setup-actions > button {
    width: 100%;
  }

  .creator-credit {
    margin-top: 13px;
    padding-bottom: 2px;
  }
}

@media (max-width: 420px) {
  .brand-copy h1 {
    font-size: 1.9rem;
  }

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

  .theme-controls {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .control-bar {
    padding: 12px;
  }

  .person-card {
    gap: 8px;
  }

  .status-badge {
    max-width: 80px;
    white-space: normal !important;
    line-height: 1.15;
  }

  .detail-card {
    margin-left: 11px;
    margin-right: 11px;
  }

  .detail-header {
    padding-left: 11px;
    padding-right: 11px;
  }

  .timeline-time:not(.start):not(.end) {
    display: none;
  }

  .settings-section-heading.people-notification-heading {
    align-items: flex-start;
  }

  .creator-credit {
    font-size: 0.7rem;
  }
}

/* v8 — complete color themes. Each preset recolors the full UI, not just accents. */








.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.schedule-undo-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.schedule-undo-row .status-line { flex: 1 1 200px; margin: 0; }

.theme-mode-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 13px;
}

.theme-mode-button {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--button);
  color: var(--button-text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 120ms ease;
}

.theme-mode-button:hover {
  background: var(--button-hover);
}

.theme-mode-button.active,
.theme-mode-button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 52%, transparent);
}

.theme-mode-button:focus-visible,
.color-theme-card:focus-visible,
.preference-icon-button:focus-visible,
.nickname-input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 26%, transparent);
  outline-offset: 2px;
}

.theme-template-label {
  margin-top: 15px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 820;
  letter-spacing: 0.02em;
}

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

.color-theme-card {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--input);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, transform 120ms ease;
}

.color-theme-card:hover {
  background: var(--hover);
}

.color-theme-card.active,
.color-theme-card[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 72%, var(--input));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 42%, transparent);
}

.color-theme-card strong,
.color-theme-card small {
  display: block;
  min-width: 0;
}

.color-theme-card strong {
  font-size: 0.82rem;
  line-height: 1.15;
}

.color-theme-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
}

.theme-swatch {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 2px 8px rgba(0,0,0,.12);
}
.theme-swatch.blue { background: linear-gradient(135deg, #08111F 0 40%, #17304D 40% 70%, #4C8DFF 70%); }
.theme-swatch.violet { background: linear-gradient(135deg, #100C19 0 40%, #2B1E3E 40% 70%, #A77BFF 70%); }
.theme-swatch.rose { background: linear-gradient(135deg, #170C12 0 40%, #3A1D2B 40% 70%, #FF7196 70%); }
.theme-swatch.mint { background: linear-gradient(135deg, #071611 0 40%, #183E32 40% 70%, #40D99A 70%); }
.theme-swatch.orange { background: linear-gradient(135deg, #181008 0 40%, #3E2918 40% 70%, #FF9F43 70%); }

.people-preferences-list {
  gap: 9px;
}

.people-preference-card {
  display: block;
  padding: 10px 11px 11px;
}

.people-preference-card.pinned {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 44%, var(--input));
}

.people-preference-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.people-preference-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.preference-icon-button,
.bell-button {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 11px;
}

.preference-icon-button {
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--button);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  opacity: .72;
  transition: opacity 120ms ease, background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.preference-icon-button:hover {
  opacity: 1;
  background: var(--button-hover);
}

.preference-icon-button.active {
  opacity: 1;
  border-color: var(--accent);
  background: var(--accent-soft);
}

.nickname-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin-top: 9px;
}

.nickname-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.nickname-input {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
  font-size: 16px;
  outline: none;
}

.nickname-input::placeholder {
  color: var(--subtle);
}

.person-card.pinned {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
}

.person-pin-mark {
  display: inline-block;
  font-size: 0.72em;
  vertical-align: 0.08em;
  opacity: .82;
}

/* Keep timeline labels and native time controls inside narrow phone layouts. */
.field-group,
.field-group input,
.field-group select {
  min-width: 0;
}

input[type="time"] {
  max-width: 100%;
}

.timeline-marker-label[data-edge="start"] {
  transform: translateX(0);
}

.timeline-marker-label[data-edge="end"] {
  transform: translateX(-100%);
}

.timeline-marker-label[data-edge="center"] {
  transform: translateX(-50%);
}

.status-badge,
.until-copy,
.timeline-marker-label {
  max-width: 100%;
}

.detail-status-row {
  flex-wrap: wrap;
}

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

@media (max-width: 560px) {
  .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .header-data-button {
    width: 100%;
  }

  .control-bar .field-group {
    width: 100%;
  }

  .control-bar input[type="time"],
  .control-bar select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .people-preference-top {
    align-items: flex-start;
  }

  .nickname-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .nickname-input {
    height: 42px;
  }

  .timeline {
    margin-left: 2px;
    margin-right: 2px;
  }

  .timeline-marker-label {
    max-width: calc(100% - 4px);
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 420px) {
  .color-theme-grid {
    grid-template-columns: 1fr 1fr;
  }

  .color-theme-card {
    min-height: 54px;
    padding: 8px 9px;
  }

  .person-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .person-card .status-badge {
    grid-column: 2;
    justify-self: end;
    width: fit-content;
    max-width: min(100%, 112px);
    margin-top: -2px;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  .people-preference-actions {
    gap: 5px;
  }

  .preference-icon-button,
  .bell-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }
}

@media (max-width: 350px) {
  .color-theme-grid {
    grid-template-columns: 1fr;
  }

  .people-preference-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }
}


/* Smooth full-theme changes without making the UI feel animated for its own sake. */
.panel,
.person-card,
.detail-card,
.storage-status,
.settings-section,
.color-theme-card,
.theme-mode-button,
.secondary-button,
.primary-button,
select,
input[type="time"],
.nickname-input,
.count-badge,
.status-badge {
  transition-property: background-color, background, border-color, color, box-shadow, transform;
  transition-duration: 180ms;
  transition-timing-function: ease;
}

/* Strip the native time-input minimum so compact controls fit small phones. */
@media (max-width: 480px) {
  .control-bar select,
  .control-bar input[type="time"] {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0;
  }

  .control-bar input[type="time"] {
    -webkit-appearance: none;
    appearance: none;
    text-align: left;
  }

  .control-bar input[type="time"]::-webkit-date-and-time-value {
    text-align: left;
    min-width: 0;
  }
}

/* Weekly review: one pixel per minute, with a horizontally scrollable week. */
.review-grid-scroll { overflow-x: auto; margin: 16px 0; border: 1px solid var(--border); border-radius: 10px; }
/* Keep native horizontal swipes and pinch zoom. Vertical touch movement is
   shared by the review grid and its dialog, even after reaching an edge. */
#imageReview .review-grid-scroll { touch-action: pan-x pinch-zoom; overscroll-behavior-y: auto; }
.review-grid { display: grid; grid-template-columns: 54px repeat(7, minmax(110px, 1fr)); min-width: 850px; }
.review-time-axis { position: relative; }
.review-time-axis span { position: absolute; left: 3px; font-size: 11px; color: var(--muted); transform: translateY(-50%); }
.review-day { border-left: 1px solid var(--border); min-width: 0; }
.review-day-heading { width: 100%; height: 48px; color: var(--text); background: var(--panel); border: 0; cursor: pointer; font-size: 12px; }
.review-day-track { position: relative; background: repeating-linear-gradient(to bottom, transparent 0, transparent 59px, var(--border) 59px, var(--border) 60px); }
.review-grid-block, .review-break { position: absolute; left: 3px; right: 3px; box-sizing: border-box; overflow: hidden; border-radius: 5px; font-size: 11px; padding: 3px; }
.review-grid-block { color: #fff; background: #2857a7; border: 1px solid #83afff; cursor: pointer; text-align: left; }
.review-grid-block:focus-visible { outline: 3px solid #fff; z-index: 2; }
.review-break { color: #baf1ca; background: #16442c; pointer-events: none; }
.review-class[hidden] { display: none; }

.person-availability { display: block; margin-top: 5px; font-size: 0.79rem; line-height: 1.4; white-space: pre-line; overflow-wrap: anywhere; }
.review-passing { position: absolute; left: 3px; right: 3px; box-sizing: border-box; overflow: hidden; color: var(--muted); background: var(--input); font-size: 9px; pointer-events: none; }

.share-code-panel { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.share-code-panel h4 { margin: 0 0 12px; }
.export-people-list { max-height: 250px; overflow-y: auto; margin-bottom: 14px; }
.share-selection { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; overflow-wrap: anywhere; }
.share-selection input { flex: 0 0 auto; width: 20px; height: 20px; accent-color: var(--accent); }
.share-code-field { margin-top: 14px; }
.share-code-field textarea { width: 100%; min-width: 0; box-sizing: border-box; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--input); color: var(--text); font: 16px/1.45 ui-monospace, monospace; resize: vertical; overflow-wrap: anywhere; }
.share-code-note { font-size: 0.8rem; color: var(--muted); }

/* Groups retain the original people cards and scroll inside the same panel. */
.people-heading-row { display: flex; align-items: center; justify-content: space-between; }
.people-actions { width: auto; flex-wrap: nowrap; justify-content: flex-end; gap: 6px; }
.view-icon-button, .people-group-actions .group-hide { display: inline-flex; align-items: center; justify-content: center; width: 36px; min-width: 36px; min-height: 36px; padding: 0; flex-shrink: 0; }
.view-icon-button svg, .group-hide svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.view-icon-button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--card-selected); }
.view-mode-button { width: auto; gap: 5px; padding: 0 9px; font-size: 0.8rem; }
.people-group { margin: 8px 0 18px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.people-group-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 2px 2px 6px; }
.people-group-header > div:first-child { min-width: 0; }
.people-group-header h3 { margin: 0 0 4px; font-size: 1rem; overflow-wrap: anywhere; }
.people-group-header small { color: var(--muted); font-size: 0.75rem; }
.people-group-header p { margin: 6px 0 0; color: var(--text); font-size: 0.8rem; line-height: 1.5; }
.people-group-actions { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.people-group-actions .group-more { min-width: 36px; min-height: 32px; padding: 0 8px; font-size: 1.4rem; line-height: 1; }
.group-empty { color: var(--muted); font-size: 0.85rem; padding: 8px 2px; line-height: 1.5; }
.groups-manager-list { display: grid; gap: 10px; margin: 16px 0; }
.group-manager-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.group-manager-row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.group-manager-row small { display: block; color: var(--muted); margin-top: 5px; }
.group-manager-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.group-form { border-top: 1px solid var(--border); padding-top: 20px; }
.group-form p, .groups-manager-list > p { color: var(--muted); line-height: 1.5; font-size: 0.88rem; }
.group-name-field { display: grid; gap: 7px; margin: 14px 0; font-size: 0.9rem; font-weight: 700; }
.group-name-field input { width: 100%; min-width: 0; box-sizing: border-box; border: 1px solid var(--border); background: var(--input); color: var(--text); border-radius: 8px; padding: 11px; font: inherit; font-size: 16px; }
.group-members-list { max-height: 300px; overflow-y: auto; margin: 10px 0; }
.group-week-modal { width: min(1120px, 100%); max-width: 1120px; }
.groups-modal .modal-header > div, .group-week-modal .modal-header > div { min-width: 0; overflow-wrap: anywhere; }
.group-week-modal .modal-header p { max-width: none; }
.group-week-note { color: var(--muted); line-height: 1.5; font-size: 0.85rem; }
.group-week-legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.group-week-legend span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.75rem; }
.group-week-legend i { display: inline-block; width: 18px; height: 18px; border: 1px solid #789; border-radius: 4px; }
.group-day-heading { display: flex; align-items: center; justify-content: center; cursor: default; font-weight: 700; }
.group-week-grid .review-time-axis span { font-variant-numeric: tabular-nums; }
.group-week-grid .review-day-track { background: var(--input); }
.group-time-block { position: absolute; left: 2px; right: 2px; box-sizing: border-box; overflow: hidden; border: 1px solid rgba(30, 60, 110, 0.35); border-radius: 4px; font-family: inherit; font-size: 11px; line-height: 1.35; padding: 2px 4px; white-space: pre-line; text-align: left; cursor: pointer; }
.group-time-block:hover { outline: 2px solid var(--accent); z-index: 1; }
.group-time-block:focus-visible, .group-time-block[aria-pressed="true"] { outline: 3px solid var(--accent); outline-offset: -3px; z-index: 2; }
.group-slot-details { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 14px; overflow-wrap: anywhere; }
.group-slot-details h3 { font-size: 1rem; margin: 0 0 8px; }
.group-slot-details p { margin: 5px 0; line-height: 1.5; font-size: 0.85rem; }
.group-exact-period + .group-exact-period { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px; }
@media (max-width: 560px) {
  .people-heading-row { gap: 8px; }
  .people-actions .count-badge { font-size: 0.72rem; padding: 0 7px; }
  .group-manager-row { align-items: flex-start; flex-direction: column; }
  .people-group { padding: 8px; }
}

/* Clean surfaces. Keep the existing layout and every feature's UI hooks;
   fills and spacing provide hierarchy instead of outlined containers. */
body { background: var(--bg); }
h1, h2, h3, h4, strong { font-weight: 500; }
.app-shell { max-width: 1100px; padding-top: max(28px, env(safe-area-inset-top)); }
.app-header { align-items: center; gap: 16px; margin-bottom: 22px; }
.brand-copy h1 { font-size: clamp(1.6rem, 3vw, 2rem); font-weight: 500; letter-spacing: -.035em; }
.brand-copy > p { font-size: .86rem; line-height: 1.5; margin-top: 8px; }
.brand-dot, .creator-dot { display: none; }
.header-actions { display: flex; gap: 8px; }
.header-data-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.header-data-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.panel { background: var(--panel); border: 0; border-radius: var(--radius); box-shadow: none; }
.control-bar, .people-panel, .detail-panel { background: transparent; }
.control-bar {
  display: block;
  max-width: 400px;
  padding: 0;
  margin-bottom: 12px;
}
.time-selection-row {
  --time-control-height: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  align-items: center;
}
.time-selection-row select, .time-selection-row input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: var(--time-control-height);
  min-height: var(--time-control-height);
  max-height: var(--time-control-height);
  padding: 0 11px;
  margin: 0;
  line-height: normal;
}
/* Safari's native time value has its own box; center it inside the shared height. */
.time-selection-row input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
}
.time-selection-row input[type="time"]::-webkit-date-and-time-value {
  display: flex;
  align-items: center;
  height: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  text-align: left;
}
.time-selection-row input[type="time"]::-webkit-datetime-edit {
  padding: 0;
}
@media (max-width: 560px) {
  .time-selection-row { --time-control-height: 44px; }
  .time-selection-row select, .time-selection-row input { font-size: 16px; }
}
.live-control, .field-group { font-weight: 400; }
.primary-button, .secondary-button, .icon-button, .danger-button,
.modal-close, .mini-danger-button, .bell-button, .preference-icon-button,
.theme-mode-button, .color-theme-card { border: 0; border-radius: 7px; font-weight: 500; box-shadow: none; }
.primary-button, .secondary-button { min-height: 42px; padding-left: 13px; padding-right: 13px; }
.primary-button { background: var(--primary-fill); color: var(--primary-text); }
.primary-button:hover { background: var(--primary-hover); }
.secondary-button, .modal-close, .theme-mode-button, .color-theme-card,
.bell-button, .preference-icon-button { background: var(--button); }
.icon-button.active, .preference-icon-button.active,
.theme-mode-button.active, .theme-mode-button[aria-pressed="true"],
.color-theme-card.active, .color-theme-card[aria-pressed="true"],
.view-icon-button[aria-pressed="true"] { background: var(--accent-soft); color: var(--text); border: 0; box-shadow: none; }
select, input[type="time"], .nickname-input, .group-name-field input,
.review-class input, .review-class select, .review-name input,
.share-code-field textarea { border: 0; border-radius: 7px; background: var(--input); color: var(--text); font-weight: 400; }
input[type="text"] { padding: 10px 12px; }
select:focus, input[type="time"]:focus { box-shadow: none; }
button:focus-visible, select:focus-visible, input:focus-visible,
textarea:focus-visible, summary:focus-visible, .review-grid-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:disabled { cursor: not-allowed; }
.main-grid { gap: 24px; }
.people-heading-row { padding: 0; gap: 12px; }
.people-heading-row h2 { font-size: 1.2rem; font-weight: 500; }
.people-actions { gap: 8px; flex-wrap: wrap; }
.people-actions .live-control { font-size: .82rem; gap: 6px; min-height: 42px; }
.people-actions .view-icon-button { min-height: 42px; min-width: 42px; }
.people-actions .view-mode-button { width: auto; padding: 0 11px; }
.group-view-controls { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.people-actions #manageGroupsButton { min-height: 42px; padding: 0 11px; font-size: .82rem; }
#manageGroupsButton[hidden] { display: none; }
.count-badge { min-height: 0; padding: 0; background: transparent; color: var(--muted); font-weight: 400; }
.status-line { padding: 12px 0; font-size: .82rem; line-height: 1.5; }
.availability-summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 16px;
  row-gap: 2px;
  padding: 12px 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.5;
}
.availability-summary .status-line { padding: 0; margin: 0; }
.availability-summary .count-badge { font-size: inherit; line-height: inherit; white-space: nowrap; }
.people-list { padding: 0; scrollbar-gutter: auto; }
.person-card, .person-card.pinned { background: var(--card); border: 0; border-radius: 8px; padding: 16px; gap: 10px; margin: 9px 0; }
.person-card:hover { background: var(--hover); transform: none; }
.person-card.selected { background: var(--card-selected); border: 0; box-shadow: none; }
.person-card:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.person-status-dot { width: 7px; height: 7px; }
.person-name { font-weight: 500; line-height: 1.4; }
.person-detail { font-size: .8rem; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }
.person-availability { font-size: .8rem; color: var(--muted); }
.status-badge, .local-badge { background: transparent; padding: 0; border-radius: 0; font-weight: 500; }
.status-badge.free { background: transparent; color: var(--success-text); }
.status-badge.busy { background: transparent; color: var(--busy-text); }
.local-badge { color: var(--success-text); }
.detail-panel { padding-bottom: 0; }
.detail-header { padding: 0 0 12px; }
.detail-header h2 { font-size: 1.3rem; font-weight: 500; }
.detail-status-row { flex-wrap: wrap; line-height: 1.5; }
.detail-card { margin: 9px 0; padding: 16px; border: 0; border-radius: 8px; background: var(--card); }
.detail-label { color: var(--muted); font-weight: 500; letter-spacing: .035em; }
.detail-headline { font-weight: 500; }
.timeline-class { font-weight: 500; }
.timeline-marker-label { font-weight: 500; }
.people-group { padding: 0; margin: 16px 0 24px; border: 0; border-radius: 0; background: transparent; }
.people-group-header { padding: 0 0 6px; }
.people-group-header small { font-size: .8rem; }
.people-group-header p { color: var(--muted); }
.group-hide, .group-more { background: var(--button); }
.group-manager-row, .people-manager-row, .notification-person-row,
.people-preference-card, .people-preference-card.pinned,
.storage-status, .group-slot-details, .review-class { border: 0; border-radius: 8px; background: var(--card); box-shadow: none; }
.people-manager-name, .notification-person-name, .storage-status-value { font-weight: 500; }
.people-preference-card.pinned { background: var(--card-selected); }
.nickname-input { background: var(--input); }
.nickname-label, .group-name-field { font-weight: 400; }
.group-manager-actions { flex-shrink: 0; }
.modal-backdrop { background: rgba(12, 13, 16, .62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.schedule-modal, .settings-modal { padding: 24px; border-radius: 12px; background: var(--panel); box-shadow: 0 18px 50px rgba(0,0,0,.25); }
.modal-header h2 { font-weight: 500; }
.modal-header p { font-size: .86rem; line-height: 1.55; }
.modal-close { width: 42px; height: 42px; }
.schedule-action-section, .settings-section { border: 0; background: transparent; border-radius: 0; padding: 0; margin-top: 28px; }
.schedule-advanced-options { margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--border); }
.advanced-options-toggle { display: flex; align-items: center; justify-content: center; width: 44px; min-height: 44px; padding: 0; cursor: pointer; list-style: none; }
.advanced-options-toggle::-webkit-details-marker { display: none; }
.advanced-options-toggle::marker { content: ""; }
.advanced-options-toggle svg { width: 22px; height: 22px; fill: currentColor; }
.advanced-schedule-panel { margin-top: 14px; }
.schedule-advanced-options:not([open]) > .advanced-schedule-panel { display: none; }
.advanced-options-note { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.55; }
#scheduleModal [hidden] { display: none !important; }
.schedule-modal[data-schedule-flow] > .schedule-action-section { margin-top: 20px; }
.schedule-modal[data-schedule-flow] .share-code-panel { margin-top: 20px; padding-top: 0; }
.schedule-action-section h3, .settings-section h3 { font-size: 1rem; font-weight: 500; margin-bottom: 8px; }
.schedule-action-section > p, .settings-description { font-size: .86rem; line-height: 1.6; }
.section-kicker, .storage-status-label, .theme-template-label { color: var(--muted); font-weight: 500; letter-spacing: .03em; }
.modal-actions { flex-wrap: wrap; gap: 8px; }
.modal-actions > button { flex: 0 1 auto; }
.database-actions > button, .settings-inline-actions > button { width: auto; }
.wide-action { display: inline-flex; width: auto; max-width: 100%; margin: 4px 6px 4px 0; align-items: center; justify-content: center; padding-top: 10px; padding-bottom: 10px; }
.schedule-undo-row .status-line { padding: 0; }
.share-code-panel { border: 0; padding: 16px; border-radius: 8px; background: var(--card); }
.share-code-field textarea { background: var(--input); }
.theme-mode-group { display: flex; gap: 8px; }
.theme-mode-button { padding: 0 16px; }
.color-theme-card { background: var(--card); }
.theme-swatch { box-shadow: none; border-radius: 6px; }
.settings-note { background: var(--card); border: 0; border-radius: 8px; }
.notification-status { background: var(--card); border: 0; border-radius: 8px; }
.switch-track { border: 0; }
.review-grid-scroll { border: 0; border-radius: 0; }
.review-day { border-left: 1px solid var(--border); }
.review-day-heading { background: var(--panel); font-weight: 500; }
.review-grid-block { border: 0; background: var(--primary-fill); color: var(--primary-text); border-radius: 5px; padding: 5px; font-weight: 400; }
.review-break { background: var(--success-bg); color: var(--success-text); padding: 5px; font-weight: 500; }
.review-passing { background: var(--input); color: var(--muted); }
.review-grid-block:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.review-class .field-group { display: grid; grid-template-columns: 1fr; gap: 6px; }
.review-class legend { font-weight: 500; }
.review-semester-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.review-semester-fields select, .review-semester-fields input { width: 100%; min-width: 0; }
.semester-help, .schedule-semester { color: var(--muted); font-size: .86rem; line-height: 1.5; }
.schedule-semester { display: block; margin: 5px 0 0; }
.semester-older { color: var(--muted); }
.person-card.semester-expired { background: var(--input); opacity: .6; }
.person-card.semester-expired .person-status-dot { background: var(--muted); }
.group-week-legend i, .group-time-block { border: 0; }
.group-time-block:hover { outline: none; filter: brightness(.95); }
.group-time-block:focus-visible, .group-time-block[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: -2px; }
.group-exact-period + .group-exact-period, .group-form { border-top: 0; }
.creator-credit { color: var(--muted); font-size: .78rem; padding-top: 14px; }
.toast { border-radius: 8px; font-weight: 500; max-width: calc(100% - 24px); }

@media (max-width: 880px) {
  .main-grid { gap: 28px; min-height: 0; }
  .people-panel { min-height: 0; max-height: none; }
  .people-list { overflow: visible; }
  .detail-panel { min-height: 0; max-height: none; }
  .control-bar { gap: 10px; }
}
@media (max-width: 560px) {
  .app-shell { padding-left: 16px; padding-right: 16px; }
  .app-header { display: flex; flex-wrap: wrap; gap: 14px; }
  .brand-copy { flex: 1 1 100%; }
  .brand-copy h1 { font-size: 1.65rem; }
  .header-actions { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
  .header-data-button { width: auto; min-height: 44px; font-size: .82rem; }
  .people-heading-row { display: flex; flex-wrap: wrap; gap: 10px; }
  .people-actions { width: auto; margin-left: auto; justify-content: flex-end; }
  .people-actions .count-badge { font-size: .75rem; padding: 0; }
  .person-card { padding: 14px; }
  .person-detail, .person-availability { font-size: .8rem; }
  .status-badge { font-size: .75rem; }
  .detail-header { padding-left: 0; padding-right: 0; }
  .detail-card { margin-left: 0; margin-right: 0; }
  .people-group { padding: 0; }
  .modal-backdrop { padding: 8px; }
  .schedule-modal, .settings-modal { padding: 18px; border-radius: 10px; }
  .schedule-action-section, .settings-section { padding: 0; }
  .group-manager-row { flex-direction: column; align-items: flex-start; }
  .database-actions > button, .settings-inline-actions > button { width: auto; }
  .control-bar .field-group { display: grid; grid-template-columns: 38px minmax(0,1fr); }
  .control-bar .field-group select, .control-bar .field-group input { font-size: 16px; }
}
@media (max-width: 350px) {
  .people-heading-row h2 { flex-basis: 100%; }
  .people-actions { margin-left: 0; width: 100%; justify-content: flex-start; }
  .people-actions .count-badge { margin-left: auto; }
  .header-data-button { padding-left: 10px; padding-right: 10px; }
  .header-data-button svg { width: 15px; height: 15px; }
}

@media (max-width: 680px) {
  .people-heading-row { flex-wrap: wrap; }
  .people-heading-row h2 { flex-basis: 100%; }
  .people-actions { width: 100%; margin-left: 0; justify-content: flex-start; }
  .people-actions .count-badge { margin-left: auto; }
}

.review-semester-fields:has(#useCurrentSemesterButton:not([hidden])) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; }

/* Touch scrolling stays native; a stationary hold arms card reordering. */
.person-card {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.person-dragging { opacity: .55; }
.person-dragging { cursor: grabbing; }
.person-card.reorder-before { box-shadow: 0 -3px 0 var(--accent); }
.person-card.reorder-after { box-shadow: 0 3px 0 var(--accent); }
.people-group-actions .group-hide { width: auto; min-width: 54px; min-height: 38px; padding: 0 10px; font-size: .82rem; }
.group-options { position: relative; }
.group-options .group-more { display: flex; align-items: center; justify-content: center; min-height: 38px; cursor: pointer; list-style: none; }
.group-options .group-more::-webkit-details-marker { display: none; }
.group-options-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 10;
  display: grid;
  gap: 4px;
  min-width: 200px;
  padding: 6px;
  border-radius: 7px;
  background: var(--card);
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.group-options:not([open]) .group-options-panel { display: none; }
.group-options-panel button { text-align: left; font-size: .82rem; }
/* Reserve the dropdown's footprint inside the scrollable people panel.
   A z-index alone cannot escape the panel's overflow clipping. */
.people-group:has(.group-options[open]) .people-group-header { padding-bottom: 110px; }
.people-group.group-collapsed { margin-bottom: 16px; }
@media (max-width: 600px) {
  .review-semester-fields:has(#useCurrentSemesterButton:not([hidden])) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #useCurrentSemesterButton { grid-column: 1 / -1; }
}

/* Native disclosures keep settings compact. */
.settings-modal .settings-disclosure {
  margin-top: 0;
  border-bottom: 1px solid var(--border);
}
.settings-disclosure > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 16px 0;
  cursor: pointer;
  list-style: none;
}
.settings-disclosure > summary::-webkit-details-marker,
.nickname-disclosure > summary::-webkit-details-marker { display: none; }
.settings-disclosure > summary h3 { margin: 0; font-size: 1rem; font-weight: 500; }
.settings-disclosure > summary .count-badge { margin-left: auto; }
.settings-disclosure > summary::after,
.nickname-disclosure > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  margin-left: auto;
  margin-right: 3px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
}
.settings-disclosure > summary:has(.count-badge)::after { margin-left: 2px; }
.settings-disclosure[open] > summary::after,
.nickname-disclosure[open] > summary::after { transform: rotate(225deg); }
.settings-disclosure > summary:focus-visible,
.nickname-disclosure > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.settings-summary-note { display: block; margin-top: 4px; color: var(--muted); font-size: .75rem; }
.settings-disclosure-body { padding-bottom: 20px; }
.settings-disclosure-body > .settings-description:first-child { margin-top: 0; }
.settings-disclosure:not([open]) > .settings-disclosure-body { display: none; }
.nickname-disclosure { margin-top: 6px; }
.nickname-disclosure > summary {
  display: flex;
  align-items: center;
  min-height: 36px;
  color: var(--muted);
  font-size: .78rem;
  cursor: pointer;
  list-style: none;
}
.nickname-disclosure .nickname-row { grid-template-columns: minmax(0, 1fr); margin-top: 4px; }
.nickname-disclosure:not([open]) > .nickname-row { display: none; }

.appearance-settings-section .theme-mode-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  margin-top: 0;
  border-radius: 10px;
  background: var(--input);
}
.appearance-settings-section .theme-mode-button {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  box-shadow: none;
}
.appearance-settings-section .theme-mode-button[aria-pressed="true"] {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
.appearance-settings-section .color-theme-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.appearance-settings-section .color-theme-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--card);
}
.appearance-settings-section .color-theme-card strong { font-size: .8rem; font-weight: 500; }
.appearance-settings-section .color-theme-card[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.appearance-settings-section .theme-swatch {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}
.appearance-settings-section .theme-swatch.blue { background: #85858d; }
.appearance-settings-section .theme-swatch.violet { background: #a77bff; }
.appearance-settings-section .theme-swatch.rose { background: #ff7196; }
.appearance-settings-section .theme-swatch.mint { background: #40d99a; }
.appearance-settings-section .theme-swatch.orange { background: #ff9f43; }

.settings-credit { margin: 20px 0 0; padding-top: 0; text-align: center; line-height: 1.5; font-weight: 400; }

.detail-name-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.detail-name-row h2 { min-width: 0; overflow-wrap: anywhere; }
.full-schedule-button { flex-shrink: 0; min-height: 44px; padding: 0 12px; font-size: .8rem; }
.person-week-modal { width: min(1050px, 100%); }
.person-week-grid { grid-template-columns: 54px repeat(7, minmax(140px, 1fr)); min-width: 1034px; }
.person-week-block { cursor: default; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.3; }
.person-week-modal .review-grid-scroll { overscroll-behavior: auto; touch-action: pan-x pinch-zoom; -webkit-overflow-scrolling: touch; }
.person-week-modal .modal-header h2 { overflow-wrap: anywhere; }
.person-week-modal .parser-status { margin-bottom: 0; }
