/* ========================================================================
   AI Outsourcing — Editorial / Warm Minimal
   ======================================================================== */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.min.css');

:root {
  color-scheme: light;
  --bg: #faf8f3;
  --bg-grain: #f6f3ec;
  --surface: #ffffff;
  --surface-elev: #ffffff;
  --border: #ebe6dc;
  --border-strong: #d9d2c3;
  --ink: #0f0f0f;
  --ink-soft: #1f1f1f;
  --muted: #78736a;
  --muted-strong: #4a463f;
  --accent: #ff5b2e;
  --accent-soft: #fef1eb;
  --accent-ink: #c73e14;
  --success: #2d6a4f;
  --success-soft: #e8f3ec;
  --warning: #b45309;
  --warning-soft: #fef3dc;
  --info: #1e4287;
  --info-soft: #e4ecfa;
  --danger: #9b1c1c;
  --nav-bg: rgba(250, 248, 243, 0.75);
  --input-focus-ring: rgba(15, 15, 15, 0.05);
  --row-hover: #fcfaf5;
  --modal-backdrop: rgba(15, 15, 15, 0.45);
  --body-gradient-1: rgba(255, 91, 46, 0.08);
  --body-gradient-2: rgba(70, 100, 180, 0.05);
  --cancelled-bg: #f3f0ea;

  --shadow-sm: 0 1px 2px rgba(15, 15, 15, 0.04);
  --shadow: 0 1px 2px rgba(15, 15, 15, 0.04), 0 8px 32px rgba(15, 15, 15, 0.06);
  --shadow-lg: 0 2px 4px rgba(15, 15, 15, 0.04), 0 24px 64px rgba(15, 15, 15, 0.1);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --font-sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Noto Serif KR', 'Playfair Display', Georgia, serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Dark theme — applied when user chose dark OR when system is dark and user didn't force light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #0f0e0c;
    --bg-grain: #16140f;
    --surface: #1a1814;
    --surface-elev: #211e18;
    --border: #2a2620;
    --border-strong: #3a352c;
    --ink: #f5f2eb;
    --ink-soft: #e8e3d8;
    --muted: #8a847a;
    --muted-strong: #b0a99e;
    --accent: #ff6b40;
    --accent-soft: #2a1710;
    --accent-ink: #ff8f6e;
    --success: #86d1a7;
    --success-soft: #16281e;
    --warning: #e8b86b;
    --warning-soft: #2d2112;
    --info: #90b2e4;
    --info-soft: #152138;
    --danger: #e37070;
    --nav-bg: rgba(15, 14, 12, 0.75);
    --input-focus-ring: rgba(245, 242, 235, 0.08);
    --row-hover: #211e18;
    --modal-backdrop: rgba(0, 0, 0, 0.6);
    --body-gradient-1: rgba(255, 107, 64, 0.07);
    --body-gradient-2: rgba(100, 140, 220, 0.04);
    --cancelled-bg: #22201b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 64px rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0f0e0c;
  --bg-grain: #16140f;
  --surface: #1a1814;
  --surface-elev: #211e18;
  --border: #2a2620;
  --border-strong: #3a352c;
  --ink: #f5f2eb;
  --ink-soft: #e8e3d8;
  --muted: #8a847a;
  --muted-strong: #b0a99e;
  --accent: #ff6b40;
  --accent-soft: #2a1710;
  --accent-ink: #ff8f6e;
  --success: #86d1a7;
  --success-soft: #16281e;
  --warning: #e8b86b;
  --warning-soft: #2d2112;
  --info: #90b2e4;
  --info-soft: #152138;
  --danger: #e37070;
  --nav-bg: rgba(15, 14, 12, 0.75);
  --input-focus-ring: rgba(245, 242, 235, 0.08);
  --row-hover: #211e18;
  --modal-backdrop: rgba(0, 0, 0, 0.6);
  --body-gradient-1: rgba(255, 107, 64, 0.07);
  --body-gradient-2: rgba(100, 140, 220, 0.04);
  --cancelled-bg: #22201b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 64px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-image:
    radial-gradient(circle at 15% -10%, var(--body-gradient-1), transparent 40%),
    radial-gradient(circle at 95% 10%, var(--body-gradient-2), transparent 35%);
  background-attachment: fixed;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ==================== NAV ==================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 40px;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.nav .logo .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.02em;
}
.nav .right {
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.nav .right a {
  transition: color 0.2s var(--ease);
}
.nav .right a:hover {
  color: var(--ink);
}
.nav .right .pill {
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
  color: var(--ink);
  transition: all 0.2s var(--ease);
}
.nav .right .pill:hover {
  border-color: var(--ink);
}

/* Theme toggle button */
.theme-toggle {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--ink);
  padding: 0;
  transition: all 0.2s var(--ease);
}
.theme-toggle:hover {
  border-color: var(--ink);
}
.theme-toggle svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }
:root[data-theme='dark'] .theme-toggle .sun { display: block; }
:root[data-theme='dark'] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .sun { display: block; }
  :root:not([data-theme='light']) .theme-toggle .moon { display: none; }
}

