:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --text: #1f2937;
  --text-secondary: #5b6472;
  --muted: #8a94a3;
  --line: #dbe3ec;
  --line-light: #eef3f8;

  --primary: #ff6b5f;
  --primary-dark: #e85145;
  --primary-light: #fff1ef;
  --primary-muted: #ff9b91;
  --accent: #2db8a1;
  --accent-light: #e3f7f3;
  --sunny: #ffd166;

  --success: #16856f;
  --success-bg: #dff7f0;
  --warning: #8a6500;
  --warning-bg: #fff4ce;
  --danger: #c2413a;
  --danger-bg: #ffe9e7;
  --group: #6d28d9;
  --group-bg: #f0e8ff;
  --group-border: #d8b4fe;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-xs: 0 1px 3px rgb(0 0 0 / 0.06);
  --shadow-sm: 0 2px 6px rgb(0 0 0 / 0.08), 0 1px 2px rgb(0 0 0 / 0.05);
  --shadow-md: 0 8px 24px rgb(0 0 0 / 0.1), 0 2px 6px rgb(0 0 0 / 0.06);
  --shadow-modal: 0 32px 80px rgb(31 41 55 / 0.22), 0 12px 32px rgb(31 41 55 / 0.12);
}

[hidden] {
  display: none !important;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', 'Segoe UI', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ── Workspace shell ─────────────────────── */

.workspace-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w, 260px) minmax(0, 1fr);
  background: #f6f8fb;
  transition: grid-template-columns 0.22s ease;
}

.workspace-shell.sidebar-collapsed {
  --sidebar-w: 64px;
}

.workspace-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  background: #fff;
  border-right: 1px solid var(--line);
  box-shadow: 1px 0 8px rgb(31 41 55 / 0.04);
  overflow: hidden;
  transition: padding 0.22s ease;
}

.workspace-shell.sidebar-collapsed .workspace-sidebar {
  padding: 24px 10px;
  align-items: center;
}

.workspace-shell.sidebar-collapsed .side-nav-item {
  grid-template-columns: 34px;
  padding: 11px;
  justify-content: center;
}

.workspace-shell.sidebar-collapsed .side-nav-item span:last-child,
.workspace-shell.sidebar-collapsed .sidebar-footer .section-tag,
.workspace-shell.sidebar-collapsed .sidebar-footer .badge,
.workspace-shell.sidebar-collapsed .workspace-brand span {
  display: none;
}

.workspace-shell.sidebar-collapsed .side-nav {
  width: 100%;
}

.hamburger-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
}

.hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.2s ease;
}

.hamburger-btn:hover span {
  background: var(--text);
}

.workspace-brand {
  padding: 0 6px 10px;
}

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

.side-nav-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid transparent;
}

.side-nav-item:hover {
  background: #f9fbfd;
  color: var(--text);
}

.side-nav-item.active {
  background: var(--primary-light);
  color: var(--text);
  border-color: #ffd3cf;
}

.side-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent);
  font-size: 17px;
  font-weight: 800;
}

.side-nav-item strong {
  display: block;
  font-size: 14px;
  line-height: 1.25;
}

.side-nav-item small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.25;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius);
  background: #f9fbfd;
  border: 1px solid var(--line);
}

.workspace-main {
  min-width: 0;
  padding: 20px 32px 56px;
}

.workspace-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--text-secondary);
  white-space: nowrap;
}

.header-user-name {
  max-width: 108px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
}

.header-user-role {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--line-light);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}

.workspace-title {
  margin: 0;
  font-size: 23px;
  line-height: 1.15;
  font-weight: 800;
}

.workspace-subtitle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 7px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.35;
}

.workspace-subtitle strong {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
}

.workspace-subtitle span {
  color: var(--text);
  font-weight: 800;
}

.workspace-subtitle small {
  color: var(--text-secondary);
  font-size: 13px;
}

.topbar-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

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

.dashboard-main,
.dashboard-side {
  display: grid;
  gap: 18px;
}

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

.ops-metric-card {
  display: grid;
  gap: 5px;
  min-height: 116px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-xs);
  color: var(--text);
  text-decoration: none;
}

.ops-metric-card:hover {
  border-color: #cfdbe8;
  box-shadow: var(--shadow-sm);
}

.ops-metric-card span {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.ops-metric-card strong {
  font-size: 36px;
  line-height: 1;
  font-weight: 900;
}

.ops-metric-card small {
  color: var(--muted);
  font-size: 12px;
}

.ops-metric-card.urgent {
  border-color: #ffd3cf;
  background: var(--primary-light);
}

.ops-metric-card.open {
  border-color: #bfeadf;
  background: var(--accent-light);
}

.ops-metric-card.danger {
  border-color: #ffc6c0;
  background: var(--danger-bg);
}

.attention-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid #ffe2a8;
  border-radius: var(--radius);
  background: #fff8df;
}

.attention-panel h2 {
  margin: 4px 0;
  font-size: 18px;
  line-height: 1.25;
}

.attention-panel p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

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

.metric-card,
.calendar-panel,
.side-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.metric-card {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
}

.metric-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 700;
}

.metric-card strong {
  font-size: 30px;
  line-height: 1;
}

.metric-card small {
  color: var(--muted);
  font-size: 12px;
}

.calendar-panel,
.side-panel {
  padding: 20px;
}

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

