:root {
  /* SEED primitive tokens */
  --seed-scale-color-gray-00: #ffffff;
  --seed-scale-color-gray-100: #f7f8f9;
  --seed-scale-color-gray-200: #f3f4f5;
  --seed-scale-color-gray-300: #eeeff1;
  --seed-scale-color-gray-400: #dcdee3;
  --seed-scale-color-gray-700: #868b94;
  --seed-scale-color-gray-800: #555d6d;
  --seed-scale-color-gray-900: #2a3038;
  --seed-scale-color-gray-1000: #1a1c20;
  --seed-scale-color-carrot-100: #fff2ec;
  --seed-scale-color-carrot-200: #ffe8db;
  --seed-scale-color-carrot-300: #ffd5c0;
  --seed-scale-color-carrot-600: #ff6600;
  --seed-scale-color-carrot-700: #e14d00;
  --seed-dimension-x1: 4px;
  --seed-dimension-x2: 8px;
  --seed-dimension-x3: 12px;
  --seed-dimension-x4: 16px;
  --seed-radius-r2: 8px;
  --seed-radius-r3: 12px;
  --seed-duration-color: 150ms;

  /* SEED semantic tokens */
  --seed-color-fg-neutral: var(--seed-scale-color-gray-1000);
  --seed-color-fg-neutral-muted: var(--seed-scale-color-gray-800);
  --seed-color-fg-neutral-subtle: var(--seed-scale-color-gray-700);
  --seed-color-fg-brand: var(--seed-scale-color-carrot-700);
  --seed-color-bg-layer-basement: var(--seed-scale-color-gray-100);
  --seed-color-bg-layer-default: var(--seed-scale-color-gray-00);
  --seed-color-bg-layer-fill: var(--seed-scale-color-gray-200);
  --seed-color-bg-brand-solid: var(--seed-scale-color-carrot-600);
  --seed-color-bg-brand-weak: var(--seed-scale-color-carrot-100);
  --seed-color-stroke-neutral-weak: var(--seed-scale-color-gray-300);
  --seed-color-stroke-neutral-subtle: var(--seed-scale-color-gray-400);
  --seed-color-stroke-focus-ring: var(--seed-scale-color-carrot-300);

  /* Component tokens */
  --app-header-height: 52px;
  --calendar-day-header-height: 44px;
  --calendar-hour-height: clamp(36px, calc((100dvh - 178px) / 14), 48px);
  --calendar-grid-height: calc(var(--calendar-hour-height) * 14);
  --control-height: 36px;

  /* Backward-compatible aliases for the existing components */
  --ink: var(--seed-color-fg-neutral);
  --ink-muted: var(--seed-color-fg-neutral-muted);
  --canvas: var(--seed-color-bg-layer-basement);
  --surface: var(--seed-color-bg-layer-default);
  --line: var(--seed-color-stroke-neutral-weak);
  --line-strong: var(--seed-color-stroke-neutral-subtle);
  --brand: var(--seed-color-bg-brand-solid);
  --brand-deep: var(--seed-color-fg-brand);
  --brand-soft: var(--seed-color-bg-brand-weak);
  --danger: #b44b42;
  --danger-soft: #faeeec;
  --shadow: 0 16px 40px rgba(26, 28, 32, 0.14);
  --team-1: #206b57;
  --team-1-soft: #dcefe8;
  --team-2: #9b6222;
  --team-2-soft: #faecd9;
  --team-3: #6160a8;
  --team-3-soft: #e9e7f8;
  --team-4: #39708a;
  --team-4-soft: #e0edf2;
  --team-all: #ab4860;
  --team-all-soft: #f7e2e8;
  color: var(--ink);
  font-family: Pretendard, "Apple SD Gothic Neo", Inter, system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
}

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

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--seed-color-stroke-focus-ring);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
}

.app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--app-header-height);
  padding: 6px clamp(14px, 2vw, 24px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(26, 28, 32, 0.02);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: var(--surface);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  line-height: 1.1;
}

.brand small {
  display: none;
}

.header-actions,
.toolbar-actions,
.date-navigation,
.arrow-group,
.footer-actions {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 8px;
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 174px;
  min-height: 40px;
  padding: 4px 8px 4px 4px;
  border: 1px solid var(--line);
  border-radius: var(--seed-radius-r2);
  background: var(--seed-color-bg-layer-fill);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.profile-button:hover {
  background: var(--seed-scale-color-gray-300);
}

.profile-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 800;
}

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