/* ==================== HERO ==================== */
.hero {
  max-width: 920px;
  margin: 0 auto;
  padding: 96px 32px 48px;
  text-align: center;
  position: relative;
}
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted-strong);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.hero .eyebrow .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-size: clamp(42px, 7vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin: 0 0 24px;
  font-weight: 700;
}
.hero h1 .accent {
  color: var(--accent);
  font-style: italic;
  font-weight: 500;
  position: relative;
}
.hero h1 .accent::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 10px;
  background: var(--accent-soft);
  z-index: -1;
  border-radius: 999px;
}
.hero .sub {
  color: var(--muted-strong);
  margin: 0 auto 36px;
  max-width: 560px;
  font-size: 17px;
  line-height: 1.6;
}
.hero .features {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.hero .features .chip {
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted-strong);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hero .features .chip svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

/* ==================== CHAT ==================== */
.chat-section {
  max-width: 760px;
  margin: 40px auto 96px;
  padding: 0 24px;
}
.chat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 620px;
  position: relative;
}
.chat::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 91, 46, 0.04), transparent 50%);
  pointer-events: none;
}
.chat-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 1;
}
.chat-header .who {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-header .avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ink) 0%, var(--muted-strong) 100%);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.02em;
}
.chat-header .meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.chat-header .name {
  font-weight: 600;
  font-size: 14px;
}
.chat-header .status {
  font-size: 12px;
  color: #22a854;
  display: flex;
  align-items: center;
  gap: 5px;
}
:root[data-theme='dark'] .chat-header .status,
.chat-header .status { color: #22c55e; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .chat-header .status { color: #4ade80; }
}
.chat-header .status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}
.chat-header .corner {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
  scroll-behavior: smooth;
}
.messages::-webkit-scrollbar {
  width: 8px;
}
.messages::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}
.messages::-webkit-scrollbar-track {
  background: transparent;
}

.msg {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 18px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14.5px;
  line-height: 1.6;
  animation: msgIn 0.4s var(--ease) both;
  position: relative;
}
@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.msg.user {
  align-self: flex-end;
  background: var(--ink);
  color: var(--bg);
  border-bottom-right-radius: 6px;
}
.msg.ai {
  align-self: flex-start;
  background: var(--bg-grain);
  color: var(--ink);
  border-bottom-left-radius: 6px;
  border: 1px solid var(--border);
}
.msg.typing {
  padding: 14px 18px;
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.msg.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: bounce 1.3s infinite;
}
.msg.typing span:nth-child(2) { animation-delay: 0.15s; }
.msg.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.input-row {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  position: relative;
  z-index: 1;
}
.input-row input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14.5px;
  font-family: inherit;
  background: var(--bg);
  color: var(--ink);
  outline: none;
  transition: all 0.2s var(--ease);
}
.input-row input:focus {
  border-color: var(--ink);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--input-focus-ring);
}
.input-row input::placeholder {
  color: var(--muted);
}
.input-row button {
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 12px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s var(--ease);
  letter-spacing: -0.01em;
}
.input-row button:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}
.input-row button:active {
  transform: translateY(0);
}
.input-row button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
  background: var(--ink);
}