.panel-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.panel-desc {
  margin: 3px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.week-calendar {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.week-day {
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.week-day.today {
  border-color: var(--primary-muted);
  box-shadow: 0 0 0 2px rgb(255 107 95 / 0.12);
}

.week-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 11px;
  background: #f8fbfd;
  border-bottom: 1px solid var(--line);
}

.week-day-head span {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-secondary);
}

.week-day-head strong {
  font-size: 13px;
}

.week-day-body {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 10px;
  max-height: 320px;
  overflow-y: auto;
}

.calendar-event {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 5px;
  border: 1px solid transparent;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
}

.calendar-event span {
  font-weight: 800;
  flex-shrink: 0;
}

.calendar-event strong {
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-event-action {
  flex: 0 0 auto;
  height: 22px;
  margin-left: auto;
  padding: 0 7px;
  border: 1px solid rgb(20 136 99 / 0.25);
  border-radius: 6px;
  background: #fff;
  color: #1a7a45;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.calendar-event.approved {
  background: #e6f7ee;
  color: #1a7a45;
  border-color: #a3d9b8;
}

.calendar-event.open {
  background: #f2f2f2;
  color: #888;
  border-color: #ddd;
}

.calendar-event.pending {
  background: #fffbe6;
  color: #946c00;
  border-color: #ffe58f;
}

.calendar-event.group {
  background: var(--group-bg);
  color: var(--group);
  border-color: var(--group-border);
}

.calendar-empty {
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
}

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

.agenda-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.agenda-item strong,
.agenda-item small {
  display: block;
}

.agenda-item small {
  color: var(--muted);
  font-size: 12px;
}

.compact-table .data-table {
  min-width: 760px;
}

.compact-form {
  gap: 12px;
}

.settings-drawer {
  margin-top: 22px;
}

/* ── Availability calendar ───────────────── */

.availability-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

@media (max-width: 1050px) {
  .availability-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .availability-form-panel {
    position: static;
  }
}

.availability-form-panel {
  position: sticky;
  top: 24px;
  padding: 14px;
}

.availability-form-panel .form-stack {
  gap: 8px;
}

.availability-form-panel .panel-title {
  font-size: 16px;
  line-height: 1.15;
}

.availability-form-panel .panel-desc {
  font-size: 12px;
  line-height: 1.35;
}

.availability-form-panel .field {
  gap: 4px;
}

.availability-form-panel .field-input,
.availability-form-panel .field-select {
  height: 36px;
  padding: 0 10px;
  font-size: 13px;
}

.slot-kind-section,
.slot-time-section {
  margin-top: 9px;
}

.slot-kind-hint {
  margin: 0 0 8px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

.group-fields {
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid #d9d0ff;
  border-radius: var(--radius-sm);
  background: #faf8ff;
}

.availability-form-panel .slot-kind-tabs {
  margin-bottom: 6px;
}

.availability-form-panel .slot-kind-tab {
  padding: 6px 0;
  font-size: 12px;
}

.availability-form-panel .period-preset-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.availability-form-panel .period-check-choice {
  min-height: 38px;
  gap: 4px;
  padding: 4px 6px;
}

.availability-form-panel .period-check-text strong {
  font-size: 11px;
}

.availability-form-panel .period-check-text span {
  font-size: 9px;
}

.availability-form-panel .draft-slot-box {
  margin-top: 8px;
  padding: 7px 8px;
}

.availability-form-panel .draft-slot-list {
  gap: 4px;
  min-height: 28px;
}

.availability-form-panel .slot-empty {
  padding: 4px 0;
}

.availability-form-panel .draft-slot-item {
  padding: 5px 7px;
  font-size: 12px;
}

.availability-form-panel .draft-slot-header {
  margin-bottom: 4px;
}

.availability-form-panel .slot-save-button {
  margin-top: 8px;
  min-height: 38px;
}

.slot-date-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.slot-date-fields .field,
.slot-date-fields .field-input {
  min-width: 0;
}

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

.availability-form-panel .manual-slot-entry-wide {
  grid-template-columns: 1fr;
}

.weekday-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.weekday-picker label {
  cursor: pointer;
}

.weekday-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.weekday-picker span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-secondary);
}

.weekday-picker input:checked + span {
  background: var(--primary-light);
  border-color: #ffd3cf;
  color: var(--primary-dark);
}

.repeat-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.repeat-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.slot-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.period-picker {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe5ef;
  border-radius: var(--radius-sm);
  background: #f8fbff;
}

.manual-schedule-stack {
  display: grid;
  gap: 18px;
}

.manual-date-field {
  width: min(360px, calc(100% - 48px));
  margin-top: 8px;
  margin-left: 24px;
  margin-right: 24px;
  gap: 8px;
}

.manual-period-picker {
  gap: 12px;
  padding: 16px;
}

.manual-open-slots {
  display: grid;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid #dbe5ef;
  border-radius: var(--radius-sm);
  background: #fbfdff;
}

.manual-open-slots.has-conflict {
  border-color: #ffb4ac;
  background: #fff8f7;
}

.manual-open-slot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
  align-items: center;
}

.manual-open-slot-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid #d7e3ef;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.manual-open-slot-chip strong {
  color: #1d6fb8;
}

.manual-open-slot-chip span {
  color: var(--muted);
  font-size: 12px;
}

.manual-open-slot-chip.conflict {
  border-color: #ff8d82;
  background: #fff0ee;
  color: var(--danger);
}

.manual-open-slot-chip.conflict strong,
.manual-open-slot-chip.conflict span {
  color: var(--danger);
}

.manual-open-slot-chip.pre-registerable {
  cursor: pointer;
  font: inherit;
  border-color: #71b69a;
  background: #effaf5;
}

.manual-open-slot-chip.pre-registerable:hover {
  border-color: #27825f;
  background: #e1f6ed;
}

.manual-open-slot-chip.pre-registerable strong,
.manual-open-slot-chip.pre-registerable span {
  color: #176b4c;
}

.manual-open-slot-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.manual-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 22px;
}

.manual-section-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.manual-section-help,
.manual-selected-time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-align: right;
}

.manual-selected-time {
  color: #1d6fb8;
}

.manual-time-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #dbe5ef;
  border-radius: var(--radius-sm);
  background: #fbfdff;
}

.manual-time-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.slot-kind-box {
  gap: 12px;
}

.slot-time-tabs {
  gap: 14px;
}

.slot-time-tab-list {
  width: 100%;
}

.slot-time-tab-panel {
  display: grid;
  gap: 10px;
}

.slot-time-tab-panel[hidden] {
  display: none;
}

.manual-slot-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.manual-slot-entry-wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.manual-slot-entry-wide .btn {
  grid-column: 1 / -1;
  width: 100%;
  height: 44px;
}

.manual-slot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.manual-slot-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 8px 0 12px;
  border: 1px solid #b9dcff;
  border-radius: 999px;
  background: #eaf5ff;
  color: #1d6fb8;
  font-size: 13px;
  font-weight: 900;
}

.manual-slot-chip button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #3d6f99;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 4px;
}

.draft-slot-box {
  margin-top: 2px;
  padding: 12px;
  border: 1px solid #d9e5f1;
  border-radius: var(--radius-sm);
  background: #fff;
}