.profile-copy strong,
.profile-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy strong {
  font-size: 13px;
}

.profile-copy small {
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 11px;
}

.main-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 272px;
  gap: 16px;
  max-width: 1680px;
  margin: 0 auto;
  padding: 12px clamp(14px, 2vw, 24px);
}

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

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  gap: 12px;
  margin-bottom: 10px;
}

.date-navigation {
  gap: 8px;
}

.arrow-group {
  gap: 4px;
}

.calendar-toolbar h1 {
  margin: 0;
  font-size: clamp(18px, 1.7vw, 22px);
  letter-spacing: -0.04em;
}

.calendar-toolbar p {
  margin: 1px 0 0;
  color: var(--ink-muted);
  font-size: 11px;
}

.toolbar-actions {
  gap: 8px;
}

.button,
.icon-button {
  min-height: var(--control-height);
  border: 1px solid transparent;
  border-radius: var(--seed-radius-r2);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  transition: 150ms ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  font-size: 13px;
}

.icon-button {
  min-width: var(--control-height);
  padding: 0 8px;
}

.app-header .icon-button {
  border-color: var(--line);
  color: var(--ink-muted);
  font-size: 12px;
}

.app-header .icon-button:hover {
  background: var(--seed-color-bg-layer-fill);
  color: var(--ink);
}

.button-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: none;
}

.button-primary:hover {
  background: var(--brand-deep);
  transform: translateY(-1px);
}

.button-secondary,
.date-navigation > .icon-button,
.arrow-group .icon-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button-secondary:hover,
.date-navigation > .icon-button:hover,
.arrow-group .icon-button:hover {
  border-color: var(--line-strong);
  background: var(--seed-color-bg-layer-fill);
}

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

.button-danger-ghost:hover {
  background: var(--danger-soft);
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 38px);
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.segmented-control button {
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.segmented-control button.is-active {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.calendar-card {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: var(--seed-radius-r3);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(26, 28, 32, 0.04);
}

.calendar-view {
  min-width: 760px;
}

.time-calendar {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
}

.calendar-corner,
.day-headers {
  position: sticky;
  z-index: 14;
  top: 0;
  height: var(--calendar-day-header-height);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.calendar-corner {
  left: 0;
  border-right: 1px solid var(--line);
}

.day-headers {
  display: grid;
}

.day-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-right: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 700;
}

.day-header:last-child {
  border-right: 0;
}

.day-header strong {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  color: var(--ink);
  font-size: 15px;
}

.day-header.is-today strong {
  background: var(--brand);
  color: #fff;
}

.time-labels {
  position: relative;
  z-index: 3;
  height: var(--calendar-grid-height);
  border-right: 1px solid var(--line);
  background: var(--seed-color-bg-layer-basement);
}

.time-label {
  position: absolute;
  top: calc(var(--time-index) * var(--calendar-hour-height));
  right: 8px;
  color: var(--seed-color-fg-neutral-subtle);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-align: right;
  transform: translateY(-50%);
}

.time-label.is-first {
  transform: translateY(4px);
}

.time-label.is-last {
  transform: translateY(calc(-100% - 3px));
}

.days-grid {
  position: relative;
  display: grid;
}

.day-column {
  position: relative;
  height: var(--calendar-grid-height);
  min-height: 0;
  border-right: 1px solid var(--line);
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--calendar-hour-height) / 2 - 1px),
    var(--seed-color-stroke-neutral-weak) calc(var(--calendar-hour-height) / 2 - 1px),
    var(--seed-color-stroke-neutral-weak) calc(var(--calendar-hour-height) / 2),
    transparent calc(var(--calendar-hour-height) / 2),
    transparent calc(var(--calendar-hour-height) - 1px),
    var(--seed-color-stroke-neutral-subtle) calc(var(--calendar-hour-height) - 1px),
    var(--seed-color-stroke-neutral-subtle) var(--calendar-hour-height)
  );
}

.day-column:last-child {
  border-right: 0;
}

.day-column:hover {
  background-color: color-mix(in srgb, var(--brand-soft) 24%, transparent);
}

.day-column.is-today {
  background-color: color-mix(in srgb, var(--brand-soft) 42%, transparent);
}

.day-column.is-drop-target {
  background-color: color-mix(in srgb, var(--brand-soft) 76%, transparent);
  box-shadow: inset 0 0 0 2px var(--brand);
}