/* ==================== FOOTER ==================== */
.footer {
  padding: 40px 32px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
  border-top: 1px solid var(--border);
}

/* ==================== ADMIN LOGIN ==================== */
.login-card {
  max-width: 400px;
  margin: 120px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-card .mark-big {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 20px;
}
.login-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: -0.025em;
  font-weight: 600;
}
.login-card p {
  color: var(--muted);
  margin: 0 0 28px;
  font-size: 13.5px;
}
.login-card input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  margin-bottom: 12px;
  outline: none;
  transition: all 0.2s var(--ease);
}
.login-card input:focus {
  border-color: var(--ink);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--input-focus-ring);
}
.login-card button {
  width: 100%;
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s var(--ease);
}
.login-card button:hover {
  background: var(--accent);
  color: #fff;
}
.login-error {
  color: var(--danger);
  font-size: 12.5px;
  margin-top: 10px;
}

/* ==================== ADMIN DASHBOARD ==================== */
.admin-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 40px 80px;
}
.admin-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 32px;
}
.admin-title h2 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.035em;
  font-weight: 700;
}
.admin-title h2 small {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
}
.admin-title .actions {
  display: flex;
  gap: 10px;
}
.admin-title button.logout {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--muted-strong);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  transition: all 0.2s var(--ease);
}
.admin-title button.logout:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s var(--ease);
}
.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.stat .label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 500;
}
.stat .value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
}
.stat.highlight {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.stat.highlight .label {
  color: color-mix(in srgb, var(--bg) 60%, transparent);
}
.stat.highlight::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(255, 91, 46, 0.4), transparent 60%);
  pointer-events: none;
}

/* Orders table */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}
.section-head h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
  font-weight: 600;
}
.section-head .hint {
  font-size: 12px;
  color: var(--muted);
}

.orders-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.orders-table table {
  width: 100%;
  border-collapse: collapse;
}
.orders-table th,
.orders-table td {
  padding: 14px 20px;
  text-align: left;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border);
}
.orders-table th {
  background: var(--bg-grain);
  font-weight: 500;
  color: var(--muted-strong);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 20px;
}
.orders-table tr:last-child td {
  border-bottom: none;
}
.orders-table tr.clickable {
  cursor: pointer;
  transition: background 0.15s var(--ease);
}
.orders-table tr.clickable:hover {
  background: var(--row-hover);
}
.orders-table td.queue {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.orders-table td.id {
  color: var(--muted);
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 12.5px;
}
.orders-table td.price {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.badge.pending {
  background: var(--warning-soft);
  color: var(--warning);
}
.badge.pending::before { background: var(--warning); }
.badge.in_progress {
  background: var(--info-soft);
  color: var(--info);
}
.badge.in_progress::before { background: var(--info); }
.badge.completed {
  background: var(--success-soft);
  color: var(--success);
}
.badge.completed::before { background: var(--success); }
.badge.cancelled {
  background: var(--cancelled-bg);
  color: var(--muted-strong);
}
.badge.cancelled::before { background: var(--muted); }

/* ==================== MODAL ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--modal-backdrop);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 100;
  padding: 48px 24px;
  overflow-y: auto;
}
.modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.2s var(--ease);
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s var(--ease);
}
@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-header {
  padding: 22px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.02em;
  font-weight: 600;
}
.modal-header .close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--muted);
  line-height: 1;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.15s var(--ease);
}
.modal-header .close:hover {
  background: var(--bg-grain);
  color: var(--ink);
}
.modal-body { color: var(--ink); }
.modal-body {
  padding: 24px 28px 28px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px 20px;
  padding: 4px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  color: var(--ink);
}
.detail-grid .k {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding-top: 2px;
}
.detail-grid .v {
  font-size: 14px;
  color: var(--ink);
  word-break: break-word;
}
.detail-grid .v.price {
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.status-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.status-actions button {
  padding: 9px 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  transition: all 0.15s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.status-actions button:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}
.status-actions button.danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.status-actions button.primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.status-actions button.primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.chat-history h4 {
  margin: 0 0 14px;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.chat-history .history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}
.chat-history .msg {
  max-width: 85%;
  font-size: 13.5px;
  padding: 10px 14px;
  animation: none;
}

/* ==================== EMPTY STATE ==================== */
.empty {
  text-align: center;
  padding: 72px 24px;
  color: var(--muted);
  font-size: 14px;
}
.empty .emoji {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.5;
}
.empty h4 {
  font-size: 16px;
  color: var(--ink);
  margin: 0 0 6px;
  font-weight: 600;
}

/* ==================== SHARED BUTTONS ==================== */
.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: all 0.2s var(--ease);
  border: 1px solid transparent;
  text-decoration: none;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}
.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--ink);
}
.btn-block {
  width: 100%;
}

