/* 집문서 — "작업대": 종이 바탕 + 초록 커팅 매트 + 종이 서류 + 손그림 문구류 */
:root {
  --paper: #f6f1e7; --sheet: #fffdf7; --ink: #2a2622; --muted: #6f675e; --line: #d9d0c1; --line2: #c7bcaa;
  --acc: #2563eb; --acc-soft: rgba(37,99,235,.14); --acc-ink: #1d4ed8;
  --mat: #2e6a50; --mat-dark: #255a43; --mat-ink: #f3efe2; --mat-muted: #cfe3d6;
  --ok: #15803d; --bad: #c2410c; --warn: #b45309;
  --hand: "Gaegu", "Nanum Pen Script", cursive;
  --shadow: 0 1px 0 rgba(42,38,34,.08), 0 6px 14px -6px rgba(42,38,34,.35);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.3 0 0 0 0 0.22 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper) var(--noise); color: var(--ink); font-family: "Pretendard Variable", Pretendard, -apple-system, "Noto Sans KR", "Segoe UI", "Malgun Gothic", sans-serif; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; font-variant-numeric: tabular-nums; word-break: keep-all; overflow-wrap: anywhere; }
a { color: inherit; }
img { max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.hand { font-family: var(--hand); font-weight: 700; letter-spacing: 0; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
#home, #tool-view { overflow-x: clip; padding: 0 6px; margin: 0 -6px; }
:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }

nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand > span { display: flex; flex-direction: column; line-height: 1.05; font-weight: 800; font-size: 21px; letter-spacing: -.02em; }
.brand small { font-size: 15px; color: var(--muted); font-weight: 700; }
nav .links { display: flex; gap: 20px; font-size: 15px; color: var(--muted); }
nav .links a { text-decoration: none; padding: 8px 0; } nav .links a:hover { color: var(--ink); text-decoration: underline wavy var(--acc) 1.5px; text-underline-offset: 5px; }

/* 형광펜 밑줄 */
.marker { position: relative; z-index: 0; white-space: nowrap; }
.marker::after { content: ""; position: absolute; left: -4px; right: -6px; bottom: .02em; height: .5em; z-index: -1; mix-blend-mode: multiply;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 30' preserveAspectRatio='none'%3E%3Cpath d='M3 18 C40 9 80 22 120 13 S180 10 197 15 L196 27 C150 22 110 30 70 25 S20 28 4 28 Z' fill='%232563eb' fill-opacity='.32'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }

/* ───────── 히어로 ───────── */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; padding: 34px 0 44px; }
.hero-note { margin: 0 0 6px; font-size: 22px; color: var(--acc-ink); transform: rotate(-2deg); display: inline-block; }
h1 { font-size: clamp(40px, 6.4vw, 68px); line-height: 1.08; margin: 0 0 18px; letter-spacing: -.035em; font-weight: 850; }
.lead { color: var(--muted); font-size: 18px; margin: 0; max-width: 560px; }
.lead b { color: var(--ink); font-weight: 650; }

/* 커팅 매트 */
.mat { position: relative; background-color: var(--mat); border-radius: 14px; color: var(--mat-ink);
  background-image:
    linear-gradient(rgba(255,255,255,.16) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.16) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px; background-position: -1px -1px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.18), inset 0 0 0 7px var(--mat-dark), 0 2px 0 rgba(42,38,34,.15), 0 18px 30px -18px rgba(42,38,34,.55); }
.mat::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(120% 90% at 30% 0%, rgba(255,255,255,.06), transparent 60%); }
.ruler { position: absolute; left: 7px; right: 7px; height: 12px; pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.55) 0 1px, transparent 1px 12px), repeating-linear-gradient(90deg, rgba(255,255,255,.8) 0 1.5px, transparent 1.5px 120px);
  background-size: auto 6px, auto 12px; background-repeat: repeat-x; }
.ruler-top { top: 7px; }