.day-column.is-conflict-target {
  background-color: color-mix(in srgb, var(--danger-soft) 82%, transparent);
  box-shadow: inset 0 0 0 2px var(--danger);
}

.booking-block {
  position: absolute;
  z-index: 6;
  right: 3px;
  left: 3px;
  min-height: 0;
  overflow: hidden;
  padding: 3px 6px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 14%, transparent);
}

.booking-block:hover {
  z-index: 8;
  filter: saturate(1.05);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, currentColor 24%, transparent),
    0 3px 10px rgba(26, 28, 32, 0.12);
}

.booking-block.is-draggable {
  cursor: grab;
  touch-action: none;
}

.booking-block.is-draggable::after {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 3px;
  height: 14px;
  border-radius: 3px;
  background: currentColor;
  box-shadow: 5px 0 0 currentColor;
  content: "";
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 140ms ease;
}

.booking-block.is-draggable:hover::after,
.booking-block.is-draggable:focus::after {
  opacity: 0.25;
}

.booking-block.is-dragging {
  z-index: 24;
  cursor: grabbing;
  overflow: visible;
  opacity: 0.96;
  box-shadow: 0 12px 24px rgba(20, 40, 34, 0.2);
  transition: none;
}

.booking-block.is-conflicting {
  background: var(--danger-soft);
  color: var(--danger);
  box-shadow: inset 0 0 0 2px var(--danger);
}

.resize-handle {
  position: absolute;
  z-index: 4;
  right: 0;
  left: 0;
  height: 11px;
  cursor: ns-resize;
  opacity: 0;
  touch-action: none;
  transition: opacity 140ms ease;
}

.resize-handle::before {
  position: absolute;
  top: 50%;
  right: 10px;
  left: 10px;
  height: 1px;
  background: currentColor;
  content: "";
  opacity: 0.48;
}

.resize-handle::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.78);
  content: "";
  transform: translate(-50%, -50%);
}

.resize-handle-top {
  top: 0;
}

.resize-handle-bottom {
  bottom: 0;
}

.booking-block.is-draggable:hover .resize-handle,
.booking-block.is-draggable:focus .resize-handle,
.booking-block.is-resizing .resize-handle {
  opacity: 1;
}

.booking-block.is-resizing {
  z-index: 24;
  cursor: ns-resize;
  overflow: visible;
  opacity: 0.96;
  box-shadow: 0 12px 24px rgba(20, 40, 34, 0.2);
  transition: none;
}

.drag-time-preview {
  position: absolute;
  top: -28px;
  left: 0;
  display: none;
  width: max-content;
  max-width: 220px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(26, 28, 32, 0.13);
  white-space: nowrap;
}

.booking-block.is-conflicting .drag-time-preview {
  border-color: var(--danger);
  color: var(--danger);
}

.booking-block.is-dragging .drag-time-preview,
.booking-block.is-resizing .drag-time-preview {
  display: block;
}

