/* Hallmark · scope: app · theme: custom (ckpartners.kr home tokens · bone paper · forest green) · genre: editorial · shape: list-first tool shelf · signature: one plain list of tools, each saying 무료 */
/* critique: P4 H4 E4 S5 R5 V4 — read by shop owners of every age: 18px body, 52px buttons, one task per screen */

/*
 * 사장님 도구 모음 공통 스타일
 * - 색: 홈(ckpartners.kr)의 종이색과 숲 초록 한 계열. 포인트는 초록 하나.
 * - 글씨: 제목 Hahmlet, 본문 IBM Plex Sans KR (홈과 같은 짝). 홈은 Google Fonts에서
 *   불러오지만 도구 페이지는 외부 요청을 만들지 않으려고 같은 파일을 자체 호스팅합니다.
 * - 크기: 본문 18px, 작은 글씨도 16px 아래로 내리지 않습니다. */

:root {
  color-scheme: light;

  /* 홈 tokens.css와 같은 값 */
  --paper: oklch(98.2% 0.005 92);
  --paper-2: oklch(96.2% 0.007 92);
  --field: oklch(99.6% 0.002 92);
  --rule: oklch(88% 0.01 92);
  --rule-strong: oklch(72% 0.014 90);
  /* 입력칸 테두리: 종이 바탕과 3:1 이상 */
  --field-edge: oklch(58% 0.016 90);
  --ink: oklch(23% 0.03 152);
  --ink-2: oklch(36% 0.02 150);
  --muted: oklch(45% 0.015 150);
  --brand: oklch(39.3% 0.065 153);
  --brand-deep: oklch(30% 0.06 153);
  --brand-wash: oklch(39.3% 0.065 153 / 0.08);
  --on-brand: oklch(98.2% 0.005 92);
  --danger: oklch(45% 0.14 33);
  --focus: oklch(45% 0.1 153);
  --shade: oklch(23% 0.03 152 / 0.12);
  --grid-line: oklch(100% 0 0 / 0.7);
  --grid-edge: oklch(0% 0 0 / 0.08);

  --font-display: "Hahmlet", ui-serif, "Apple SD Gothic Neo", serif;
  --font-body: "IBM Plex Sans KR", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;

  --text-sm: 16px;
  --text-base: 18px;
  --text-md: 20px;
  --text-lg: 24px;
  --text-xl: 30px;

  --radius: 8px;
  --gutter: 20px;
  --measure: 720px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  text-wrap: balance;
  overflow-wrap: break-word;
  min-width: 0;
}

p {
  text-wrap: pretty;
}

/* hidden 속성이 .field·.btn 의 display 에 덮이지 않게 */
[hidden] {
  display: none !important;
}

img,
canvas {
  max-width: 100%;
}

a {
  color: var(--brand);
  text-underline-offset: 4px;
}

a:hover {
  color: var(--brand-deep);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.num {
  font-variant-numeric: tabular-nums;
}

/* ── 머리 ─────────────────────────────────────────────── */

.top {
  border-bottom: 1px solid var(--rule);
}

.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}

.top__home {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.top__home b {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-md);
}

.top__home span {
  color: var(--muted);
  font-size: var(--text-sm);
}

.top__home:hover b {
  color: var(--brand);
}

.top__back {
  font-size: var(--text-sm);
  color: var(--ink-2);
  white-space: nowrap;
  padding: 12px 0;
}

/* ── 본문 머리 ────────────────────────────────────────── */

.head {
  padding: 32px 0 8px;
}

.head h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xl);
  line-height: 1.3;
  margin: 0 0 12px;
}

.head p {
  margin: 0 0 8px;
  color: var(--ink-2);
}

/* 신뢰 문구: 상자나 색 바탕 없이, 제목 아래 한 문장 */
.trust {
  margin: 12px 0 0;
  color: var(--brand-deep);
  font-size: var(--text-sm);
  font-weight: 600;
}

.head p.trust {
  color: var(--brand-deep);
}