/* Chat CTA bubble */
.msg.cta {
  background: transparent;
  border: none;
  padding: 0;
}
.msg.cta a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 30%, transparent);
  transition: transform 0.2s var(--ease);
}
.msg.cta a:hover {
  transform: translateY(-2px);
}

.notice-bar {
  max-width: 760px;
  margin: 0 auto 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 13.5px;
}

/* ==================== LANDING: PLANS ==================== */
.plans {
  max-width: 920px;
  margin: 0 auto 96px;
  padding: 0 24px;
}
.plans .section-title {
  text-align: center;
  margin-bottom: 32px;
}
.plans .section-title p {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 600;
}
.plans .section-title h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 36px);
  letter-spacing: -0.035em;
}
.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  overflow: hidden;
}
.plan.featured {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.plan.featured::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 55%);
  pointer-events: none;
}
.plan > * {
  position: relative;
}
.plan .tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  margin-bottom: 18px;
}
.plan.plain .tag {
  background: var(--bg-grain);
  color: var(--muted-strong);
  border: 1px solid var(--border);
}
.plan h3 {
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: -0.03em;
}
.plan .desc {
  margin: 0 0 22px;
  font-size: 14px;
  opacity: 0.7;
}
.plan .price {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 22px;
}
.plan .price small {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.6;
  letter-spacing: 0;
}
.plan ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  font-size: 14px;
}
.plan li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.plan li::before {
  content: '';
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 10px no-repeat;
}