.booking-block strong,
.booking-block .booking-instructor,
.booking-block .booking-time {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.booking-block strong {
  font-size: 11px;
  line-height: 13px;
}

.booking-block .booking-instructor,
.booking-block .booking-time {
  font-size: 11px;
  line-height: 13px;
}

.booking-block .booking-instructor {
  opacity: 0.78;
}

.booking-block .booking-time {
  opacity: 0.62;
}

.booking-block.is-short {
  padding: 1px 5px;
}

.booking-block.is-short .booking-instructor,
.booking-block.is-short::after {
  display: none;
}

.booking-block.is-short strong,
.booking-block.is-short .booking-time {
  font-size: 10px;
  line-height: 11px;
}

.team-1 {
  background: var(--team-1-soft);
  color: var(--team-1);
}

.team-2 {
  background: var(--team-2-soft);
  color: var(--team-2);
}

.team-3 {
  background: var(--team-3-soft);
  color: var(--team-3);
}

.team-4 {
  background: var(--team-4-soft);
  color: var(--team-4);
}

.team-all {
  background: var(--team-all-soft);
  color: var(--team-all);
}

.month-calendar {
  min-width: 820px;
}

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

.month-weekdays {
  position: sticky;
  z-index: 12;
  top: 0;
  background: #fff;
}

.month-weekdays span {
  padding: 15px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.month-day {
  min-height: 130px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.month-day.is-outside {
  background: #fafbf9;
  color: #a9b0ad;
}

.month-day-number {
  display: grid;
  width: 28px;
  height: 28px;
  margin: 0 0 5px auto;
  place-items: center;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
}

.month-day.is-today .month-day-number {
  background: var(--brand);
  color: #fff;
}

.month-event {
  display: block;
  width: 100%;
  margin-top: 4px;
  overflow: hidden;
  padding: 4px 6px;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.more-events {
  display: block;
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 700;
}

.upcoming-sidebar {
  position: sticky;
  top: 64px;
  align-self: start;
  min-height: 460px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--seed-radius-r3);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(26, 28, 32, 0.04);
}

.upcoming-fab {
  position: fixed;
  z-index: 50;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: none;
  align-items: center;
  min-height: 48px;
  gap: 8px;
  padding: 0 10px 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: var(--surface);
  box-shadow: 0 8px 24px rgba(225, 77, 0, 0.24);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background var(--seed-duration-color) ease;
}

.upcoming-fab:hover {
  background: var(--brand-deep);
  box-shadow: 0 10px 28px rgba(225, 77, 0, 0.3);
  transform: translateY(-2px);
}

.upcoming-fab-count {
  display: grid;
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  place-items: center;
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand-deep);
  font-size: 11px;
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--brand);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.sidebar-heading h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.03em;
}

.count-badge {
  display: grid;
  min-width: 27px;
  height: 27px;
  padding: 0 7px;
  place-items: center;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 11px;
  font-weight: 800;
}

.now-card {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  background: var(--brand-deep);
  color: #fff;
}

.now-card .eyebrow {
  color: #89d4bd;
}

.now-card strong {
  display: block;
  font-size: 13px;
}

.now-card p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
}

.upcoming-list {
  max-height: calc(100vh - 390px);
  overflow: auto;
  margin: 4px -8px 0;
  padding: 0 8px;
}

.upcoming-item {
  display: grid;
  grid-template-columns: 43px 1fr;
  gap: 11px;
  width: 100%;
  padding: 13px 0;
  border: 0;
  border-bottom: 1px solid #edf0ee;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.upcoming-date {
  display: grid;
  align-content: center;
  height: 43px;
  border-radius: 10px;
  background: #f1f4f1;
  text-align: center;
}

.upcoming-date strong,
.upcoming-date small {
  display: block;
}

.upcoming-date strong {
  font-size: 15px;
}

.upcoming-date small {
  color: var(--ink-muted);
  font-size: 9px;
}

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

.upcoming-copy > span {
  display: inline-flex;
  margin-bottom: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 900;
}

.upcoming-copy strong,
.upcoming-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upcoming-copy strong {
  font-size: 12px;
}

.upcoming-copy small {
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 10px;
}

.modal.upcoming-modal {
  display: flex;
  width: min(500px, calc(100vw - 28px));
  max-height: min(680px, calc(100dvh - 32px));
  overflow: hidden;
  flex-direction: column;
}

.modal-header.upcoming-modal-header {
  align-items: center;
  padding: 18px 20px 14px;
}

.upcoming-modal-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.upcoming-modal-body {
  min-height: 0;
  overflow-y: auto;
  padding: 0 20px 18px;
  overscroll-behavior: contain;
}

.upcoming-modal-description {
  margin: 0 -20px 4px;
  padding: 12px 20px;
  background: var(--seed-color-bg-layer-fill);
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.45;
}

.upcoming-modal-now {
  display: block;
  width: 100%;
  margin: 12px 0 4px;
  padding: 13px 14px;
  border: 0;
  border-radius: var(--seed-radius-r3);
  background: var(--brand-deep);
  color: var(--surface);
  cursor: pointer;
  text-align: left;
}

.upcoming-modal-now .eyebrow {
  margin-bottom: 4px;
  color: var(--seed-scale-color-carrot-200);
}

.upcoming-modal-now strong,
.upcoming-modal-now > span:last-child {
  display: block;
}

.upcoming-modal-now strong {
  font-size: 13px;
}

.upcoming-modal-now > span:last-child {
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.78;
}

.upcoming-modal-list {
  max-height: none;
  margin: 0;
  overflow: visible;
  padding: 0;
}

.upcoming-modal-list .upcoming-copy > span {
  font-size: 10px;
}

.upcoming-modal-list .upcoming-copy small {
  font-size: 11px;
}

