:root {
  --bg: #edf1f6;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #172033;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #d9e0ea;
  --line-soft: #e8edf3;
  --info: #0f766e;
  --info-soft: #e6f4f1;
  --danger: #b42318;
  --danger-soft: #fde8e7;
  --warn: #b45309;
  --warn-soft: #fff4de;
  --shadow: 0 16px 45px rgba(16, 24, 40, 0.11);
  --radius: 8px;
  --tap: 48px;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  background: var(--surface-soft);
  box-shadow: var(--shadow);
  position: relative;
}

.screen {
  min-height: 100dvh;
  padding: 18px 18px calc(88px + env(safe-area-inset-bottom));
}

.screen.login {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  padding-bottom: 28px;
}

.topbar {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--info);
  display: grid;
  place-items: center;
  color: #ffffff;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 14px;
  font-weight: 760;
  white-space: nowrap;
}

.role-badge.admin {
  background: var(--info-soft);
  color: var(--info);
}

.icon {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex: 0 0 auto;
}

.icon.fill {
  fill: currentColor;
  stroke: none;
}

.profile-button,
.icon-button {
  min-width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--muted);
  cursor: pointer;
}

.greeting {
  margin: 4px 0 18px;
}

.greeting h1 {
  margin: 0 0 4px;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 760;
  letter-spacing: 0;
}

.greeting p,
.muted {
  color: var(--muted);
  margin: 0;
  font-size: 17px;
}

.card {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
}

button.card {
  cursor: pointer;
  text-align: left;
}

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

.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 680;
}

.card-head .date {
  margin-left: auto;
  font-size: 16px;
  font-weight: 520;
  color: var(--muted);
}

.schedule-card {
  border-color: rgba(15, 118, 110, 0.42);
}

.schedule-title {
  margin: 0 0 10px;
  font-size: 25px;
  line-height: 1.25;
  font-weight: 760;
  letter-spacing: 0;
}

.schedule-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  color: var(--muted);
  font-size: 18px;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
}

.state-note {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin: 0 0 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 16px;
}

.state-note.info {
  background: var(--info-soft);
  color: var(--info);
}

.rest-state {
  min-height: 158px;
  display: grid;
  place-items: center;
  text-align: center;
}

.rest-state strong {
  display: block;
  margin-top: 10px;
  font-size: 24px;
}

.history-button {
  display: flex;
  align-items: center;
  min-height: 64px;
  gap: 12px;
}

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

.history-copy strong {
  display: block;
  font-size: 20px;
  margin-bottom: 3px;
}

.history-copy span {
  display: block;
  color: var(--muted);
  font-size: 16px;
}

.todo-list {
  display: flex;
  flex-direction: column;
}

.todo-row {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: transparent;
  padding: 10px 0;
  cursor: pointer;
  text-align: left;
}

.todo-row:first-child {
  border-top: 0;
}

.todo-row .label {
  flex: 1;
  min-width: 0;
  font-size: 18px;
  font-weight: 620;
}

.badge {
  min-width: 44px;
  text-align: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 16px;
  font-weight: 720;
  background: var(--info-soft);
  color: var(--info);
}

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

.badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

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

.metric-card {
  min-height: 92px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  text-align: left;
}

.metric-card span {
  color: var(--muted);
  font-size: 15px;
  font-weight: 680;
}

.metric-card strong {
  color: var(--info);
  font-size: 29px;
  line-height: 1;
  letter-spacing: 0;
}

.surface-switch {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.surface-switch .grow,
.op-row .row-copy {
  flex: 1;
  min-width: 0;
}

.surface-switch strong,
.op-row strong {
  display: block;
  color: var(--text);
  font-size: 18px;
  margin-bottom: 3px;
}

.surface-switch span span,
.op-row span span {
  display: block;
  color: var(--muted);
  font-size: 15px;
}

.op-list {
  display: flex;
  flex-direction: column;
}

.op-row {
  width: 100%;
  min-height: 64px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: transparent;
  padding: 11px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}

.op-row:first-child {
  border-top: 0;
}

.empty {
  color: var(--muted);
  min-height: 56px;
  display: flex;
  align-items: center;
  font-size: 18px;
}

.holiday-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
}

.holiday-date {
  min-width: 52px;
  font-size: 18px;
  font-weight: 760;
}

.holiday-name {
  color: var(--muted);
  font-size: 18px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: calc(70px + env(safe-area-inset-bottom));
  padding: 6px 10px calc(8px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.nav-item {
  min-height: 56px;
  border: 0;
  background: transparent;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  cursor: pointer;
}

.nav-item.active {
  background: var(--info-soft);
  color: var(--info);
}

.nav-item span {
  font-size: 15px;
  font-weight: 680;
}

.login-panel {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px;
}

.login-title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 760;
}

.login-sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 17px;
}

.field-group {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field-group label {
  font-size: 16px;
  color: var(--muted);
  font-weight: 680;
}

.select {
  width: 100%;
  min-height: var(--tap);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0 12px;
  font-size: 18px;
}

.provider-grid {
  display: grid;
  gap: 10px;
}

.provider-button,
.primary-button,
.ghost-button {
  min-height: 52px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 720;
  cursor: pointer;
}

.provider-button.kakao {
  background: #fee500;
  border-color: #fee500;
  color: #191600;
}

.provider-button.google {
  background: #ffffff;
  color: #1f2937;
}

.provider-button.admin {
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--text);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 15px;
  margin: 8px 0 4px;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.primary-button {
  border-color: var(--info);
  background: var(--info);
  color: #ffffff;
}

.ghost-button {
  border-color: var(--line-soft);
  background: var(--surface-soft);
  color: var(--text);
}

.status {
  min-height: 42px;
  margin-top: 12px;
  border-radius: var(--radius);
  padding: 10px 12px;
  display: none;
  align-items: center;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 16px;
}

.status.show {
  display: flex;
}

.skeleton-card {
  min-height: 124px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #eef2f7 0%, #f8fafc 45%, #eef2f7 100%);
  background-size: 220% 100%;
  animation: shimmer 1.2s infinite linear;
}

@keyframes shimmer {
  from { background-position: 220% 0; }
  to { background-position: -220% 0; }
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 10;
}

.drawer {
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border-radius: 14px 14px 0 0;
  padding: 18px;
  box-shadow: 0 -20px 55px rgba(15, 23, 42, 0.18);
}

.drawer h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.drawer-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.view-title {
  margin: 12px 0 14px;
  font-size: 27px;
  line-height: 1.2;
}

.list-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 66px;
}

.list-card .grow {
  flex: 1;
  min-width: 0;
}

.list-card strong {
  display: block;
  font-size: 18px;
  margin-bottom: 3px;
}

.list-card span {
  color: var(--muted);
  font-size: 16px;
}

.complete-btn {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--info);
  background: var(--info);
  color: #ffffff;
  font-size: 15px;
  font-weight: 720;
  cursor: pointer;
  white-space: nowrap;
}

.complete-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 430px) {
  .app-shell {
    box-shadow: none;
  }
}