.draft-slot-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.draft-slot-count {
  flex: 0 0 auto;
  min-width: 42px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eaf5ff;
  color: #1d6fb8;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.draft-slot-list {
  display: grid;
  gap: 8px;
  min-height: 36px;
}

.draft-slot-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.draft-slot-item strong,
.draft-slot-item span {
  display: block;
}

.draft-slot-item strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.draft-slot-item span {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.draft-slot-meta {
  color: #1d6fb8 !important;
  white-space: nowrap;
}

.draft-slot-item button {
  border: 0;
  border-radius: 999px;
  background: #eef4fb;
  color: #496579;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  padding: 6px 9px;
}

.compact-time-picker {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: none;
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
}

.period-picker-desc {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
}

.period-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.compact-period-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.period-preset-button {
  min-height: 50px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.period-preset-button strong,
.period-preset-button span {
  display: block;
}

.period-preset-button strong {
  font-size: 13px;
  font-weight: 900;
}

.period-preset-button span {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
}

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

.period-check-choice {
  position: relative;
  display: block;
}

.period-check-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.period-check-text {
  display: block;
}

.period-preset-button:hover,
.period-preset-button.active {
  border-color: #b9dcff;
  background: #eaf5ff;
}

.period-preset-button.active strong,
.period-preset-button.active span {
  color: #1d6fb8;
}

.period-auto-generator {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fbff;
}

.period-auto-grid {
  display: grid;
  grid-template-columns: 1.1fr repeat(3, 0.78fr) auto;
  gap: 8px;
  align-items: end;
}

.period-auto-grid .field {
  gap: 4px;
}

.period-auto-grid .field-input {
  height: 38px;
  min-height: 38px;
  padding: 7px 10px;
}

.period-settings-grid {
  display: grid;
  gap: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fbff;
  overflow: hidden;
}

.period-settings-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 126px 126px;
  gap: 6px;
  align-items: center;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #e6edf5;
  border-radius: 0;
  background: #fff;
}

.period-settings-row:last-child {
  border-bottom: 0;
}

.period-settings-row .field {
  gap: 3px;
  padding: 5px 6px;
}

.period-settings-row .field-label {
  font-size: 10px;
  line-height: 1;
  color: var(--muted);
}

.period-settings-row:not(:first-child) .field-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.period-settings-row .field-input {
  height: 32px;
  min-height: 32px;
  padding: 0 10px;
  border-width: 1px;
  border-radius: 7px;
  font-size: 13px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}

.time-slot-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.time-slot-choice {
  cursor: pointer;
}

.time-slot-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.time-slot-choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.time-slot-choice input:checked + span {
  background: #e0f0ff;
  border-color: #b9dcff;
  color: #1d6fb8;
}

.time-slot-choice.disabled {
  cursor: not-allowed;
}

.time-slot-choice.disabled span {
  background: var(--line-light);
  color: var(--muted);
  border-color: var(--line);
  text-decoration: line-through;
}

.service-type-box {
  display: grid;
  gap: 10px;
}

.slot-save-box {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid #dbe5ef;
  border-radius: var(--radius);
  background: #fbfdff;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.75);
}

.slot-save-hint {
  margin: -2px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.slot-save-button {
  width: 100%;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.segmented-control label {
  cursor: pointer;
}

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

.segmented-control span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 800;
}

.segmented-control input:checked + span {
  border-color: #b9dcff;
  background: #e0f0ff;
  color: #1d6fb8;
}

.service-tabs span {
  min-height: 48px;
  font-size: 15px;
}

.group-capacity-field.is-hidden,
.group-only-field.is-hidden {
  display: none;
}

.availability-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text);
}