/* ==================== LANDING: TEMPLATE SHOWCASE ==================== */
.showcase {
  max-width: 1120px;
  margin: 0 auto 96px;
  padding: 0 24px;
}
.showcase .section-title {
  text-align: center;
  margin-bottom: 32px;
}
.showcase .section-title p {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 600;
}
.showcase .section-title h2 {
  margin: 0 0 10px;
  font-size: clamp(26px, 4vw, 36px);
  letter-spacing: -0.035em;
}
.showcase .section-title .sub {
  color: var(--muted);
  font-size: 15px;
}
.show-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.show-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.show-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.show-thumb {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--bg-grain);
  border-bottom: 1px solid var(--border);
}
.show-thumb iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 1600px;
  border: 0;
  transform-origin: 0 0;
  pointer-events: none;
}
.show-name {
  display: block;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
}
.show-more {
  text-align: center;
  margin-top: 24px;
}
@media (max-width: 860px) {
  .show-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.plan-link {
  display: inline-block;
  margin-top: 22px;
  font-size: 14px;
  font-weight: 600;
  color: inherit;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.steps {
  max-width: 920px;
  margin: 0 auto 96px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  counter-reset: step;
}
.steps .step {
  border-top: 2px solid var(--border-strong);
  padding-top: 16px;
  counter-increment: step;
}
.steps .step::before {
  content: '0' counter(step);
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}
.steps .step strong {
  display: block;
  font-size: 15px;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.steps .step span {
  font-size: 13px;
  color: var(--muted);
}

/* ==================== WORKSPACE ==================== */
.work-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 32px 64px;
}
.work-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.work-head .eyebrow-sm {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}
.work-head h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.035em;
}
.progress {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.progress .p-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.progress .p-step.done {
  color: var(--ink);
}
.progress .p-step.done::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
}
.progress .p-step.current {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.progress .sep {
  width: 12px;
  height: 1px;
  background: var(--border-strong);
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px;
  align-items: start;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.preview-panel {
  position: sticky;
  top: 84px;
}
.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.preview-toolbar .dots {
  display: flex;
  gap: 6px;
}
.preview-toolbar .dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
}
.preview-toolbar .controls {
  display: flex;
  gap: 8px;
  align-items: center;
}
.preview-toolbar select,
.seg button {
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
}
.seg {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 2px;
}
.seg button {
  border: none;
  background: transparent;
  padding: 5px 10px;
  color: var(--muted);
}
.seg button.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.preview-toolbar a.open {
  font-size: 12.5px;
  color: var(--muted);
}
.preview-toolbar a.open:hover {
  color: var(--ink);
}
.preview-stage {
  height: calc(100vh - 220px);
  min-height: 520px;
  background: var(--bg-grain);
  display: flex;
  justify-content: center;
  align-items: stretch;
}
.preview-stage iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
  transition: width 0.35s var(--ease);
}
.preview-stage.mobile iframe {
  width: 390px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  color: var(--muted);
  gap: 10px;
}
.placeholder h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  letter-spacing: -0.02em;
}
.placeholder p {
  margin: 0;
  font-size: 14px;
  max-width: 360px;
}
.spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
  margin-bottom: 8px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.skeleton {
  width: min(560px, 80%);
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.skeleton i {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--border) 0%, var(--surface) 50%, var(--border) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton i:nth-child(1) { width: 70%; height: 22px; }
.skeleton i:nth-child(2) { width: 90%; }
.skeleton i:nth-child(3) { width: 55%; }
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.side {
  display: grid;
  gap: 16px;
}
.side .panel {
  padding: 22px;
}
.side h3 {
  margin: 0 0 4px;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.side .sub {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--muted);
}
.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  font-size: 13.5px;
  margin-bottom: 18px;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
  text-align: right;
  word-break: break-word;
}
.big-price {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.big-price span {
  font-size: 13px;
  color: var(--muted);
}
.big-price strong {
  font-size: 26px;
  letter-spacing: -0.035em;
}
.includes {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: grid;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted-strong);
}
.includes li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 700;
  margin-right: 8px;
}
.agree {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 14px;
}
.agree a {
  text-decoration: underline;
}
.test-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning);
  margin-left: 6px;
  vertical-align: middle;
}
.alert {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 14px;
}
.alert.error {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
}
.alert.info {
  background: var(--info-soft);
  color: var(--info);
}

