:root {
  --bg: #f1f0e8;
  --bg-deep: #33372c;
  --surface: #ffffff;
  --surface-subtle: #fbfaf0;
  --surface-muted: #f5f5f4;
  --ink: #111111;
  --ink-soft: #555555;
  --muted: #777777;
  --line: #e4e4e2;
  --line-strong: #d9d9d5;
  --accent: #6b705c;
  --accent-deep: #4a4e3f;
  --accent-soft: #f2f4e8;
  --warning: #f9f871;
  --danger: #b74d45;
  --success: #60722c;
  --disabled: #ececec;
  --shadow: 0 28px 90px rgba(44, 41, 28, 0.14);
  --font-display: "Playfair Display", Georgia, serif;
  --font-body: Inter, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  --radius-shell: 40px;
  --radius-control: 16px;
  --radius-small: 12px;
  --container: 448px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
}

body::before {
  display: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.app {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 16px;
}

.phone-shell {
  width: min(100%, var(--container));
  min-height: 0;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius-shell);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.login-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100dvh - 34px);
  padding: 64px 44px 40px;
}

.brand-title,
.screen-title {
  margin: 0;
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.03;
  text-align: center;
}

.brand-title {
  font-size: clamp(2.7rem, 7vw, 4.35rem);
}

.brand-kicker {
  margin-top: 14px;
  color: #4d5136;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.52em;
  text-align: center;
  text-indent: 0.52em;
}

.brand-rule {
  width: 48px;
  height: 4px;
  margin: 27px auto 50px;
  background: var(--accent);
}

.login-subtitle {
  margin: 0 0 54px;
  color: var(--ink-soft);
  font-size: 1.55rem;
  font-weight: 700;
  text-align: center;
}

.pin-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 640px);
  min-height: 92px;
  padding: 28px 24px;
  border: 2px solid var(--line);
  border-radius: var(--radius-control);
  background: #fbfbfb;
  box-shadow: inset 0 0 0 1px #f3f3f2;
}

.pin-button:focus-visible {
  outline: 4px solid rgba(132, 145, 58, 0.24);
  outline-offset: 3px;
}

.pin-dots {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: center;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #c4c4c4;
  transform: scale(0.82);
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.pin-dot.is-filled {
  background: #777777;
  transform: scale(1);
}

.pin-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.login-message {
  min-height: 26px;
  margin-top: 18px;
  color: var(--danger);
  font-size: 0.98rem;
  font-weight: 800;
  text-align: center;
}

.management-view {
  padding: 32px;
}

.screen-title {
  font-size: 2.25rem;
}

.user-header {
  margin-bottom: 30px;
  text-align: center;
}

.user-kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 0;
  margin-bottom: 32px;
}

.room-tile {
  display: grid;
  min-height: 104px;
  place-items: center;
  padding: 20px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.room-tile:hover {
  transform: translateY(-1px);
  border-color: #c8cbb8;
}

.room-tile:focus-visible,
.field:focus-visible,
.select-wrap select:focus-visible,
.check-row input:focus-visible,
.primary-action:focus-visible,
.secondary-action:focus-visible {
  outline: 4px solid rgba(132, 145, 58, 0.22);
  outline-offset: 3px;
}

.room-tile:disabled {
  cursor: not-allowed;
  opacity: 1;
}

.room-tile.is-running {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  box-shadow: none;
}

.room-tile.is-reserved {
  border-color: #eadca8;
  background: #fffaf0;
  color: #6f5414;
}

.room-tile.is-cleaning {
  border-color: #dedede;
  background: #f6f6f6;
  color: #666666;
}

.room-tile.is-selected:not(.is-running) {
  border-color: var(--accent);
  background: #fffffc;
  box-shadow: inset 0 0 0 1px rgba(107, 112, 92, 0.35);
}

.room-number {
  display: block;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.room-status {
  display: block;
  margin-top: 5px;
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
}

.room-tile.is-running .room-status {
  color: rgba(255, 255, 255, 0.9);
}

.room-time {
  display: block;
  margin-top: 6px;
  color: var(--warning);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.form-stack {
  display: grid;
  gap: 12px;
  margin-top: 0;
  margin-bottom: 24px;
}

.field,
.select-wrap select {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 500;
}

.field {
  padding: 0 20px;
}

.field::placeholder {
  color: #777777;
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  appearance: none;
  padding: 0 52px 0 20px;
}

.select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 20px;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  pointer-events: none;
  transform: translateY(-62%) rotate(45deg);
}

.fee-panel {
  display: grid;
  min-height: 96px;
  margin-top: 0;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.875rem;
  font-weight: 800;
  line-height: 1;
}

.notice {
  margin: 0 0 16px;
  padding: 16px;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  background: #f9fafb;
  color: #6b7280;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.55;
  text-align: center;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 32px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
}

.check-row input {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--accent);
}

.action-stack {
  display: grid;
  gap: 12px;
  margin-top: 0;
}

.primary-action,
.secondary-action {
  min-height: 60px;
  border: 0;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 800;
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.primary-action {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(107, 112, 92, 0.2);
}

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

.secondary-action {
  background: #f3f4f6;
  color: #6b7280;
}

.secondary-action:hover {
  background: #e2e2e2;
}

.form-message {
  min-height: 24px;
  margin: 14px 4px 0;
  color: var(--danger);
  font-size: 0.95rem;
  font-weight: 700;
}

.form-message.is-success {
  color: var(--success);
}

@media (max-width: 720px) {
  body::before {
    height: 0;
  }

  .app {
    padding: 16px;
  }

  .phone-shell {
    min-height: 0;
    border-radius: var(--radius-shell);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  }

  .login-view,
  .management-view {
    min-height: 0;
    padding: 32px;
  }

  .login-view {
    padding-top: 58px;
  }

  .management-view {
    padding-top: 32px;
    padding-bottom: 32px;
  }

  .brand-title {
    font-size: clamp(2.65rem, 14vw, 4rem);
  }

  .brand-kicker {
    font-size: 0.9rem;
    letter-spacing: 0.36em;
    text-indent: 0.36em;
  }

  .login-subtitle {
    margin-bottom: 44px;
    font-size: 1.35rem;
  }

  .pin-button {
    min-height: 82px;
  }

  .room-grid {
    gap: 12px;
    margin-top: 0;
  }

  .room-tile {
    min-height: 104px;
    padding: 20px 12px;
  }

  .room-number {
    font-size: 1.125rem;
  }

  .room-status {
    font-size: 0.875rem;
  }

  .field,
  .select-wrap select {
    min-height: 62px;
    font-size: 0.875rem;
  }

  .notice {
    font-size: 0.6875rem;
  }
}

@media (max-width: 430px) {
  .brand-rule {
    margin-bottom: 42px;
  }

  .pin-dots {
    gap: 18px;
  }
}