.google-sync-card {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.google-sync-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.google-sync-actions form {
  margin: 0;
}

.google-sync-card form {
  margin: 0;
}

.availability-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-pill {
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 800;
  line-height: 1.2;
}

.legend-pill.open {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #dbe3eb;
}

.legend-pill.pending {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid #f3d17b;
}

.legend-pill.approved {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #a7dfc5;
}

.legend-pill.group {
  background: var(--group-bg);
  color: var(--group);
  border: 1px solid var(--group-border);
}

.settings-update-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-update-actions form {
  margin: 0;
}

.availability-calendar-panel {
  min-width: 0;
  padding: 24px;
}

.availability-calendar-header {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 190px;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.availability-calendar-kicker {
  grid-column: 1;
  align-self: center;
  display: flex;
  align-items: center;
  line-height: 1.2;
}

.availability-calendar-kicker span {
  color: var(--text);
  font-size: 24px;
  font-weight: 900;
  white-space: nowrap;
}

.availability-month-heading {
  grid-column: 2;
  text-align: center;
}

.availability-month-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.month-calendar-title {
  min-width: 52px;
  margin: 0 7px;
  font-size: 24px;
  line-height: 1.2;
  white-space: nowrap;
}

.month-calendar-actions {
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: nowrap;
}

.month-nav-button {
  width: auto;
  padding: 0 12px;
  font-size: 13px;
}

.availability-calendar-header .btn {
  height: 32px;
}

.month-calendar-head {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 6px;
}

.month-calendar-head span {
  padding: 0 4px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.availability-calendar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding-bottom: 4px;
}

.availability-day {
  min-width: 0;
  min-height: 146px;
  max-height: 280px;
  overflow-y: auto;
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  gap: 5px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.availability-day:hover {
  border-color: #c9d4df;
  background: #f9fcff;
}

.availability-day.today {
  border-color: var(--primary-muted);
  box-shadow: 0 0 0 2px rgb(255 107 95 / 0.12);
}

.availability-day.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgb(255 107 95 / 0.16);
}

.availability-day.past {
  opacity: 0.58;
}

.availability-day.outside-month {
  background: #f6f8fa;
  color: #98a2ad;
}

.availability-day-number {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.availability-day-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.availability-slots {
  display: grid;
  gap: 4px;
  align-content: start;
  margin-top: 2px;
}

.slot-chip,
.slot-more,
.slot-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-height: 32px;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.slot-chip > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-actions {
  display: flex;
  gap: 4px;
  margin-top: 0;
  margin-left: auto;
  flex-shrink: 0;
}

.slot-actions form {
  margin: 0;
}

.slot-actions button {
  height: 22px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.slot-actions form:first-child button {
  background: var(--success-bg);
  color: var(--success);
  border-color: #a7dfc5;
}

.slot-actions form:last-child button {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #f5a9a1;
}

.slot-actions .slot-delete-form button,
.slot-actions .slot-delete-form:first-child button {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #f5a9a1;
}

.slot-chip.open {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #dbe3eb;
}

.slot-chip.pending {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid #f3d17b;
}

.slot-chip.group {
  background: var(--group-bg);
  color: var(--group);
  border: 1px solid var(--group-border);
}

.slot-chip.group.full {
  background: #edf2f7;
  color: #64748b;
  border-color: #dbe3eb;
}

.slot-chip.approved {
  background: var(--success-bg);
  color: var(--success);
}

.slot-chip.consultation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #a7dfc5;
}

.slot-chip-action {
  flex: 0 0 auto;
  height: 24px;
  padding: 0 8px;
  border: 1px solid rgb(20 136 99 / 0.25);
  border-radius: 6px;
  background: #fff;
  color: var(--success);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.slot-chip-action:hover {
  background: #f6fffb;
}

.slot-more {
  background: var(--line-light);
  color: var(--text-secondary);
}

.slot-empty {
  display: block;
  color: var(--muted);
  font-weight: 600;
  background: transparent;
  padding-left: 0;
}

/* ── Public request flow ─────────────────── */

.public-shell {
  min-height: 100vh;
  background: #f6f8fb;
}

.public-page {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.request-embedded-page {
  width: 100%;
  margin: 0;
  padding: 0 0 56px;
}

.public-header {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.public-title {
  margin: 0 0 4px;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 800;
}

.public-desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.55;
}

.privacy-notice {
  display: grid;
  gap: 3px;
  margin: 0 0 18px;
  padding: 13px 16px;
  border: 1px solid #dbe7f1;
  border-radius: 12px;
  background: #f5f9fd;
  color: #52657a;
  font-size: 14px;
  line-height: 1.45;
}

.privacy-notice strong {
  font-size: 14px;
  color: var(--text);
}

.request-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  /* 날짜와 시간 선택은 하나의 단계이므로 같은 높이로 정렬합니다. */
  align-items: stretch;
}

.request-calendar-panel,
.request-form-panel {
  min-width: 0;
}

.request-time-panel {
  /* 날짜와 시간을 고른 뒤 신청 정보 입력으로 자연스럽게 이어집니다. */
  position: static;
}

.request-form-panel {
  grid-column: 1 / -1;
}

.request-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-light);
}

.request-section-heading h2 {
  margin: 0 0 5px;
  font-size: 19px;
  line-height: 1.35;
}

.request-section-heading p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.request-applicant-row {
  display: grid;
  grid-template-columns: minmax(230px, 340px) minmax(0, 1fr);
  align-items: end;
  gap: 16px 22px;
}

.request-applicant-hint {
  min-height: 48px;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0 14px;
  border-left: 3px solid #dce7f1;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.field-required {
  margin-left: 3px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.request-date-card,
.request-time-button {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.request-date-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}

.request-date-card {
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px;
  text-align: left;
}

.request-date-card:hover {
  border-color: #c9d4df;
  background: #f9fcff;
}

.request-date-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgb(255 107 95 / 0.14);
}

.request-date-card strong { font-size: 17px; }
.request-date-card span { color: var(--text-secondary); font-size: 13px; font-weight: 700; }

.request-time-button:hover {
  border-color: #c9d4df;
  background: #f9fcff;
}

.request-time-button.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgb(255 107 95 / 0.14);
}

.booking-calendar { min-width: 0; }

.booking-calendar-toolbar {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  margin-bottom: 14px;
  text-align: center;
}

.booking-calendar-toolbar strong { font-size: 17px; }

.calendar-nav {
  width: 32px;
  height: 32px;
  justify-self: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text-secondary);
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.calendar-nav:hover { border-color: #c9d4df; background: #f9fcff; color: var(--text); }

.booking-calendar-weekdays,
.request-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }

.booking-calendar-weekdays { margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; }
.booking-calendar-weekdays span:first-child { color: #e26262; }
.booking-calendar-weekdays span:last-child { color: #4f7fc7; }

.request-calendar-grid { gap: 6px; }
.request-calendar-blank { min-height: 58px; }

.request-calendar-day {
  min-height: 58px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding: 5px 2px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
}

.request-calendar-day strong { font-size: 15px; line-height: 1; }
.request-calendar-day span { color: var(--primary); font-size: 10px; font-weight: 700; }
.request-calendar-day.available { background: #fff7f5; border-color: #fee1dc; color: var(--text); cursor: pointer; }
.request-calendar-day.available:hover { border-color: var(--primary-muted); background: #fff0ed; }
.request-calendar-day.selected { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgb(255 107 95 / 0.2); }
.request-calendar-day.selected span { color: #fff; }
.request-calendar-day:disabled { cursor: default; }

.request-time-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.request-timetable { display: grid; gap: 8px; }

.request-period-button {
  min-height: 58px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) minmax(86px, auto);
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--muted);
  font: inherit;
  text-align: left;
}

.request-period-button.available { border-color: #fed7d1; background: #fff8f6; color: var(--text); cursor: pointer; }
.request-period-button.available:hover { border-color: var(--primary-muted); background: #fff0ed; }
.request-period-button.full { color: var(--muted); }
.request-period-button.selected { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 3px rgb(255 107 95 / 0.14); }
.request-period-button.group.available { border-color: var(--group-border); background: #faf7ff; color: var(--text); }
.request-period-button.group.available:hover { border-color: var(--group); background: var(--group-bg); }
.request-period-button.group.selected { border-color: var(--group); background: var(--group-bg); box-shadow: 0 0 0 3px rgb(109 40 217 / 0.14); }
.period-label { font-weight: 800; }
.period-time { color: var(--text-secondary); font-size: 13px; }
.period-status { justify-self: end; color: var(--muted); font-size: 12px; font-weight: 700; text-align: right; }
.request-period-button.available .period-status { color: var(--primary); }
.request-period-button.group.available .period-status { color: var(--group); }

.custom-time-title { margin: 18px 0 8px; color: var(--text-secondary); font-size: 13px; font-weight: 800; }

.request-time-button {
  min-height: 42px;
  padding: 9px 12px;
  font-size: 15px;
  font-weight: 800;
}

.request-time-button.group { border-color: var(--group-border); background: #faf7ff; color: var(--group); }
.request-time-button.group:hover { border-color: var(--group); background: var(--group-bg); }
.request-time-button.group.selected { border-color: var(--group); background: var(--group-bg); box-shadow: 0 0 0 3px rgb(109 40 217 / 0.14); }

.request-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line-light);
}

.request-submit-error {
  display: grid;
  gap: 3px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  background: #fff5f5;
  color: #b42318;
  font-size: 14px;
  line-height: 1.45;
}

.request-submit-error strong { font-weight: 800; }
.request-submit-error span { color: #7a271a; }

.request-submit-row p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
}

.request-empty {
  grid-column: 1 / -1;
  padding: 36px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

/* ── Site header ─────────────────────────── */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255 255 255 / 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 4px rgb(31 41 55 / 0.06);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.brand-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--primary), #ff8e84);
  color: #fff;
  box-shadow: 0 2px 8px rgb(255 107 95 / 0.28);
  overflow: hidden;
}

.brand-icon::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 10px;
  width: 18px;
  height: 22px;
  border-radius: 4px;
  background: #fff;
  box-shadow: inset 0 -4px 0 rgb(255 209 102 / 0.72);
}

.brand-icon::after {
  content: '';
  position: absolute;
  right: 7px;
  top: 6px;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent);
}

.brand-icon span {
  position: absolute;
  left: 15px;
  top: 16px;
  width: 10px;
  height: 8px;
  border: 2px solid var(--primary);
  border-radius: 7px 7px 7px 2px;
  background: transparent;
}

.brand-name {
  display: block;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.brand-name span { color: var(--primary); }

.brand-subtitle {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

/* ── Page layout ─────────────────────────── */

.page {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  padding: 36px 0 72px;
}

.page.narrow {
  width: min(800px, calc(100% - 48px));
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.page-title {
  font-size: 30px;
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: -0.7px;
}

.page-desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ── Buttons ─────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 46px;
  padding: 0 22px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  letter-spacing: -0.2px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 4px rgb(255 107 95 / 0.28), inset 0 1px 0 rgb(255 255 255 / 0.18);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 14px rgb(255 107 95 / 0.3), inset 0 1px 0 rgb(255 255 255 / 0.18);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--panel);
  border-color: var(--line);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  border-color: #c9d4df;
  background: #f9fcff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--line-light);
  color: var(--text);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
  border-color: transparent;
  font-size: 14px;
  font-weight: 600;
  height: 38px;
  padding: 0 14px;
}

.btn-danger-ghost:hover {
  background: var(--danger-bg);
  border-color: #f5a9a1;
}

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

.btn-danger-text:hover {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: #f5a9a1;
}

.btn-sm {
  height: 38px;
  padding: 0 16px;
  font-size: 14px;
}

.btn:disabled,
button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none !important;
  box-shadow: none !important;
}

.btn.is-processing::before,
button.is-processing::before {
  content: "";
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Cards ───────────────────────────────── */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 28px 20px;
  border-bottom: 1px solid var(--line);
}

.card-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.card-desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.card-body {
  padding: 24px 28px;
}

/* ── Hero banner ─────────────────────────── */

.hero-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  margin-bottom: 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(130deg, #fff1ef 0%, #e3f7f3 100%);
  border: 1px solid #d5eee9;
  box-shadow: 0 2px 10px rgb(45 184 161 / 0.08);
}

.hero-left {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-title {
  margin: 0 0 2px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text);
}

.hero-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 22px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgb(255 107 95 / 0.28);
  transition: all 0.15s;
  flex-shrink: 0;
}

.hero-cta:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgb(255 107 95 / 0.32);
}

/* ── Toast ───────────────────────────────── */

.toast-container {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.toast::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast-success {
  background: #fff;
  color: var(--success);
  border: 1px solid #a7dfc5;
}

.toast-success::before { background: var(--success); }

.toast-error {
  background: #fff;
  color: var(--danger);
  border: 1px solid #f5a9a1;
}

.toast-error::before { background: var(--danger); }

.toast-hide {
  opacity: 0;
  transform: translateY(-8px);
}

.processing-overlay {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 1200;
  transform: translateX(-50%);
  pointer-events: none;
}

.processing-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: min(420px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid #b8d6f4;
  border-radius: 14px;
  background: #f7fbff;
  color: var(--text);
  box-shadow: 0 14px 32px rgb(18 65 105 / 0.18);
}

.processing-card strong,
.processing-card span {
  display: block;
}

.processing-card strong {
  font-size: 14px;
  font-weight: 900;
}

.processing-card span {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.processing-spinner {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 3px solid #d8ecff;
  border-top-color: #1d6fb8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.update-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(15 23 42 / 0.48);
  backdrop-filter: blur(1px);
}

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

.update-modal-card {
  width: min(500px, 100%);
  padding: 30px;
  border: 1px solid rgb(226 232 240 / 0.95);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgb(15 23 42 / 0.24), 0 8px 22px rgb(15 23 42 / 0.12);
}

.update-modal-card h2 {
  margin: 6px 0 12px;
  font-size: 26px;
  letter-spacing: -0.03em;
  color: var(--text);
}

.update-modal-desc,
.update-modal-notes {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.55;
}

.update-modal-notes {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 14px;
  line-height: 1.55;
}

.update-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

.update-modal-actions form {
  margin: 0;
}

.update-later-button {
  background: transparent;
  box-shadow: none;
}

.online-request-backdrop {
  position: fixed;
  inset: 0;
  z-index: 980;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(15 23 42 / 0.34);
  backdrop-filter: blur(2px);
}

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

.online-request-card {
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 18px;
  padding: 28px;
  border: 1px solid rgb(255 211 207 / 0.95);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgb(255 241 239 / 0.95), transparent 38%),
    #ffffff;
  box-shadow: var(--shadow-modal);
  animation: toast-in 0.22s ease both;
}

.online-request-icon {
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), #ff8a7f);
  box-shadow: 0 14px 28px rgb(255 107 95 / 0.28);
}

.online-request-icon span {
  position: relative;
  width: 28px;
  height: 28px;
  border: 4px solid #ffffff;
  border-radius: 9px;
}

.online-request-icon span::before {
  content: "";
  position: absolute;
  right: -9px;
  top: -9px;
  width: 13px;
  height: 13px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--accent);
}