.thread {
  display: grid;
  gap: 12px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 16px;
}
.thread .item {
  display: grid;
  gap: 6px;
}
.thread .ver {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}
.thread .ver b {
  color: var(--ink);
  font-family: 'SF Mono', Menlo, monospace;
}
.thread .ver button {
  font-size: 12px;
  background: none;
  border: none;
  color: var(--muted);
  text-decoration: underline;
  padding: 0;
}
.thread .bubble {
  font-size: 13.5px;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.thread .bubble.me {
  background: var(--ink);
  color: var(--bg);
  justify-self: end;
  max-width: 90%;
}
.thread .bubble.ai {
  background: var(--bg-grain);
  border: 1px solid var(--border);
}
.thread .item.viewing .ver b::after {
  content: ' · 보는 중';
  color: var(--accent);
  font-family: var(--font-sans);
  font-weight: 500;
}

.feedback-form textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  font-family: inherit;
  font-size: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
  margin-bottom: 10px;
  transition: all 0.2s var(--ease);
}
.feedback-form textarea:focus {
  border-color: var(--ink);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--input-focus-ring);
}
.feedback-form .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.feedback-form .left {
  font-size: 12.5px;
  color: var(--muted);
}
.feedback-form .left b {
  color: var(--ink);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.chips button {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted-strong);
}
.chips button:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* Template picker */
.tpl-list {
  display: grid;
  gap: 8px;
}
.tpl-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  transition: all 0.15s var(--ease);
}
.tpl-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-grain);
}
.tpl-card.on {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}
.tpl-card .sw {
  display: flex;
  flex-shrink: 0;
}
.tpl-card .sw i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  margin-left: -6px;
  box-shadow: 0 0 0 1px var(--border);
}
.tpl-card .sw i:first-child {
  margin-left: 0;
}
.tpl-card .sw.sparkle {
  width: 42px;
  height: 18px;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 16px;
}
.tpl-card {
  cursor: pointer;
}
.tpl-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tpl-card .th {
  position: relative;
  flex-shrink: 0;
  width: 96px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-grain);
}
.tpl-card .th iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 800px;
  border: 0;
  transform: scale(0.075);
  transform-origin: 0 0;
  pointer-events: none;
}
.tpl-card .th.sparkle {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  border: none;
  background: conic-gradient(from 120deg, var(--accent), #7c3aed, #22d3ee, var(--accent));
}
.tpl-card .tx {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.tpl-card .tx b {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.tpl-card .tx small {
  font-size: 12px;
  color: var(--muted);
}
.tpl-card em {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  vertical-align: 1px;
}
.tpl-card em.plus {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.tpl-card.custom {
  margin-top: 12px;
  border-style: dashed;
}
.tpl-card.custom.on {
  border-style: solid;
}
.link-btn {
  background: none;
  border: none;
  padding: 10px 0 0;
  font-size: 13px;
  color: var(--muted-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover {
  color: var(--ink);
}
.custom-art {
  width: 120px;
  height: 120px;
  border-radius: 32px;
  margin-bottom: 12px;
  background: conic-gradient(from 120deg, var(--accent), #7c3aed, #22d3ee, var(--accent));
  filter: blur(0.5px);
  animation: spin 12s linear infinite;
  opacity: 0.9;
}

/* Template gallery */
.gallery-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 32px 96px;
}
.gallery-head {
  text-align: center;
  margin-bottom: 40px;
}
.gallery-head h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 5vw, 44px);
  letter-spacing: -0.04em;
}
.gallery-head p {
  margin: 0;
  color: var(--muted);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.g-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.g-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.g-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-grain);
  border-bottom: 1px solid var(--border);
}
.g-thumb iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 800px;
  border: none;
  transform-origin: 0 0;
  pointer-events: none;
}
.g-body {
  padding: 18px 20px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.g-body b {
  display: block;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.g-body small {
  color: var(--muted);
  font-size: 13px;
}
.g-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 0 20px 20px;
}
.g-actions a {
  padding: 10px 14px;
  font-size: 13px;
  white-space: nowrap;
}

/* Mock checkout */
.checkout {
  max-width: 420px;
}
.checkout .modal-body {
  display: grid;
  gap: 14px;
}
.card-visual {
  border-radius: 16px;
  padding: 22px;
  color: #fff;
  background: linear-gradient(135deg, #1f1f1f 0%, #3a3a3a 60%, var(--accent) 140%);
  font-family: 'SF Mono', Menlo, monospace;
  letter-spacing: 0.08em;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.card-visual .chip {
  width: 36px;
  height: 26px;
  border-radius: 6px;
  background: linear-gradient(135deg, #e8c66a, #b38b2e);
}

/* ==================== STATUS LOOKUP ==================== */
.lookup {
  max-width: 460px;
  margin: 72px auto;
  padding: 0 24px;
}
.lookup .panel {
  padding: 32px;
}
.lookup h1 {
  margin: 0 0 6px;
  font-size: 26px;
  letter-spacing: -0.035em;
}
.lookup p.sub {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}
.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}
.field label {
  font-size: 12.5px;
  color: var(--muted-strong);
  font-weight: 500;
}
.field input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
}
.field input:focus {
  border-color: var(--ink);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--input-focus-ring);
}
.result {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ==================== DOC PAGE ==================== */
.doc {
  max-width: 720px;
  margin: 56px auto 96px;
  padding: 0 24px;
}
.doc h1 {
  font-size: 30px;
  letter-spacing: -0.035em;
  margin: 0 0 8px;
}
.doc h2 {
  font-size: 18px;
  letter-spacing: -0.02em;
  margin: 36px 0 10px;
}
.doc p,
.doc li {
  color: var(--muted-strong);
  font-size: 14.5px;
}
.draft-banner {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 13.5px;
  margin: 20px 0 8px;
}

/* ==================== ADMIN EXTRAS ==================== */
.mode-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.mode-bar span {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted-strong);
}
.mode-bar span.warn {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: transparent;
}
.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: var(--bg-grain);
  border: 1px solid var(--border);
}
.tabs button {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
}
.tabs button.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.kind {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-grain);
  border: 1px solid var(--border);
  color: var(--muted-strong);
  white-space: nowrap;
}
.kind.instant {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-color: transparent;
}
.badge.awaiting_payment { background: var(--cancelled-bg); color: var(--muted-strong); }
.badge.awaiting_payment::before { background: var(--muted); }
.badge.paid,
.badge.generating { background: var(--info-soft); color: var(--info); }
.badge.paid::before,
.badge.generating::before { background: var(--info); }
.badge.generating::before { animation: pulse 1.2s infinite; }
.badge.review { background: var(--warning-soft); color: var(--warning); }
.badge.review::before { background: var(--warning); }
.badge.delivered { background: var(--success-soft); color: var(--success); }
.badge.delivered::before { background: var(--success); }
.badge.failed,
.badge.refunded { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.badge.failed::before,
.badge.refunded::before { background: var(--danger); }
.note {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  font-family: inherit;
  font-size: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
}
.note:focus {
  border-color: var(--ink);
  background: var(--surface);
}
.note-state {
  font-size: 12.5px;
  color: var(--muted);
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  max-width: min(360px, calc(100vw - 48px));
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s var(--ease);
  transition: opacity 0.5s, transform 0.5s;
}
.toast + .toast {
  bottom: 84px;
}
.toast.out {
  opacity: 0;
  transform: translateY(8px);
}
.admin-preview {
  width: 100%;
  height: 360px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  margin-top: 10px;
}
.sub-list {
  display: grid;
  gap: 6px;
  font-size: 13px;
}
.sub-list .row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.sub-list .row span:last-child {
  color: var(--muted);
  text-align: right;
}
.modal-section {
  margin-top: 22px;
}
.modal-section h4 {
  margin: 0 0 10px;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 980px) {
  .work-grid {
    grid-template-columns: 1fr;
  }
  .preview-panel {
    position: static;
  }
  .preview-stage {
    height: 70vh;
    min-height: 420px;
  }
}
@media (max-width: 720px) {
  .nav {
    padding: 16px 20px;
  }
  .hero {
    padding: 64px 20px 32px;
  }
  .hero h1 {
    font-size: 42px;
  }
  .chat {
    height: 540px;
    border-radius: var(--radius);
  }
  .chat-section {
    padding: 0 16px;
    margin-bottom: 48px;
  }
  .admin-wrap {
    padding: 32px 20px 64px;
  }
  .admin-title h2 {
    font-size: 24px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .orders-table {
    overflow-x: auto;
  }
  .orders-table table {
    min-width: 720px;
  }
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 4px 0;
  }
  .detail-grid .k {
    margin-top: 10px;
  }
  .plan-grid {
    grid-template-columns: 1fr;
  }
  .steps {
    grid-template-columns: 1fr 1fr;
    row-gap: 24px;
  }
  .work-wrap {
    padding: 20px 16px 48px;
  }
  .progress .sep {
    display: none;
  }
  .preview-stage.mobile iframe {
    width: 100%;
  }
  .nav .right .hide-sm {
    display: none;
  }
}

/* Admin: inline refund confirmation */
.refund-box {
  margin: -8px 0 20px;
  padding: 16px;
  border: 1px solid var(--danger);
  border-radius: 14px;
  background: color-mix(in srgb, var(--danger) 6%, var(--surface));
}
.refund-box label {
  display: block;
  font-size: 13px;
  margin-bottom: 8px;
}
.refund-box input.note {
  min-height: 0;
}
.refund-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.refund-row .note-state {
  margin-right: auto;
  color: var(--danger);
}
.refund-row button {
  padding: 8px 14px;
  font-size: 13px;
}
.btn-danger {
  border: 1px solid var(--danger);
  background: var(--danger);
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
}
.btn-danger:disabled {
  opacity: 0.6;
}

/* Workspace: "내용 입력" content form */
.content-panel h3 .opt {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 4px;
  vertical-align: middle;
}
.content-panel label {
  display: block;
}
.content-panel label > span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.content-panel input,
.content-panel textarea {
  width: 100%;
  font: inherit;
  font-size: 13.5px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  resize: vertical;
}
.content-panel input:focus,
.content-panel textarea:focus {
  outline: none;
  border-color: var(--ink);
}
.cf-basic {
  display: grid;
  gap: 10px;
  margin-bottom: 6px;
}
.cf-group {
  border-top: 1px solid var(--border);
  padding: 4px 0;
}
.cf-group summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
}
.cf-group summary::-webkit-details-marker {
  display: none;
}
.cf-group summary::after {
  content: '+';
  margin-left: auto;
  color: var(--muted);
  font-weight: 400;
}
.cf-group[open] summary::after {
  content: '−';
}
.cf-group summary em {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 1px 7px;
}
.cf-group .cf-basic {
  padding-bottom: 10px;
}
.cf-hint {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted);
}
.cf-rows {
  display: grid;
  gap: 8px;
}
.cf-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 34px 12px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.cf-row label.wide {
  grid-column: 1 / -1;
}
.cf-del {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.cf-del:hover {
  background: var(--border);
  color: var(--ink);
}
.cf-add {
  width: 100%;
  margin: 8px 0 10px;
  padding: 9px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.cf-add:hover {
  border-color: var(--ink);
}
.cf-state {
  min-height: 16px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}
.content-panel input::placeholder,
.content-panel textarea::placeholder {
  color: var(--muted);
  opacity: 0.5;
}

/* Workspace: 전문가에게 이어서 맡기기 */
.handoff.done {
  border-color: var(--accent);
}
.need-list {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}
.need {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.need:has(input:checked) {
  border-color: var(--ink);
  background: var(--surface);
}
.need input {
  margin-top: 3px;
  accent-color: var(--ink);
}
.need b {
  display: block;
  font-size: 13.5px;
}
.need small {
  color: var(--muted);
  font-size: 12px;
}
#handoff-msg {
  width: 100%;
  min-height: 80px;
  font: inherit;
  font-size: 13.5px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  resize: vertical;
}

/* Home: returning customers */
.hero .returning {
  display: block;
  width: fit-content;
  margin: 18px auto 0;
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hero .returning:hover {
  color: var(--ink);
}

/* Workspace: credit note + consultation history */
.credit {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  font-size: 13px;
  line-height: 1.5;
}
.chat-log summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}
.chat-log summary small {
  color: var(--muted);
  font-weight: 400;
  margin-left: 6px;
}
.chat-lines {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: 420px;
  overflow-y: auto;
}
.chat-lines .line {
  max-width: 88%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  background: var(--surface);
  border: 1px solid var(--border);
}
.chat-lines .line.me {
  justify-self: end;
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* Workspace: delivery — make the download impossible to miss */
.deliver-card {
  text-align: center;
  border: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}
.dc-badge {
  width: 52px;
  height: 52px;
  margin: 4px auto 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
}
.deliver-card h3 {
  font-size: 22px;
}
.btn-download,
.btn-finalize {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.btn-download:hover,
.btn-finalize:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 45%, transparent);
}
.btn-finalize {
  margin-top: 14px;
  font-size: 15px;
  padding: 14px;
}
.btn-finalize:disabled {
  opacity: 0.6;
  cursor: wait;
}
.btn-download svg,
.btn-finalize svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dc-tips {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}
.dc-tips li {
  padding-left: 14px;
  position: relative;
}
.dc-tips li::before {
  content: '·';
  position: absolute;
  left: 4px;
}
.dc-history {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}
.preview-toolbar .dl-top {
  margin-left: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
}

.chat-notice {
  margin: 0;
  padding: 10px 20px 14px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}
.chat-notice a {
  text-decoration: underline;
}

.agree .refund-note {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