.mat-mini { aspect-ratio: 5 / 4; overflow: hidden; }
.sheet { background: var(--sheet); color: var(--ink); border-radius: 3px; box-shadow: var(--shadow); position: relative; }
.hero-sheet { position: absolute; padding: 18px 18px; display: flex; flex-direction: column; gap: 9px; }
.hero-sheet .sheet-name { font-family: var(--hand); font-weight: 700; font-size: 19px; }
.hero-sheet i { display: block; height: 6px; border-radius: 3px; background: #e7e0d2; }
.hero-sheet i.short { width: 55%; }
.s1 { left: 12%; top: 13%; width: 46%; height: 66%; transform: rotate(-6deg); }
.s1::after { content: ""; position: absolute; right: 0; top: 0; border-style: solid; border-width: 0 22px 22px 0; border-color: var(--mat) #e9e1d0 transparent transparent; }
.s2 { right: 9%; top: 22%; width: 38%; height: 58%; transform: rotate(5deg); }
.photo-ph { flex: 1; border-radius: 2px; background: linear-gradient(160deg, #cfe0f5, #9fb9dc); position: relative; overflow: hidden; }
.photo-ph::after { content: ""; position: absolute; left: 50%; bottom: -12%; width: 52%; height: 70%; transform: translateX(-50%); border-radius: 50% 50% 0 0; background: #6d7f99; box-shadow: 0 -38px 0 -14px #6d7f99; }
.hero-stamp { position: absolute; left: 30%; bottom: 7%; width: 38%; color: var(--acc); transform: rotate(-14deg); mix-blend-mode: multiply; }
.hero-stamp svg { width: 100%; height: auto; display: block; }
.stamp text { font-family: "Pretendard Variable", Pretendard, sans-serif; }

/* ───────── 작업대(도구 목록) ───────── */
.bench-wrap { padding: 8px 0 56px; }
.bench { padding: 46px 30px 34px; }
.tape { display: inline-block; background: rgba(250, 240, 200, .82); color: var(--ink); padding: 3px 16px; box-shadow: 0 1px 2px rgba(0,0,0,.15); clip-path: polygon(2% 0, 98% 4%, 100% 100%, 0 96%); }
.bench-title { position: relative; margin: 0 0 22px; font-size: 22px; transform: rotate(-1.2deg); }
.tools { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 26px 22px; align-items: start; }
.tool-item { position: relative; display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 4px 14px; align-items: center; text-decoration: none; padding: 16px 18px 16px 12px; background: var(--sheet); color: var(--ink); border-radius: 3px; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; min-height: 118px; }
.tool-item .art { grid-row: 1 / span 2; width: 112px; height: 84px; color: var(--ink); }
.tool-item h3 { margin: 0; font-size: 18px; font-weight: 750; letter-spacing: -.02em; align-self: end; }
.tool-item p { margin: 0; font-size: 14px; color: var(--muted); align-self: start; line-height: 1.5; }
.tool-item:hover, .tool-item:focus-visible { transform: translateY(-4px) rotate(0deg) !important; box-shadow: 0 1px 0 rgba(42,38,34,.08), 0 16px 22px -10px rgba(0,0,0,.55); }
.tool-item:hover h3 { text-decoration: underline wavy var(--acc) 1.5px; text-underline-offset: 4px; }
/* 같은 카드가 줄지어 있지 않게: 크기·기울기·장식을 다르게 */
.tool-item:nth-child(1) { grid-column: span 5; transform: rotate(-1.4deg); }
.tool-item:nth-child(2) { grid-column: span 4; transform: rotate(1.2deg) translateY(10px); }
.tool-item:nth-child(3) { grid-column: span 3; grid-template-columns: minmax(0, 1fr); text-align: left; transform: rotate(-.6deg); }
.tool-item:nth-child(3) .art { grid-row: auto; }
.tool-item:nth-child(4) { grid-column: span 4; transform: rotate(.8deg); }
.tool-item:nth-child(5) { grid-column: span 4; transform: rotate(-1deg) translateY(8px); background: #fdf7e4; }
.tool-item:nth-child(6) { grid-column: span 4; transform: rotate(1.5deg); }
.tool-item:nth-child(7) { grid-column: 3 / span 6; transform: rotate(-.8deg) translateY(4px); }
.tool-item::before { content: ""; position: absolute; width: 70px; height: 20px; top: -9px; left: 50%; margin-left: -35px; background: rgba(250, 240, 200, .8); box-shadow: 0 1px 2px rgba(0,0,0,.12); transform: rotate(-3deg); clip-path: polygon(3% 0, 97% 6%, 100% 100%, 0 94%); }
.tool-item:nth-child(2)::before, .tool-item:nth-child(6)::before { left: auto; right: 14px; margin: 0; transform: rotate(8deg); width: 54px; }
.tool-item:nth-child(4)::before { display: none; }
.tool-item:nth-child(4)::after { content: ""; position: absolute; top: -12px; left: 22px; width: 14px; height: 40px; border: 2.5px solid #8b8f99; border-radius: 8px; border-bottom-color: transparent; }
.tool-item.new-badge .hand { color: var(--acc); }
.bench-memo { grid-column: 9 / span 4; align-self: center; margin: 0; color: var(--mat-ink); font-size: 20px; line-height: 1.35; transform: rotate(-3deg); opacity: .92; }
.bench-memo a { color: #fff; }

/* ───────── 신뢰 메모 ───────── */
.trust { display: grid; grid-template-columns: 1.5fr 1fr; gap: 36px; align-items: start; padding: 8px 0 56px; }
.note { position: relative; background: var(--sheet); padding: 34px 32px 26px; border-radius: 2px; box-shadow: var(--shadow); transform: rotate(-.4deg);
  background-image: linear-gradient(transparent 31px, #e6ecf5 31px, #e6ecf5 32px); background-size: 100% 32px; background-position: 0 14px; }
.note::before { content: ""; position: absolute; left: 26px; top: 0; bottom: 0; width: 1.5px; background: rgba(220, 80, 80, .35); }
.note > * { position: relative; margin-left: 12px; }
.note .tape-l, .note .tape-r { position: absolute; top: -10px; width: 90px; height: 24px; background: rgba(250, 240, 200, .85); box-shadow: 0 1px 2px rgba(0,0,0,.12); margin: 0; }
.note .tape-l { left: -14px; transform: rotate(-12deg); }
.note .tape-r { right: -14px; transform: rotate(10deg); }
.trust h2 { font-size: 30px; margin: 0 0 10px; letter-spacing: -.02em; line-height: 1.3; }
.circled { position: relative; display: inline-block; padding: 0 4px; }
.circled svg.rough-overlay { position: absolute; inset: -12px -14px; width: calc(100% + 28px); height: calc(100% + 24px); pointer-events: none; overflow: visible; }
.trust p { color: var(--muted); margin: 0 0 14px; line-height: 2; }
.trust p b { color: var(--ink); }
.steps { margin: 0 0 12px 12px; padding-left: 22px; line-height: 2; }
.memo { color: var(--acc-ink); font-size: 19px !important; line-height: 1.5 !important; }
kbd { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: #fff; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; }
.slip { position: relative; background: var(--sheet); padding: 22px 22px 18px; box-shadow: var(--shadow); transform: rotate(1.6deg); margin-top: 26px;
  -webkit-mask: radial-gradient(circle 6px at 50% 100%, transparent 98%, #000) 0 0 / 14px 100% repeat-x; mask: radial-gradient(circle 6px at 50% 100%, transparent 98%, #000) 0 0 / 14px 100% repeat-x; padding-bottom: 28px; }
.slip-h { margin: 0 0 10px; font-size: 22px; border-bottom: 2px dashed var(--line2); padding-bottom: 6px; }
.slip dl { margin: 0; }
.slip dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.slip dt { color: var(--muted); font-size: 14px; }
.slip dd { margin: 0; font-weight: 700; text-align: right; font-size: 14px; }
.slip dd.big { font-size: 26px; color: var(--acc); font-weight: 850; }

footer { border-top: 2px dashed var(--line2); padding: 24px 0 44px; color: var(--muted); font-size: 13px; }
footer p { margin: 4px 0; }
footer a { color: var(--ink); }
.other-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; }
.other-tools a { text-decoration: none; font-size: 14px; padding: 8px 14px; border: 1.5px solid var(--ink); border-radius: 999px 999px 999px 999px / 900px 999px 950px 999px; background: var(--sheet); color: var(--ink); min-height: 40px; display: inline-flex; align-items: center; }
.other-tools a:hover { background: var(--acc-soft); }

/* ───────── 도구 화면 ───────── */
.tool { padding: 6px 0 48px; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--muted); text-decoration: none; margin-bottom: 8px; padding: 8px 0; }
.back:hover { color: var(--ink); }
.tool-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; margin-bottom: 18px; }
.tool-head .art { width: 120px; height: 90px; color: var(--ink); }
.tool-head h1 { font-size: clamp(28px, 4.2vw, 40px); margin: 0; line-height: 1.15; }
.tool-head p { margin: 4px 0 0; color: var(--muted); }
.head-stamp { width: 104px; color: var(--acc); transform: rotate(-12deg); mix-blend-mode: multiply; }
.head-stamp svg { width: 100%; height: auto; display: block; }
.work { padding: 28px 24px 26px; }
.work .promise { margin: 0 0 16px; font-family: var(--hand); font-size: 19px; color: var(--mat-ink); display: flex; gap: 8px; align-items: center; }
.work .promise svg { width: 20px; height: 20px; flex: none; }

/* 드롭존: 매트 위 빈 자리 */
.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; border-radius: 10px; padding: 40px 20px; cursor: pointer; color: var(--mat-ink); transition: background .15s; min-height: 180px; }
.drop:hover, .drop.over { background: rgba(255,255,255,.08); }
.drop .rough-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.drop:not(.sketched) { outline: 2px dashed rgba(255,255,255,.55); outline-offset: -2px; }
.drop.compact { padding: 14px; flex-direction: row; gap: 10px; min-height: 64px; }
.drop.compact .drop-sub { display: none; }
.drop .drop-ico { width: 74px; height: 56px; color: var(--mat-ink); }
.drop.compact .drop-ico { width: 34px; height: 26px; }
.drop-title { font-weight: 700; font-size: 18px; }
.drop.compact .drop-title { font-size: 15px; }
.drop-sub { color: var(--mat-muted); font-size: 14px; font-family: var(--hand); font-size: 18px; font-weight: 700; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* 종이 서류 패널 */
.panel { position: relative; background: var(--sheet); color: var(--ink); border-radius: 3px; padding: 18px; margin-top: 18px; min-width: 0; box-shadow: var(--shadow); }
.panel::before { content: ""; position: absolute; top: -9px; left: 28px; width: 76px; height: 20px; background: rgba(250, 240, 200, .85); transform: rotate(-4deg); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; }
.panel-head h2 { font-family: var(--hand); font-size: 23px; margin: 0; font-weight: 700; }
.muted { color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 16px; border-radius: 10px 12px 9px 11px; font-weight: 700; font-size: 15px; text-decoration: none; border: 2px solid var(--ink); background: var(--sheet); color: var(--ink); cursor: pointer; white-space: nowrap; box-shadow: 2px 2px 0 var(--ink); transition: transform .1s, box-shadow .1s, background .12s; }
.btn:hover:not(:disabled) { background: #fff; transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.btn:active:not(:disabled) { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn.primary { background: var(--acc); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--acc-ink); }
.btn.big { padding: 12px 24px; font-size: 17px; min-height: 52px; }
.btn.sm { min-height: 40px; padding: 6px 12px; font-size: 14px; box-shadow: 1.5px 1.5px 0 var(--ink); border-width: 1.5px; }
.btn.ghost { box-shadow: none; border-style: dashed; background: transparent; }
.btn svg { width: 17px; height: 17px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; border: 1.5px solid var(--line2); background: var(--sheet); cursor: pointer; padding: 0; color: var(--ink); flex: none; }
.icon-btn:hover:not(:disabled) { border-color: var(--ink); background: #fff; }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.danger:hover:not(:disabled) { color: var(--bad); border-color: var(--bad); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }

/* 파일 = 종이 한 장 */
.flist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.fitem { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 2px; background: #fff; min-width: 0; box-shadow: 0 1px 0 var(--line), 0 3px 0 -1px #f1ece0, 0 4px 0 -1px var(--line); }
.fitem::after { content: ""; position: absolute; right: -1px; top: -1px; border-style: solid; border-width: 0 14px 14px 0; border-color: var(--sheet) #e8e0cf transparent transparent; }
.fitem.dragging { opacity: .4; }
.fitem.drop-before { box-shadow: 0 -4px 0 var(--acc); }
.fitem.drop-after { box-shadow: 0 4px 0 var(--acc); }
.handle { cursor: grab; color: var(--muted); display: grid; place-items: center; width: 20px; flex: none; }
.handle svg { width: 16px; height: 16px; }
.fnum { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--acc); color: var(--acc); font-family: var(--hand); font-size: 18px; font-weight: 700; display: grid; place-items: center; flex: none; line-height: 1; }
.fthumb { width: 46px; height: 46px; border-radius: 2px; object-fit: cover; background: #eee7da; flex: none; border: 3px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.fmeta { flex: 1; min-width: 0; }
.fname { font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fsub { font-size: 13px; color: var(--muted); }
.fsub .bad, .bad { color: var(--bad); }
.fbtns { display: flex; gap: 4px; flex: none; }

/* 페이지 썸네일 = 매트 위 종이 */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
.thumb { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 3px; background: #f3eee3; min-width: 0; user-select: none; -webkit-user-select: none; border: 2px solid transparent; }
.thumb.selectable { cursor: pointer; }
.thumb.sel { border-color: var(--acc); background: #e8efff; }
.thumb.dragging { opacity: .4; }
.thumb.drop-before { box-shadow: -5px 0 0 var(--acc); }
.thumb.drop-after { box-shadow: 5px 0 0 var(--acc); }
.tbox { aspect-ratio: 3 / 4; display: grid; place-items: center; overflow: hidden; }
.tbox canvas, .tbox img { max-width: 100%; max-height: 100%; display: block; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2), 0 4px 10px -4px rgba(0,0,0,.35); }
.tbox .ph { width: 70%; height: 80%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.tlabel { display: flex; align-items: center; justify-content: space-between; gap: 4px; font-size: 13px; color: var(--muted); min-height: 22px; }
.tlabel b { color: var(--ink); font-family: var(--hand); font-size: 19px; }
.check { position: absolute; top: 12px; left: 12px; width: 26px; height: 26px; border-radius: 6px; border: 2px solid var(--ink); background: #fff; display: grid; place-items: center; z-index: 1; }
.thumb.sel .check { background: var(--acc); border-color: var(--acc); }
.check svg { width: 15px; height: 15px; color: #fff; opacity: 0; }
.thumb.sel .check svg { opacity: 1; }
.tbtns { display: flex; justify-content: space-between; gap: 2px; flex-wrap: wrap; }
.tbtns .icon-btn { width: 36px; height: 36px; flex: 1 0 36px; max-width: 44px; }
.rot-badge { position: absolute; top: 12px; right: 12px; font-family: var(--hand); font-size: 16px; font-weight: 700; color: #fff; background: var(--acc); border-radius: 99px; padding: 0 8px; z-index: 1; }

/* 옵션 */
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px 20px; }
.opt label, .opt .lbl { display: block; font-family: var(--hand); font-size: 19px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; max-width: 100%; }
.seg button { min-height: 40px; border: 1.5px solid var(--line2); background: #fff; padding: 6px 13px; border-radius: 8px 10px 8px 9px; font-size: 14px; font-weight: 650; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--acc); border-color: var(--acc); color: #fff; }
.seg button:disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.input { width: 100%; min-height: 44px; padding: 9px 12px; border-radius: 6px; border: none; border-bottom: 2px solid var(--ink); background: #faf6ec; outline: none; font-size: 16px; }
.input:focus { border-bottom-color: var(--acc); background: #fff; }
.input.num { width: 110px; }
input[type="range"] { width: 100%; accent-color: var(--acc); min-height: 32px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.hint.bad { color: var(--bad); }
.color { width: 44px; height: 40px; padding: 2px; border-radius: 8px; border: 1.5px solid var(--line2); background: #fff; cursor: pointer; }

/* 진행 · 알림 (매트 위 종이 띠) */
.progress { margin-top: 18px; background: var(--sheet); color: var(--ink); padding: 12px 14px; border-radius: 3px; box-shadow: var(--shadow); }
.bar { height: 10px; border-radius: 99px; background: #e9e2d4; overflow: hidden; border: 1.5px solid var(--ink); }
.bar > i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(-45deg, var(--acc) 0 8px, #3b82f6 8px 16px); transition: width .2s; }
.bar.indet > i { width: 35% !important; animation: indet 1.1s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.ptext { font-size: 14px; color: var(--muted); margin-top: 6px; }
.alert { margin-top: 16px; padding: 12px 16px 12px 44px; border-radius: 3px; background: #fff3e8; color: #7c2d12; font-size: 15px; white-space: pre-line; position: relative; box-shadow: var(--shadow); }
.alert::before { content: "!"; position: absolute; left: 14px; top: 11px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid currentColor; display: grid; place-items: center; font-weight: 900; font-size: 13px; line-height: 1; }
.alert.info { background: #eef3ff; color: #1e3a8a; }
.alert.info::before { content: "i"; font-family: Georgia, serif; }
.panel .alert { box-shadow: none; border: 1.5px dashed currentColor; }

/* 결과 = 완성된 서류 + 도장 */
.result { position: relative; margin-top: 18px; background: var(--sheet); color: var(--ink); border-radius: 3px; padding: 20px 20px 16px; box-shadow: 0 1px 0 rgba(42,38,34,.08), 0 3px 0 -1px #f1ece0, 0 4px 0 -1px var(--line), 0 10px 18px -8px rgba(0,0,0,.45); }
.result h2 { font-size: 20px; margin: 0 110px 12px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.result h2 svg { width: 22px; height: 22px; color: var(--ok); flex: none; }
.result .res-stamp { position: absolute; right: 14px; top: -18px; width: 96px; color: var(--acc); transform: rotate(12deg); mix-blend-mode: multiply; pointer-events: none; }
.result .res-stamp svg { width: 100%; height: auto; display: block; }
.ritem { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1.5px dashed var(--line); min-width: 0; }
.ritem:first-of-type { border-top: 0; }
.pill { display: inline-block; font-size: 13px; font-weight: 800; padding: 0 8px; border-radius: 99px; }
.pill.good { background: rgba(21,128,61,.12); color: var(--ok); }
.pill.bad { background: rgba(194,65,12,.12); color: var(--bad); }

/* EXIF 칩 = 메모 딱지 */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.chip { font-size: 13px; padding: 1px 9px; border-radius: 3px; background: #f3eee3; border: 1px solid var(--line); color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.gps { background: #ffe9a8; border-color: #e0b843; font-weight: 800; color: #7c4a03; }
.chip.clean { background: #e3f4e7; border-color: #9fd3ad; color: var(--ok); font-weight: 700; }

/* 배경 지우기 */
.bg-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bg-pane { min-width: 0; }
.bg-pane .lbl { font-family: var(--hand); font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.bg-view { aspect-ratio: 1; border: 6px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); display: grid; place-items: center; overflow: hidden; background: #efe9dc; }
.bg-view img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.checker { background-color: #fff; background-image: linear-gradient(45deg, #e4ddcf 25%, transparent 25%), linear-gradient(-45deg, #e4ddcf 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e4ddcf 75%), linear-gradient(-45deg, transparent 75%, #e4ddcf 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px) rotate(-1deg); background: #fff8d6; color: var(--ink); padding: 10px 18px; font-size: 15px; box-shadow: 0 8px 18px -6px rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0) rotate(-1deg); }

@media (max-width: 900px) {
  .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-item:nth-child(n) { grid-column: auto; }
  .tool-item:nth-child(3) { grid-template-columns: 112px minmax(0, 1fr); }
  .tool-item:nth-child(3) .art { grid-row: 1 / span 2; }
  .tool-item:nth-child(7) { grid-column: auto; }
  .bench-memo { grid-column: auto; }
  .trust { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .slip { margin-top: 0; max-width: 420px; }
}
@media (max-width: 820px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 18px 0 32px; }
  .hero-desk { max-width: 460px; }
  nav .links { display: none; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .lead { font-size: 16px; }
  .tools { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .bench { padding: 38px 14px 22px; }
  .tool-item { grid-template-columns: 84px minmax(0, 1fr) !important; padding: 12px 12px 12px 8px; min-height: 0; }
  .tool-item .art { width: 84px; height: 63px; }
  .tool-item h3 { font-size: 17px; }
  .tool-item p { font-size: 13px; }
  .tool-item:nth-child(n) { transform: rotate(0deg); }
  .tool-item:nth-child(odd) { transform: rotate(-.8deg); }
  .tool-item:nth-child(even) { transform: rotate(.8deg); }
  .bench-title { font-size: 18px; }
  .mat-mini { aspect-ratio: 16 / 10; }
  .hero-sheet { padding: 12px; gap: 6px; }
  .hero-sheet .sheet-name { font-size: 16px; }
  .note { padding: 30px 18px 20px; }
  .note::before { left: 14px; }
  .note > * { margin-left: 6px; }
  .trust h2 { font-size: 25px; }
  .tool-head { grid-template-columns: 80px minmax(0, 1fr); gap: 12px; }
  .tool-head .art { width: 80px; height: 60px; }
  .head-stamp { display: none; }
  .work { padding: 22px 12px 18px; }
  .panel { padding: 14px 12px; }
  .thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .bg-stage { grid-template-columns: minmax(0, 1fr); }
  .fitem { gap: 8px; padding: 8px; flex-wrap: wrap; }
  .fitem .fmeta { flex: 1 1 140px; }
  .fbtns { margin-left: auto; }
  .btn.big { width: 100%; }
  .result h2 { margin-right: 70px; font-size: 18px; }
  .result .res-stamp { width: 72px; top: -14px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