.online-request-copy h2 {
  margin: 5px 0 8px;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.online-request-copy p:last-child {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

.online-request-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

/* ── Section groups ──────────────────────── */

.section-group {
  margin-bottom: 20px;
}

.section-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.section-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

/* ── Setting card (로그인·발송시간 공통) ──── */

.settings-page {
  width: min(840px, 100%);
  display: grid;
  gap: 16px;
}

.settings-card {
  padding: 24px 28px;
}

.settings-card .setting-inline {
  padding: 0;
}

.settings-login-form {
  display: grid;
  gap: 16px;
}

.settings-login-controls {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 220px) auto auto;
  align-items: end;
  gap: 12px;
}

.browser-login-box {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fbfe;
}

.browser-login-box form {
  flex: 0 0 auto;
  margin: 0;
}

.api-approval-link {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.api-approval-link a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.setting-inline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 20px 28px;
}

.setting-info {
  min-width: 0;
}

.cred-title {
  margin: 0 0 3px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.cred-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.setting-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 12px;
  min-width: 0;
  justify-content: start;
}

.setting-controls-end {
  margin-left: auto;
}

.field-compact {
  height: 40px !important;
  font-size: 14px !important;
}

/* ── Flash messages ──────────────────────── */

.flash-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
}

.flash::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.flash.success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #a7dfc5;
}