@media (min-width: 720px) {
  .head {
    padding-top: 48px;
  }
  .head h1 {
    font-size: 40px;
  }
}

/* ── 섹션 ─────────────────────────────────────────────── */

.section {
  padding: 24px 0;
  border-top: 1px solid var(--rule);
}

.section:first-of-type {
  border-top: 0;
}

.section h2,
.h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  line-height: 1.35;
  margin: 0 0 12px;
}

.h2--form {
  margin-top: 32px;
}

.section h3 {
  font-size: var(--text-md);
  margin: 0 0 8px;
}

.note {
  font-size: var(--text-sm);
  color: var(--muted);
  margin: 8px 0 0;
}

.note--lead {
  margin: -4px 0 16px;
}

/* ── 도구 목록 (첫 화면) ──────────────────────────────── */

.tool-group + .tool-group {
  margin-top: 32px;
}

.tool-group__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  margin: 0 0 8px;
}

.tool-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule-strong);
}

.tool-list li {
  border-bottom: 1px solid var(--rule);
}

/* 목록 끝은 다음 섹션의 선이 닫습니다 (선 두 줄 방지) */
.tool-group:last-child .tool-list li:last-child {
  border-bottom: 0;
}

/* 한 줄 전체가 눌리는 자리. 이름은 링크처럼 밑줄, '무료'는 오른쪽 */
.tool-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 16px;
  align-items: baseline;
  padding: 20px 0;
  color: var(--ink);
  text-decoration: none;
}

.tool-link__name {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--brand);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

.tool-link__price {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tool-link__line {
  grid-column: 1 / -1;
  color: var(--ink-2);
}

.tool-link:hover .tool-link__name {
  color: var(--brand-deep);
  text-decoration-thickness: 2px;
}

.tool-link:active {
  background: var(--brand-wash);
}

.tool-link:focus-visible {
  outline-offset: 4px;
}

/* 휴대폰: 줄 전체가 링크지만 눌러도 되는 곳인지 바로 보이도록 '바로 쓰기' 버튼 모양을 둡니다.
   링크 안이라 <span> 이고, 이름과 겹쳐 읽히지 않게 aria-hidden 입니다. 넓은 화면에서는 숨깁니다. */
.tool-link__go {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 12px;
}

.tool-link:hover .tool-link__go {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
}

@media (min-width: 720px) {
  /* .btn 이 아래에서 display 를 다시 정하므로 한 단계 더 좁혀 씁니다 */
  .tool-link .tool-link__go {
    display: none;
  }
  .tool-link {
    padding: 24px 0;
  }
  .tool-link__name {
    font-size: 22px;
  }
}

/* 가격 줄 */
.price-list {
  margin: 0;
  border-top: 1px solid var(--rule-strong);
}

.price-list > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}

.price-list dt {
  min-width: 0;
}

.price-list dd {
  margin: 0 0 0 auto;
  text-align: right;
  white-space: nowrap;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ── 버튼 ─────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 8px 20px;
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  background: var(--brand);
  color: var(--on-brand);
  font: inherit;
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.btn:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: var(--on-brand);
}

.btn:active {
  transform: translateY(1px);
}

.btn--line {
  background: var(--field);
  color: var(--brand);
}

.btn--line:hover {
  background: var(--brand-wash);
  border-color: var(--brand);
  color: var(--brand-deep);
}

.btn--quiet {
  background: var(--field);
  border-color: var(--rule-strong);
  color: var(--ink);
  font-weight: 500;
}

.btn--quiet:hover {
  background: var(--paper-2);
  border-color: var(--ink-2);
  color: var(--ink);
}

.btn--small {
  min-height: 48px;
  padding: 8px 16px;
  font-size: 17px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  background: var(--paper-2);
  border-color: var(--rule);
  color: var(--muted);
  cursor: not-allowed;
  transform: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-row--stack .btn {
  flex: 1 1 100%;
}

@media (min-width: 560px) {
  .btn-row--stack .btn {
    flex: 1 1 auto;
  }
}

/* ── 입력 ─────────────────────────────────────────────── */

.field {
  display: block;
  margin: 0 0 20px;
}

.field > span,
.field-label {
  display: block;
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 8px;
}

.field small {
  display: block;
  color: var(--muted);
  font-size: var(--text-sm);
  margin-top: 4px;
}

input[type="text"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="password"],
select,
textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px;
  border: 1px solid var(--field-edge);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-base);
  line-height: 1.3;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--ink-2);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--paper-2);
  color: var(--muted);
}