.empty-list {
  padding: 38px 10px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.room-rule-card {
  display: flex;
  gap: 9px;
  margin-top: 16px;
  padding: 12px;
  border-radius: 11px;
  background: #f4f7f4;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: #42a97f;
  box-shadow: 0 0 0 4px rgba(66, 169, 127, 0.12);
}

.room-rule-card strong {
  display: block;
  font-size: 11px;
}

.room-rule-card p {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 9px;
  line-height: 1.5;
}

.modal-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  background: rgba(8, 26, 20, 0.5);
  backdrop-filter: blur(3px);
}

.modal {
  position: fixed;
  z-index: 90;
  top: 50%;
  left: 50%;
  width: min(520px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
}

.modal-wide {
  width: min(680px, calc(100vw - 28px));
}

.modal-small {
  width: min(440px, calc(100vw - 28px));
}

.drawer-modal {
  top: 0;
  right: 0;
  left: auto;
  width: min(470px, calc(100vw - 18px));
  height: 100vh;
  max-height: 100vh;
  border-radius: 18px 0 0 18px;
  transform: none;
}

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

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.035em;
}

.modal-close {
  border-color: var(--line);
  color: var(--ink-muted);
  font-size: 22px;
}

.booking-form,
#profile-form {
  padding: 20px 24px 0;
}

.form-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
  color: #43504b;
  font-size: 11px;
  font-weight: 800;
}

.field-full {
  grid-column: 1 / -1;
}

