/* ───────── Reset & base ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font-sans); font-size: 16px; line-height: 1.65; letter-spacing: -0.012em;
  color: var(--color-text-primary); background: var(--color-bg-canvas); word-break: keep-all; overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--color-border-brand); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--color-bg-inverse); color: var(--color-text-inverse); padding: 10px 16px; border-radius: var(--radius-md); }
.skip-link:focus { top: 16px; }

/* ───────── Type scale (Figma 텍스트 스타일) ───────── */
.t-display { font-size: 72px; line-height: 1.15; font-weight: 700; letter-spacing: -0.025em; }
.t-h1 { font-size: 52px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
.t-h2 { font-size: 40px; line-height: 1.25; font-weight: 700; letter-spacing: -0.015em; }
.t-h3 { font-size: 28px; line-height: 1.35; font-weight: 600; letter-spacing: -0.01em; }
.t-h4 { font-size: 20px; line-height: 1.4; font-weight: 600; letter-spacing: -0.005em; }
.t-body-l { font-size: 18px; line-height: 1.65; }
.t-body-m { font-size: 16px; line-height: 1.65; }
.t-body-s { font-size: 14px; line-height: 1.55; }
.t-label-l { font-size: 16px; line-height: 1.4; font-weight: 600; }
.t-label-m { font-size: 14px; line-height: 1.4; font-weight: 600; }
.t-caption { font-size: 12px; line-height: 1.4; font-weight: 500; letter-spacing: 0; }
.t-overline { font-size: 12px; line-height: 1.4; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.c-secondary { color: var(--color-text-secondary); }
.c-brand { color: var(--color-text-brand); }
.c-inverse { color: var(--color-text-inverse); }
@media (max-width: 1023px) {
  .t-display { font-size: 52px; line-height: 1.2; }
}
@media (max-width: 599px) {
  .t-display { font-size: 40px; line-height: 1.25; letter-spacing: -0.02em; }
  .t-h1 { font-size: 32px; line-height: 1.3; }
  .t-h2 { font-size: 28px; line-height: 1.35; }
  .t-body-l { font-size: 16px; }
}

/* ───────── Layout ───────── */
.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--section-y) 0; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }

/* ───────── Button ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid transparent;
  border-radius: var(--radius-full); font-weight: 600; white-space: nowrap; transition: background-color .15s, color .15s, border-color .15s, transform .15s;
  height: 44px; padding: 0 24px; font-size: 14px; line-height: 1;
}
.btn-lg { height: 56px; padding: 0 32px; font-size: 16px; }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-lg svg { width: 20px; height: 20px; }
.btn-primary { background: var(--color-bg-brand); color: var(--color-text-on-brand); }
.btn-primary:hover { background: var(--color-bg-brand-hover); }
.btn-dark { background: var(--color-bg-inverse); color: var(--color-text-inverse); }
.btn-dark:hover { opacity: .88; }
.btn-outline { background: transparent; color: var(--color-text-primary); border-color: var(--color-border-strong); }
.btn-outline:hover { background: var(--color-bg-inverse); color: var(--color-text-inverse); }
.btn-light { background: var(--color-bg-surface); color: var(--color-text-primary); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.icon-btn {
  width: 44px; height: 44px; border-radius: var(--radius-full); display: inline-grid; place-items: center; flex: none;
  border: 1px solid var(--color-border-subtle); background: var(--color-bg-surface);
}
.icon-btn.ghost { border-color: transparent; background: transparent; }
.icon-btn svg { width: 22px; height: 22px; }
.link-underline { text-decoration: underline; text-underline-offset: 3px; }

/* ───────── Tag / Badge ───────── */
.tag { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: var(--radius-full); font-size: 12px; font-weight: 500; line-height: 1.4; white-space: nowrap; }
.tag-brand { background: var(--color-bg-brand-subtle); color: var(--color-text-brand); }
.tag-neutral { background: var(--color-bg-muted); color: var(--color-text-secondary); }
.tag-outline { border: 1px solid var(--color-border-default); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--radius-full); font-size: 12px; font-weight: 500; line-height: 1.4; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-new { background: var(--color-bg-brand-subtle); color: var(--color-text-brand); }
.badge-reviewing { background: var(--color-status-info-bg); color: var(--color-status-info-text); }
.badge-quoted { background: var(--color-bg-surface); color: var(--color-text-primary); box-shadow: inset 0 0 0 1px var(--color-border-strong); }
.badge-in_progress { background: var(--color-bg-inverse); color: var(--color-text-inverse); }
.badge-done { background: var(--color-status-success-bg); color: var(--color-status-success-text); }
.badge-on_hold { background: var(--color-bg-muted); color: var(--color-text-secondary); }