.flash.success::before { background: var(--success); }

.flash.error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #f5a9a1;
}

.flash.error::before { background: var(--danger); }

/* ── Filter bar ──────────────────────────── */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
  flex-wrap: wrap;
}

.filter-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.filter-input {
  height: 40px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 15px;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #f9fcff;
}

.filter-input:focus {
  outline: none;
  border-color: var(--primary-muted);
  box-shadow: 0 0 0 3px rgb(255 107 95 / 0.12);
  background: #fff;
}

.filter-spacer { margin-left: auto; }

/* ── Table ───────────────────────────────── */

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.list-page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 2px 2px 14px;
}

.list-page-intro .section-label {
  margin-bottom: 5px;
  color: var(--primary-dark);
}

.list-page-intro h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.35px;
}

.list-page-intro p:not(.section-label) {
  max-width: 620px;
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.list-page-guide {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--line-light);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.list-table-wrap .data-table thead th {
  padding-top: 13px;
  padding-bottom: 13px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  table-layout: fixed;
}

/* 열 너비 고정 */
.data-table col.col-date    { width: 112px; }
.data-table col.col-time    { width: 82px; }
.data-table col.col-id      { width: 88px; }
.data-table col.col-name    { width: 110px; }
.data-table col.col-status  { width: auto; }
.data-table col.col-action  { width: 178px; }

.data-table thead th {
  background: #f8fbfd;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  padding: 14px 12px;
  border-bottom: 2px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.data-table tbody td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line-light);
  font-size: 15px;
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #f9fcff; }
.data-table tbody tr.highlight td { background: #fff6f5; }
.data-table tbody tr.highlight:hover td { background: #ffebe8; }

.cell-date {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  letter-spacing: -0.2px;
}

.cell-time {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #ffd3cf;
  white-space: nowrap;
}

.cell-id {
  font-size: 13px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  color: var(--text-secondary);
  background: var(--line-light);
  padding: 3px 7px;
  border-radius: 4px;
  display: inline-block;
  letter-spacing: 0.5px;
}

.cell-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.cell-memo {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow: hidden;
  max-width: 0;         /* table-layout:fixed 에서 남은 공간 차지 */
}

.cell-status { vertical-align: middle; }

.cell-status .badge {
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
}

.notified-at {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 400;
}

.notification-note {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-actions {
  text-align: right;
}

.row-action-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.row-sms-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

.row-action-buttons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.row-action-buttons form {
  margin: 0;
}

.row-action-btn {
  min-width: 66px;
  height: 36px;
  padding: 0 12px;
  justify-content: center;
}

.move-slot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.move-slot-option {
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}

.move-slot-option:hover {
  border-color: #b8d8f7;
  background: #f4f9ff;
}

.move-slot-option.selected {
  border-color: #7cc4ff;
  background: var(--primary-light);
  color: var(--primary-dark);
}

.move-slot-empty {
  width: 100%;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #f8fbfd;
  color: var(--muted);
  font-size: 14px;
}

.empty-row td {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  white-space: normal;
}

/* ── Badges ──────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

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

.badge-success::before { background: var(--success); }

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-warning::before {
  background: var(--warning);
  animation: pulse 2s infinite;
}

.badge-saved {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-saved::before { background: var(--primary); }

.badge-needed {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-needed::before { background: var(--warning); }

.badge-scheduled {
  background: #e0f0ff;
  color: #1d6fb8;
}

.badge-scheduled::before { background: #1d6fb8; }

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-danger::before { background: var(--danger); }

.badge-info {
  background: #e0f0ff;
  color: #0066cc;
}
.badge-info::before { background: #0066cc; }

.badge-group {
  background: var(--group-bg);
  color: var(--group);
}
.badge-group::before { background: var(--group); }

.badge-neutral {
  background: var(--surface-2, #f0f0f0);
  color: var(--text-secondary, #666);
}
.badge-neutral::before { background: var(--text-secondary, #666); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ── Form fields ─────────────────────────── */

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

label.field {
  display: grid;
  gap: 8px;
}

.field-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.1px;
}

.field-hint {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 6px;
}

.field-status {
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
}

.field-status-ok {
  background: var(--success-bg);
  color: var(--success);
}

.field-status-empty {
  background: var(--warning-bg);
  color: var(--warning);
}

.field-input,
.field-select,
.field-textarea {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.field-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a8917e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.field-textarea {
  height: auto;
  padding: 14px;
  resize: vertical;
  line-height: 1.65;
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  outline: none;
  border-color: var(--primary-muted);
  box-shadow: 0 0 0 3px rgb(255 107 95 / 0.12);
  background: #fffcfa;
}

.field-input::placeholder,
.field-textarea::placeholder { color: var(--muted); }

/* ── Fieldset (학번 영역) ─────────────────── */

.fieldset-card {
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  margin: 0;
  background: #f9fcff;
}

.fieldset-legend {
  padding: 0 8px;
  margin-left: 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.4px;
  text-transform: none;
}

.fieldset-body {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 16px 20px 16px;
}

.fieldset-name-row {
  display: flex;
  gap: 16px;
  padding: 0 20px 20px;
  border-top: 1px dashed var(--line);
  padding-top: 16px;
  margin-top: 2px;
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Message editor ──────────────────────── */

.message-section {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 4px;
}

.section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.base-message-box {
  margin: 0 0 16px;
  padding: 16px 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fbfd;
  font: inherit;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

/* ── Form actions ────────────────────────── */

.form-actions {
  display: flex;
  gap: 10px;
  padding-top: 4px;
}

.form-actions.end { justify-content: flex-end; }

/* ── Modal ───────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(31 41 55 / 0.46);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fade-in 0.18s ease;
}

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

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

.modal {
  width: min(700px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  overflow: auto;
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow-modal);
  animation: slide-up 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 32px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #fff6f5 0%, #e8f8f5 100%);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-title {
  margin: 0 0 5px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.modal-desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.modal-close-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-close-btn:hover {
  background: var(--danger-bg);
  border-color: #f5a9a1;
  color: var(--danger);
}

.modal-body { padding: 28px 32px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 32px 26px;
  border-top: 1px solid var(--line);
  background: #f9fbfd;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ── Settings blocks ─────────────────────── */

.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-block {
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.settings-block-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--line-light);
  background: #f9fbfd;
}

.settings-block-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.settings-block-hint {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}

.settings-block-body { padding: 18px 20px; }

.range-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.range-row {
  display: grid;
  grid-template-columns: 60px 1fr auto 1fr 44px;
  align-items: end;
  gap: 10px;
}

.range-row-label {
  align-self: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.range-row label.field { gap: 5px; }

.range-row .field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.range-row .field-input {
  height: 42px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

.range-sep {
  align-self: center;
  font-size: 15px;
  color: var(--muted);
}

.range-unit {
  align-self: center;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
}

.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

.time-grid .field-input,
.time-grid .field-select {
  height: 42px;
  font-size: 15px;
  font-weight: 700;
}

/* ── Responsive ──────────────────────────── */

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

  .period-auto-grid .btn {
    grid-column: 1 / -1;
    width: 100%;
  }

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

  .manual-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .manual-section-help,
  .manual-selected-time {
    text-align: left;
  }

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

  .manual-time-controls {
    grid-template-columns: 1fr;
  }

  .compact-time-picker {
    grid-template-columns: 1fr;
  }

  .manual-slot-entry {
    grid-template-columns: 1fr;
  }

  .workspace-shell {
    display: block;
  }

  .workspace-sidebar {
    position: static;
    height: auto;
    padding: 16px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .side-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .side-nav-item {
    min-width: 180px;
  }

  .sidebar-footer {
    display: none;
  }

  .workspace-main {
    padding: 20px 16px 48px;
  }

  .workspace-topbar,
  .panel-header {
    flex-direction: column;
  }

  .workspace-topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }

  .header-user {
    text-align: left;
  }

  .header-user-role {
    display: none;
  }

  .topbar-filter {
    width: 100%;
    flex-wrap: wrap;
  }

  .dashboard-grid,
  .metric-row,
  .availability-layout,
  .request-layout {
    grid-template-columns: 1fr;
  }

  .week-calendar {
    grid-template-columns: repeat(5, 164px);
  }

  .availability-form-panel {
    position: static;
  }

  .availability-form-panel .period-preset-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .list-page-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .month-calendar-head,
  .availability-calendar {
    grid-template-columns: repeat(5, 148px);
  }

  .request-time-panel {
    position: static;
  }

  .workspace-shell:has(.request-embedded-page) {
    background: #ffffff;
  }

  .workspace-shell:has(.request-embedded-page) .workspace-sidebar,
  .workspace-shell:has(.request-embedded-page) .workspace-topbar {
    display: none;
  }

  .workspace-shell:has(.request-embedded-page) .workspace-main {
    padding: 0 0 calc(28px + env(safe-area-inset-bottom));
  }

  .request-embedded-page {
    width: 100%;
    padding-bottom: 0;
  }

  .request-embedded-page .public-header {
    margin: 0;
    padding: 22px 18px 16px;
    background: #ffffff;
    border-bottom: 1px solid var(--line-light);
  }

  .request-embedded-page .public-title {
    font-size: 24px;
    line-height: 1.2;
  }

  .request-embedded-page .public-desc {
    font-size: 15px;
    line-height: 1.55;
  }

  .request-layout {
    display: block;
  }

  .request-layout .calendar-panel,
  .request-form-panel {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 18px;
    background: #ffffff;
  }

  .request-layout .calendar-panel + .calendar-panel,
  .request-form-panel {
    border-top: 10px solid #f4f7fa;
  }

  .request-layout .panel-header {
    align-items: flex-start;
    gap: 3px;
    margin-bottom: 12px;
  }

  .request-layout .panel-title {
    font-size: 18px;
    line-height: 1.25;
  }

  .request-layout .panel-desc {
    font-size: 14px;
    line-height: 1.45;
  }

  .request-date-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin: 0 -18px;
    padding: 1px 18px 8px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .request-calendar-grid {
    margin: 0;
    padding: 0;
    display: grid;
    gap: 5px;
    overflow: visible;
  }

  .request-calendar-day,
  .request-calendar-blank {
    min-height: 52px;
  }

  .request-date-card {
    min-width: 112px;
    min-height: 64px;
    align-content: center;
    justify-items: center;
    text-align: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: #f8fafc;
    scroll-snap-align: start;
  }

  .request-date-card strong {
    font-size: 16px;
  }

  .request-date-card span {
    font-size: 12px;
  }

  .request-time-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .request-time-button {
    flex: 1 1 calc(50% - 8px);
    min-width: 128px;
    min-height: 50px;
    border-radius: 999px;
    background: #f8fafc;
    font-size: 16px;
  }

  .request-period-button {
    grid-template-columns: 58px minmax(0, 1fr);
    min-height: 60px;
  }

  .period-status {
    grid-column: 2;
    justify-self: start;
    font-size: 12px;
    text-align: left;
  }

  .request-form-panel {
    padding-bottom: 18px;
  }

  .request-form-panel .card-body {
    padding: 0;
  }

  .request-form-panel .form-stack {
    gap: 16px;
  }

  .request-section-heading {
    margin-bottom: 16px;
    padding-bottom: 14px;
  }

  .request-section-heading h2 {
    font-size: 18px;
  }

  .request-applicant-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .request-applicant-hint {
    min-height: 0;
    padding: 7px 11px;
    border-left-width: 2px;
    font-size: 13px;
  }

  .request-form-panel .field-label {
    font-size: 13px;
  }

  .request-form-panel .field-input,
  .request-form-panel .field-select {
    height: 50px;
    border-radius: 12px;
    background-color: #fbfdff;
  }

  .request-form-panel .field-textarea {
    min-height: 108px;
    border-radius: 12px;
    background-color: #fbfdff;
  }

  .request-form-panel .fieldset-card {
    padding: 14px;
    border-radius: 14px;
    background: #f8fafc;
  }

  .request-form-panel .fieldset-legend {
    padding: 0 8px;
  }

  .request-form-panel .fieldset-body {
    gap: 12px;
  }

  .request-form-panel .fieldset-name-row {
    padding-top: 14px;
  }

  .request-submit-row {
    flex-direction: column;
    align-items: stretch;
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--line-light);
  }

  .request-submit-row .btn {
    width: 100%;
    min-height: 50px;
    font-size: 16px;
    border-radius: 12px;
  }

  .week-day {
    min-height: 190px;
  }

  .setting-inline {
    grid-template-columns: 1fr;
  }

  .setting-controls {
    grid-template-columns: 1fr;
    align-items: stretch;
    justify-content: flex-start;
  }

  .settings-login-controls {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .settings-card {
    padding: 20px;
  }

  .site-header-inner { width: calc(100% - 32px); }

  .page, .page.narrow {
    width: calc(100% - 32px);
    padding: 24px 0 56px;
  }

  .page-title { font-size: 24px; }

  .page-header {
    flex-direction: column;
    gap: 14px;
  }

  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; justify-content: center; }

  .credential-grid { grid-template-columns: 1fr; }
  .fieldset-body { grid-template-columns: 1fr; }
  .grid-two { grid-template-columns: 1fr; }

  .range-row {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }

  .range-row-label { grid-column: 1 / -1; }
  .range-sep, .range-unit { display: none; }
  .time-grid { grid-template-columns: 1fr; }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    max-height: 92vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    animation: slide-from-bottom 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes slide-from-bottom {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .modal-header {
    padding: 22px 20px 18px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }

  .modal-body { padding: 20px; }
  .modal-footer { padding: 16px 20px 22px; border-radius: 0; }

  .filter-bar { flex-wrap: wrap; }
  .data-table { font-size: 14px; }
}

@media (max-width: 420px) {
  .workspace-shell:has(.request-embedded-page) .workspace-main {
    padding-left: 10px;
    padding-right: 10px;
  }

  .request-layout .calendar-panel,
  .request-form-panel {
    padding: 14px;
  }

  .request-date-card {
    min-width: 104px;
  }

  .request-time-grid {
    grid-template-columns: 1fr;
  }

  .request-time-button {
    flex-basis: 100%;
  }

  .fieldset-card {
    padding: 14px;
  }
}

/* 헤더 사용자 영역 — 클릭해서 표시 이름 변경 */
.header-user[data-editable] { cursor: pointer; border-radius: var(--radius-sm); padding: 4px 8px; margin: -4px -8px; transition: background .15s; }
.header-user[data-editable]:hover,
.header-user[data-editable]:focus-visible { background: var(--line-light); }
.header-user-name.header-user-unset { color: var(--text-secondary); font-weight: 500; text-decoration: underline dotted; text-underline-offset: 3px; }

/* 공개 고지 문서와 모든 서비스 화면에서 공통으로 사용하는 하단 안내 */
.legal-footer { border-top:1px solid var(--line); background:var(--panel); color:var(--text-secondary); padding:24px 20px 28px; font-size:12px; line-height:1.7; }
.legal-footer-inner { width:min(1280px,100%); margin:0 auto; display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.legal-footer-links { display:flex; gap:14px; flex-wrap:wrap; }
.legal-footer a { color:var(--text-secondary); text-decoration:none; }
.legal-footer a:hover, .legal-footer a:focus-visible { color:var(--primary); text-decoration:underline; }
.legal-footer .legal-footer-operator { color:var(--text); }
.legal-page { min-height:100vh; background:var(--bg); }
.legal-page-main { width:min(840px,calc(100% - 32px)); margin:0 auto; padding:52px 0 72px; }
.legal-page-card { background:var(--panel); border:1px solid var(--line); border-radius:var(--radius-lg); box-shadow:var(--shadow-sm); padding:38px; }
.legal-page-eyebrow { color:var(--primary); font-size:13px; font-weight:800; margin:0 0 8px; }
.legal-page-title { margin:0; font-size:30px; letter-spacing:-.7px; }
.legal-page-date { margin:10px 0 32px; color:var(--text-secondary); font-size:13px; }
.legal-page-section { margin-top:30px; }
.legal-page-section h2 { font-size:18px; margin:0 0 11px; letter-spacing:-.3px; }
.legal-page-section p, .legal-page-section li { color:var(--text-secondary); font-size:14px; line-height:1.75; }
.legal-page-section p { margin:0; }
.legal-page-section ul { margin:8px 0 0; padding-left:20px; }
.legal-page-table { width:100%; border-collapse:collapse; margin-top:10px; font-size:13px; }
.legal-page-table th, .legal-page-table td { border:1px solid var(--line); padding:11px 12px; text-align:left; vertical-align:top; line-height:1.6; }
.legal-page-table th { background:var(--bg); color:var(--text); font-weight:800; width:28%; }
.legal-page-note { margin-top:28px; padding:14px 16px; border:1px solid #f7d79a; background:#fff8e8; border-radius:12px; color:#80530a; font-size:13px; line-height:1.65; }
@media (max-width:640px) { .legal-page-main { padding:28px 0 44px; }.legal-page-card { padding:26px 20px; }.legal-page-title { font-size:25px; }.legal-page-table th { width:34%; }.legal-footer-inner { align-items:flex-start; flex-direction:column; gap:8px; } }
