:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #111827;
  --accent-soft: #eef2ff;
  --success: #13795b;
  --success-bg: #ecfdf5;
  --warning: #b45309;
  --warning-bg: #fffbeb;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --kakao: #fee500;
  font-family: Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--text); background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.app-shell { width: min(1180px, 100%); min-height: 100vh; margin: 0 auto; padding: 0 24px 48px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 28px 0 18px; }
.brand-row { display: flex; align-items: center; gap: 11px; }
.brand-row h1 { margin: 0; font-size: 27px; letter-spacing: -.04em; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; color: white; background: var(--accent); font-weight: 900; }
.topbar p { margin: 8px 0 0 45px; font-size: 14px; }
.auth-area { display: flex; align-items: center; gap: 8px; }
.user-badge { padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: white; font-size: 13px; }

.button, select, input, textarea { min-height: 44px; border: 1px solid var(--line); border-radius: 12px; }
.button { padding: 10px 15px; font-weight: 750; transition: transform .15s ease, border-color .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; border-color: var(--accent); background: var(--accent); }
.button.secondary { color: var(--text); background: white; }
.button.ghost { color: var(--muted); background: transparent; }
.button.kakao { color: #191919; border-color: var(--kakao); background: var(--kakao); }
.button.full { width: 100%; padding: 14px; }

.tabs { display: flex; gap: 8px; padding-bottom: 16px; }
.tab { min-height: 44px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: white; font-weight: 750; }
.tab.active { color: white; border-color: var(--accent); background: var(--accent); }

.page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr); gap: 16px; align-items: start; }
.side-stack { display: grid; gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: 22px; background: var(--panel); box-shadow: 0 8px 28px rgb(15 23 42 / 5%); padding: 22px; }
.compact-panel { padding: 20px; }
.panel h2 { margin: 0; font-size: 21px; letter-spacing: -.03em; }
.panel-title-row, .dialog-title-row, .admin-hero { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.eyebrow { display: block; margin-bottom: 6px; color: #6366f1; font-size: 11px; font-weight: 850; letter-spacing: .1em; }
.time-pill { flex: 0 0 auto; padding: 6px 9px; border-radius: 999px; color: var(--muted); background: #f3f4f6; font-size: 12px; }

.store-picker { margin-top: 18px; }
.field { display: grid; gap: 7px; }
.field > span { color: #4b5563; font-size: 12px; font-weight: 750; }
.field input, .field select, .field textarea, select { width: 100%; padding: 10px 12px; color: var(--text); background: white; }
.field textarea { min-height: 78px; resize: vertical; line-height: 1.5; }

.questions { display: grid; gap: 12px; margin: 18px 0; }
.question { padding: 16px; border: 1px solid var(--line); border-radius: 17px; }
.question h3 { margin: 0; font-size: 16px; line-height: 1.45; }
.question p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.segment { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; }
.segment button { min-height: 48px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: white; font-weight: 800; }
.segment button.selected-ok { color: var(--success); border-color: #6ee7b7; background: var(--success-bg); }
.segment button.selected-issue { color: var(--danger); border-color: #fda29b; background: var(--danger-bg); }
.detail-field { margin-top: 10px; }
.form-hint { margin: 10px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
#shareReport { margin-top: 9px; }

.guide-card { margin-top: 15px; padding: 14px; border: 1px solid #c7d2fe; border-radius: 14px; color: #3730a3; background: var(--accent-soft); font-size: 13px; line-height: 1.65; }
.step-list { display: grid; gap: 12px; margin: 16px 0 0; padding: 0; list-style: none; }
.step-list li { display: flex; align-items: center; gap: 10px; color: #4b5563; font-size: 13px; }
.step-list span { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 8px; background: #f3f4f6; font-weight: 850; }

.admin-hero { margin-bottom: 14px; }
.admin-hero input { width: auto; padding: 8px 11px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.metric { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.metric span { color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 7px; font-size: 30px; }
.metric.issue { color: var(--warning); background: var(--warning-bg); }
.metric.pending { color: #475467; background: #f8fafc; }
.store-status-list { display: grid; gap: 10px; margin-top: 17px; }
.store-status { padding: 15px; border: 1px solid var(--line); border-radius: 15px; }
.store-status-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.status { padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.status.done { color: var(--success); background: var(--success-bg); }
.status.issue { color: var(--warning); background: var(--warning-bg); }
.status.pending { color: var(--muted); background: #f3f4f6; }
.meta { margin-top: 6px; color: var(--muted); font-size: 12px; }
.issue-note { margin-top: 9px; padding: 10px; border-radius: 11px; color: #92400e; background: var(--warning-bg); font-size: 12px; line-height: 1.55; }
.empty { padding: 28px 10px; color: var(--muted); text-align: center; }

.stack-form { display: grid; gap: 11px; margin-top: 15px; }
.manage-list { display: grid; gap: 8px; margin-top: 14px; }
.manage-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.manage-item button { min-height: 34px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 9px; background: white; font-size: 11px; }

.login-dialog { position: fixed; inset: 0; width: min(430px, calc(100% - 28px)); max-height: calc(100dvh - 28px); margin: auto; padding: 0; border: 0; border-radius: 22px; box-shadow: 0 24px 80px rgb(15 23 42 / 28%); }
.login-dialog::backdrop { background: rgb(15 23 42 / 58%); backdrop-filter: blur(3px); }
.login-card { display: grid; gap: 15px; padding: 25px; }
.login-card h2 { margin: 0; font-size: 25px; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 12px; background: white; font-size: 24px; line-height: 1; }
.demo-accounts { display: grid; gap: 5px; padding: 13px; border-radius: 13px; background: #f8fafc; color: var(--muted); font-size: 12px; }
.demo-accounts code { color: #374151; }
.dialog-description { margin: 0; color: #475569; font-size: 14px; line-height: 1.6; }
.dialog-help { margin: -3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 2000; width: max-content; max-width: calc(100% - 32px); padding: 13px 16px; border-radius: 13px; color: white; background: #111827; box-shadow: 0 12px 36px rgb(15 23 42 / 25%); opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: .2s ease; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #b42318; }

@media (max-width: 860px) {
  .page-grid, .admin-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .app-shell { padding: 0 16px 32px; }
  .topbar { padding-top: 20px; }
  .brand-row h1 { font-size: 22px; }
  .brand-mark { width: 31px; height: 31px; }
  .topbar p { display: none; }
  .auth-area { align-items: flex-end; flex-direction: column; }
  .user-badge { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .panel { padding: 17px; border-radius: 18px; }
  .panel-title-row { align-items: flex-start; }
  .side-stack { grid-template-columns: 1fr; }
  .metric-grid { gap: 7px; }
  .metric { padding: 13px 10px; }
  .metric strong { font-size: 25px; }
  .metric span { font-size: 11px; }
  .question { padding: 14px; }
  .segment button { padding-inline: 7px; font-size: 14px; }
  .admin-hero { align-items: flex-start; flex-direction: column; }
  .admin-hero input { width: 100%; }
}
.login-gate {
  grid-column: 1 / -1;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.login-gate.hidden {
  display: none;
}

.login-gate-icon {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 20px;
  background: #eef1f7;
  font-size: 28px;
}

.login-gate h2,
.login-gate p {
  margin: 0;
}

.login-gate p {
  max-width: 420px;
  color: var(--muted);
}

.login-gate .button {
  min-width: 160px;
  margin-top: 8px;
}

.shared-report-view { max-width: 820px; margin: 0 auto; }
.shared-report-card { display: grid; gap: 18px; }
.shared-report-card h2 { margin: 4px 0 0; font-size: clamp(24px, 4vw, 34px); }
.shared-report-items { display: grid; gap: 10px; }
.shared-report-item { padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.shared-report-item-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.shared-report-item-head strong { font-size: 15px; }
.shared-report-item .detail { margin: 12px 0 0; padding: 12px; border-radius: 12px; background: #fff7ed; color: #9a3412; white-space: pre-wrap; }
.shared-report-item .detail-locked { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.shared-detail-gate { display: grid; justify-items: center; gap: 7px; padding: 22px; border-radius: 17px; background: #f8fafc; text-align: center; }
.shared-detail-gate p { margin: 0 0 7px; color: var(--muted); }
.admin-grid.single { grid-template-columns: 1fr; }
.store-status-toggle { display: grid; grid-template-columns: 1fr auto; gap: 14px; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; }
.store-status-summary { min-width: 0; }
.store-status-chevron { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid #e5e7eb; border-radius: 50%; background: white; color: #475569; }
.store-status-chevron::before { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; content: ""; transform: translateY(-2px) rotate(45deg); transition: transform .2s ease; }
.store-status-toggle[aria-expanded="true"] .store-status-chevron::before { transform: translateY(2px) rotate(225deg); }
.store-report-details { display: grid; gap: 9px; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
.dashboard-answer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 12px; border-radius: 12px; background: #f8fafc; }
.dashboard-answer p { grid-column: 1 / -1; margin: 0; color: #9a3412; font-size: 13px; white-space: pre-wrap; }