/* ───────── Form ───────── */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field-label { font-size: 14px; font-weight: 600; line-height: 1.4; }
.field-label .req { color: var(--color-text-brand); margin-left: 2px; }
.field-hint { font-size: 12px; color: var(--color-text-secondary); }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--color-border-default); background: var(--color-bg-surface); border-radius: var(--radius-md);
  padding: 0 16px; height: 52px; font-size: 16px; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 160px; padding: 14px 16px; resize: vertical; line-height: 1.6; }
.select { appearance: none; padding-right: 44px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23161616' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.input::placeholder, .textarea::placeholder { color: var(--color-text-secondary); opacity: .85; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--color-border-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-border-brand) 18%, transparent); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--color-border-brand); }
.field-error { font-size: 12px; color: var(--color-text-brand); font-weight: 500; }

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 20px; border-radius: var(--radius-full);
  border: 1px solid var(--color-border-default); background: var(--color-bg-surface); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.chip input:checked + span { background: var(--color-bg-inverse); color: var(--color-text-inverse); border-color: var(--color-bg-inverse); }
.chip input:checked + span::before { content: ""; width: 14px; height: 14px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat; }
.chip input:focus-visible + span { outline: 2px solid var(--color-border-brand); outline-offset: 2px; }
a.chip-link { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 20px; border-radius: var(--radius-full); border: 1px solid var(--color-border-default); background: var(--color-bg-surface); font-size: 14px; font-weight: 600; white-space: nowrap; }
a.chip-link[aria-current="true"] { background: var(--color-bg-inverse); color: var(--color-text-inverse); border-color: var(--color-bg-inverse); }

.checkbox { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: 14px; }
.checkbox input { width: 20px; height: 20px; margin: 0; accent-color: var(--color-bg-inverse); flex: none; }

.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 24px;
  border: 1.5px dashed var(--color-border-default); border-radius: var(--radius-md); background: var(--color-bg-canvas-subtle); cursor: pointer;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--color-border-brand); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone svg { width: 24px; height: 24px; color: var(--color-text-brand); }
.file-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.file-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 8px 12px; border: 1px solid var(--color-border-subtle); border-radius: var(--radius-sm); background: var(--color-bg-surface); }
.file-list li span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ───────── Pagination / Tabs ───────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; }
.pagination a, .pagination span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--radius-full); font-size: 14px; font-weight: 600; }
.pagination a:hover { background: var(--color-bg-muted); }
.pagination [aria-current="page"] { background: var(--color-bg-inverse); color: var(--color-text-inverse); }
.pagination .is-disabled { opacity: .35; }
.pagination svg { width: 20px; height: 20px; }

.tabs { display: flex; gap: 24px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--color-border-subtle); }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 6px; height: 48px; padding: 0 4px; font-size: 14px; font-weight: 600; color: var(--color-text-secondary); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; border-top: 0; border-left: 0; border-right: 0; }
.tab .count { font-size: 12px; font-weight: 500; }
.tab[aria-current="true"], .tab[aria-selected="true"] { color: var(--color-text-primary); border-bottom-color: var(--color-border-strong); }
.tab[aria-current="true"] .count { color: var(--color-text-brand); }

/* ───────── Placeholder image ───────── */
.ph { display: grid; place-items: center; background: var(--color-bg-surface); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-lg); color: var(--color-text-secondary); font-size: 14px; font-weight: 600; text-align: center; padding: 16px; overflow: hidden; position: relative; }
.ph.muted { background: var(--color-bg-muted); border-color: transparent; }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.notice { padding: 12px 16px; border-radius: var(--radius-md); font-size: 14px; }
.notice-ok { background: var(--color-status-success-bg); color: var(--color-status-success-text); }
.notice-error { background: var(--color-bg-brand-subtle); color: var(--color-text-brand); }


[hidden] { display: none !important; }