.field small {
  color: var(--ink-muted);
  font-weight: 500;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

.field input,
.field select {
  min-height: 43px;
  padding: 0 12px;
}

.field textarea {
  resize: vertical;
  padding: 11px 12px;
  line-height: 1.5;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
}

.time-fields {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.repeat-fields {
  display: flex;
  align-items: end;
  gap: 14px;
  padding: 13px;
  border-radius: 12px;
  background: #f4f7f4;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  cursor: pointer;
}

.check-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.check-field strong,
.check-field small {
  display: block;
}

.check-field strong {
  font-size: 12px;
}

.check-field small {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 10px;
}

.compact-field {
  width: 170px;
}

.owner-note,
.confirmation-field,
.confirmation-inline,
.confirm-content,
.detail-content,
.modal-description {
  margin: 18px 24px 0;
}

.owner-note {
  padding: 11px 13px;
  border: 1px solid #dde8e3;
  border-radius: 10px;
  background: var(--brand-soft);
  color: #416157;
  font-size: 10px;
  line-height: 1.5;
}

.confirmation-field {
  padding: 14px;
  border: 1px solid #eaded2;
  border-radius: 12px;
  background: #fff9f3;
}

.form-error {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--danger-soft);
  color: #923f38;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--line);
}

.split-footer {
  justify-content: space-between;
}

.detail-content {
  margin-bottom: 22px;
}

.detail-hero {
  padding: 18px;
  border-radius: 14px;
}

.detail-hero .team-pill {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  font-size: 9px;
  font-weight: 900;
}

.detail-hero h3 {
  margin: 11px 0 6px;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.detail-hero p {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}

.detail-list div {
  min-height: 68px;
  padding: 12px;
  background: #fff;
}

.detail-list span,
.detail-list strong {
  display: block;
}

.detail-list span {
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 700;
}

.detail-list strong {
  margin-top: 5px;
  font-size: 12px;
}

.detail-notes {
  margin-top: 14px;
  padding: 13px;
  border-radius: 10px;
  background: #f5f7f5;
  color: #50605a;
  font-size: 11px;
  line-height: 1.6;
}

.permission-note {
  margin-top: 14px;
  color: var(--ink-muted);
  font-size: 10px;
}

.confirm-content {
  padding: 14px;
  border-radius: 12px;
  background: #f5f7f5;
  color: #41504b;
  font-size: 12px;
  line-height: 1.7;
}

.confirm-content strong {
  color: var(--ink);
}

.confirmation-inline {
  margin-top: 14px;
}

.modal-description {
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.6;
}

.profile-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.profile-choice {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.profile-choice:hover,
.profile-choice.is-selected {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.profile-choice strong,
.profile-choice small {
  display: block;
}

.profile-choice strong {
  font-size: 12px;
}

.profile-choice small {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 9px;
}

.drawer-content {
  padding: 6px 24px 30px;
}

.activity-item {
  position: relative;
  padding: 16px 0 16px 22px;
  border-bottom: 1px solid var(--line);
}

.activity-item::before {
  position: absolute;
  top: 21px;
  left: 2px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--brand);
  border-radius: 50%;
  background: #fff;
  content: "";
}

.activity-item strong,
.activity-item span,
.activity-item time {
  display: block;
}

.activity-item strong {
  font-size: 12px;
}

.activity-item span {
  margin-top: 5px;
  color: #53625d;
  font-size: 10px;
  line-height: 1.5;
}

.activity-item time {
  margin-top: 6px;
  color: #919a96;
  font-size: 9px;
}

.cancelled-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

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

.cancelled-item strong {
  font-size: 12px;
}

.cancelled-item small {
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: 10px;
}

.toast-region {
  position: fixed;
  z-index: 110;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  justify-items: center;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 240px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 11px;
  background: var(--brand-deep);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 11px;
  font-weight: 700;
  animation: toast-in 180ms ease-out;
  text-align: center;
  pointer-events: auto;
}

.toast.is-error {
  background: #8f3e37;
}

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

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
}

.onboarding-spotlight {
  position: absolute;
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(16, 18, 23, 0.62);
  outline: 2px solid rgba(255, 255, 255, 0.88);
  pointer-events: none;
  transition: top 180ms ease, left 180ms ease, width 180ms ease, height 180ms ease;
}

.onboarding-card {
  position: absolute;
  width: min(320px, calc(100vw - 32px));
  padding: 18px 18px 14px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.onboarding-step {
  margin: 0 0 6px;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
}

.onboarding-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.onboarding-body {
  margin: 0 0 16px;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.5;
}

.onboarding-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1180px) {
  .main-content {
    grid-template-columns: minmax(0, 1fr);
  }

  .upcoming-sidebar {
    display: none;
  }

  .upcoming-fab {
    display: inline-flex;
  }
}

@media (max-width: 720px) {
  :root {
    --app-header-height: 48px;
    --calendar-day-header-height: 40px;
    --calendar-hour-height: clamp(32px, calc((100dvh - 208px) / 14), 44px);
  }

  .app-header {
    min-height: var(--app-header-height);
    padding: 5px 10px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .brand small,
  .profile-copy,
  .desktop-only {
    display: none;
  }

  .profile-button {
    min-width: auto;
    padding-right: 7px;
  }

  .main-content {
    padding: 8px 8px 10px;
  }

  .calendar-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
  }

  .date-navigation {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    width: 100%;
  }

  .calendar-toolbar h1 {
    overflow: hidden;
    font-size: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .calendar-toolbar p {
    display: none;
  }

  .toolbar-actions {
    justify-content: space-between;
    width: 100%;
  }

  .calendar-card {
    border-radius: 10px;
  }

  .calendar-view {
    min-width: 700px;
  }

  .upcoming-fab {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    min-height: 46px;
    padding-right: 9px;
    padding-left: 12px;
  }

  .modal.upcoming-modal {
    top: auto;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    width: calc(100% - 16px);
    max-height: min(72dvh, 620px);
    border-width: 1px;
    border-radius: 20px;
    transform: none;
  }

  .modal.upcoming-modal::before {
    width: 36px;
    height: 4px;
    flex: 0 0 auto;
    margin: 8px auto 0;
    border-radius: 999px;
    background: var(--line-strong);
    content: "";
  }

  .upcoming-modal-header {
    padding: 10px 16px 12px;
  }

  .upcoming-modal-body {
    padding: 0 16px max(16px, env(safe-area-inset-bottom));
  }

  .upcoming-modal-description {
    margin-right: -16px;
    margin-left: -16px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .form-section {
    grid-template-columns: 1fr;
  }

  .field-full {
    grid-column: auto;
  }

  .repeat-fields {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-field {
    width: 100%;
  }

  .profile-list,
  .detail-list {
    grid-template-columns: 1fr;
  }

  .modal-header,
  .booking-form,
  #profile-form,
  .drawer-content {
    padding-right: 17px;
    padding-left: 17px;
  }

  .owner-note,
  .confirmation-field,
  .confirmation-inline,
  .confirm-content,
  .detail-content,
  .modal-description {
    margin-right: 17px;
    margin-left: 17px;
  }

  .modal-footer {
    padding-right: 17px;
    padding-left: 17px;
  }
}

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