textarea {
  min-height: 104px;
  resize: vertical;
  line-height: 1.55;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
  min-height: 36px;
}

.grid-2 {
  display: grid;
  gap: 0 16px;
}

@media (min-width: 560px) {
  .grid-2 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* 체크 상자 */
.check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: 0 0 12px;
  font-size: 17px;
  cursor: pointer;
}

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

/* 큰 선택 버튼(라디오). 알약 대신 네모 버튼 */
.choice {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.choice legend {
  float: left;
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 8px;
  padding: 0;
  width: 100%;
}

.choice label {
  position: relative;
}

.choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.choice label span {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 8px 16px;
  border: 1px solid var(--field-edge);
  border-radius: var(--radius);
  background: var(--field);
  font-size: 17px;
  line-height: 1.3;
}

.choice input:hover + span {
  border-color: var(--brand);
}

.choice input:checked + span {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
}

.choice input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* 파일 올리기 */
.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  min-height: 160px;
  padding: 24px;
  border: 2px dashed var(--rule-strong);
  border-radius: var(--radius);
  background: var(--field);
  cursor: pointer;
}

.drop:hover,
.drop.is-over {
  border-color: var(--brand);
  background: var(--brand-wash);
}

.drop:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.drop strong {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 8px 20px;
  border-radius: var(--radius);
  background: var(--brand);
  color: var(--on-brand);
  font-size: var(--text-base);
}

.drop span {
  color: var(--ink-2);
}

.drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* 미리보기 판 */
.preview {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}

.preview canvas,
.preview img {
  display: block;
  margin: 0 auto;
  height: auto;
  border: 1px solid var(--rule);
  background: var(--field);
}

/* 고정 하단 작업 줄 (휴대폰에서 저장 버튼이 늘 보이게) */
.actionbar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--rule);
}

/* ── 공통 하단 띠 ─────────────────────────────────────── */

.band {
  margin-top: 48px;
  padding: 32px 0 8px;
  border-top: 2px solid var(--ink);
}

.band h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  margin: 0 0 12px;
}

.band__others {
  list-style: none;
  margin: 0 0 40px;
  padding: 0;
  border-top: 1px solid var(--rule-strong);
}

.band__others li {
  border-bottom: 1px solid var(--rule);
}

.band__others a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  min-height: 56px;
  padding: 12px 0;
  color: var(--brand);
  text-decoration: none;
}

.band__others a span:first-child {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.band__others a span + span {
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
}

.band__others a:hover span:first-child {
  color: var(--brand-deep);
  text-decoration-thickness: 2px;
}

.band__others a:active {
  background: var(--brand-wash);
}

/* 소식방 · 문의 · 공유: 같은 모양 세 칸 대신, 문장과 버튼이 한 줄씩 */
.band__box {
  margin: 0 0 32px;
  border-top: 1px solid var(--rule-strong);
}

.band__item {
  display: grid;
  gap: 12px;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}

.band__item p {
  margin: 0;
  color: var(--ink-2);
}

.band__item .btn {
  width: 100%;
}

@media (min-width: 640px) {
  .band__item {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: center;
    gap: 24px;
  }
}

.foot {
  padding: 20px 0 48px;
  font-size: var(--text-sm);
  color: var(--muted);
}

.foot p {
  margin: 0 0 8px;
}

/* ── 알림 ─────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 50;
  max-width: calc(100% - 40px);
  padding: 12px 20px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--on-brand);
  font-size: 17px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.toast.is-on {
  opacity: 1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
  .btn:active {
    transform: none;
  }
}

.top .btn {
  white-space: nowrap;
}
