/* murang — 뜨개 도안 · © 2026 murang. All rights reserved. */
:root {
  color-scheme: light;
  --bg: #f9f6f1;
  --surface: #fffdfa;
  --stage: #efeae1;
  --ink: #2e2a26;
  --muted: #8b8379;
  --line: #e7e0d5;
  --accent: #2e2a26;          /* 강조도 같은 먹색 */
  --accent-soft: #ebe5da;
  --accent-ink: #fffdfa;
  --mark: #e4572e;            /* 뜨기 화면에서 지금 코를 가리키는 표시 색 */
  --ok: #5c7a63;
  --danger: #b4513c;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(60, 45, 25, .05), 0 8px 22px rgba(60, 45, 25, .07);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 "Pretendard", system-ui, -apple-system, "Noto Sans KR", "Malgun Gothic", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; }
h1 { font-size: 26px; letter-spacing: -.02em; }
h2 { font-size: 19px; letter-spacing: -.01em; }
h3 { font-size: 13px; font-weight: 600; color: var(--muted); }

button, input, select { font: inherit; color: inherit; }
button {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s;
}
button:hover { border-color: #cfc2ae; background: #fff; }
button:disabled { opacity: .4; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.primary:hover { background: #4a443e; }
button.ok { border-color: var(--ok); color: var(--ok); font-weight: 600; }
button.danger { color: var(--danger); }
button.ghost { border-color: transparent; background: transparent; color: var(--muted); padding-inline: 8px; }
button.big { padding: 12px 22px; font-size: 16px; border-radius: 999px; box-shadow: var(--shadow); }
button.toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
input[type="number"], input[type="text"], input[type="password"], input[type="search"], select {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  min-width: 0;
}
input[type="number"] { width: 68px; }
input[type="color"] { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: none; cursor: pointer; }
input[type="checkbox"], input[type="range"] { accent-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.spacer { flex: 1; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.err { margin: 0; font-size: 13px; color: var(--danger); min-height: 1.2em; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 13px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; }
kbd { padding: 0 5px; margin: 0 1px; border: 1px solid var(--line); border-radius: 5px; background: #fff; font: 11px ui-monospace, monospace; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--stage); }
.seg button { flex: 1; border: 0; border-radius: 9px; padding: 6px 12px; background: transparent; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(60, 40, 20, .15); }

.bar { height: 6px; border-radius: 999px; background: var(--stage); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--accent); transition: width .2s; }

/* 상단 */
.top {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
}
.top { position: relative; }
#homeNav { position: absolute; left: 50%; transform: translateX(-50%); }
.brand { border: 0; padding: 4px 2px; background: none; font-weight: 800; font-size: 19px; letter-spacing: -.03em; }
.brand:hover { background: none; color: var(--accent); }
#patternName { flex: 0 1 220px; border-color: transparent; background: transparent; font-weight: 600; }
#patternName:hover, #patternName:focus { border-color: var(--line); background: #fff; }
.sync { font-size: 12px; color: var(--muted); white-space: nowrap; }
.sync[data-state="error"], .sync[data-state="offline"] { color: var(--danger); }
body:not([data-mode="edit"]):not([data-mode="track"]) .only-work,
body[data-mode="edit"] .only-home, body[data-mode="track"] .only-home { display: none; }
body[data-mode="archive"] #tabArchive, body[data-mode="library"] #tabLib { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(60, 40, 20, .15); }
body[data-mode="edit"] #tabEdit, body[data-mode="track"] #tabTrack { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(60, 40, 20, .15); }

/* 내 도안 */
.library { flex: 1; min-height: 0; overflow-y: auto; display: none; }
body[data-mode="library"] #library, body[data-mode="archive"] #archive, body[data-mode="account"] #account, body[data-mode="admin"] #admin, body[data-mode="contact"] #contact { display: block; }
body:not([data-mode="edit"]):not([data-mode="track"]) main { display: none; }
.library > * { max-width: 1120px; margin-inline: auto; padding-inline: 20px; }
.lib-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: 18px; }
.lib-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-bottom: 16px; }
.lib-bar input[type="search"] { width: 170px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border-radius: 999px; padding: 6px 14px; color: var(--muted); }
.chips button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; padding-bottom: 40px; }
.lib-card { position: relative; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.lib-open { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 10px 10px 12px; border: 0; border-radius: var(--radius); background: none; text-align: left; white-space: normal; }
.lib-open:hover { background: #fff; }
.lib-thumb { display: flex; align-items: center; justify-content: center; height: 170px; padding: 10px; border-radius: 10px; background: var(--stage); }
.lib-thumb canvas { max-width: 100%; max-height: 100%; image-rendering: pixelated; border-radius: 2px; box-shadow: 0 1px 4px rgba(60, 40, 20, .2); }
.lib-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.badge { position: absolute; top: 18px; left: 18px; padding: 1px 9px; border-radius: 999px; background: rgba(255, 255, 255, .92); font-size: 12px; font-weight: 600; color: var(--muted); }
.badge.doing { color: var(--accent); }
.badge.done { color: var(--ok); }
.lib-card .menu { position: absolute; right: 16px; top: 16px; }
.lib-card .menu summary { background: rgba(255, 255, 255, .92); color: var(--ink); }
.arc-card { display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 12px; }
.arc-card .lib-name { padding: 0; }
.arc-card .row { margin-top: 4px; }
.arc-card .row button { flex: 1; }
.badge.pub { color: var(--ok); }
.lib-empty { grid-column: 1 / -1; padding: 60px 0; text-align: center; color: var(--muted); }

.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--muted); font-size: 18px; line-height: 1; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover, .menu[open] summary { background: var(--stage); }
.menu-list { position: absolute; right: 0; top: 36px; z-index: 5; min-width: 150px; padding: 5px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.menu-list button { border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; }
.menu-list button:hover { background: var(--stage); }

/* 작업 화면 */
main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.stage-wrap { position: relative; flex: 1; min-height: 0; display: flex; margin: 0 12px; border-radius: var(--radius); background: var(--stage); overflow: hidden; }
.stage { flex: 1; overflow: auto; display: flex; }
#grid { margin: auto; flex: none; display: block; cursor: pointer; }
body[data-mode="edit"] #grid { cursor: crosshair; touch-action: none; }
.zoom { position: absolute; right: 12px; top: 12px; display: flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: rgba(255, 253, 249, .92); color: var(--muted); font-size: 12px; box-shadow: var(--shadow); }
.zoom input { width: 96px; }

.toast { position: absolute; top: 14px; left: 50%; z-index: 2; transform: translate(-50%, -8px); padding: 8px 20px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.strip { display: none; align-items: center; gap: 14px; padding: 2px 20px 10px; }
body[data-mode="track"] .strip { display: flex; }
.strip-row { display: flex; align-items: baseline; gap: 5px; }
.strip-row b { font-size: 34px; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.strip-row span { color: var(--muted); }
.strip-mid { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.strip-sub { display: flex; gap: 12px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.strip-sub #tDir { color: var(--accent); font-weight: 600; }
.strip-sub #tPct { margin-left: auto; }

.dock { display: none; flex-direction: column; gap: 8px; padding: 10px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
body[data-mode="edit"] #dockEdit, body[data-mode="track"] #dockTrack { display: flex; }
.palette-row, .tool-row, .go-row { display: flex; align-items: center; gap: 8px; }
.palette { display: flex; gap: 6px; overflow-x: auto; padding: 4px; flex: 1; }
.sw { flex: none; width: 34px; height: 34px; padding: 0; border: 1px solid rgba(0, 0, 0, .15); border-radius: 50%; }
.sw.on { outline: 3px solid var(--accent); outline-offset: 2px; }
.sw.add { background: transparent; border-style: dashed; color: var(--muted); font-size: 18px; line-height: 1; }
.color-edit { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.tool-row { flex-wrap: wrap; }

.now { font-weight: 600; min-height: 1.5em; }
.runs { display: flex; gap: 5px; overflow-x: auto; padding: 3px; }
.run { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px 2px 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.chip { display: inline-block; width: 16px; height: 16px; border: 1px solid rgba(0, 0, 0, .18); border-radius: 50%; vertical-align: -3px; }
.run.done { opacity: .35; }
.run.cur { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.go-row button { padding: 14px 16px; border-radius: 14px; }
.go-row #btnPrev, .go-row .next { flex: 1; font-size: 18px; }

/* 설정 시트 */
.scrim { position: fixed; inset: 0; z-index: 9; background: rgba(43, 38, 34, .3); opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet { position: fixed; z-index: 10; top: 0; right: 0; bottom: 0; width: 360px; max-width: 100%; padding: 16px; display: none; flex-direction: column; gap: 12px; overflow-y: auto; background: var(--bg); box-shadow: -8px 0 30px rgba(60, 40, 20, .15); transform: translateX(105%); transition: transform .22s; }
body[data-mode="edit"] #sheetEdit, body[data-mode="track"] #sheetTrack { display: flex; }
body[data-sheet="open"] .sheet { transform: none; }
body[data-sheet="open"] .scrim { opacity: 1; pointer-events: auto; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head button { border: 0; background: none; font-size: 16px; color: var(--muted); }
.card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card .seg { display: flex; }
.use { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; font-variant-numeric: tabular-nums; }
.timer { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.keys { line-height: 2; }

/* 대화상자 */
dialog { width: min(440px, calc(100% - 24px)); padding: 0; border: 0; border-radius: 18px; background: var(--bg); color: var(--ink); box-shadow: 0 20px 60px rgba(60, 40, 20, .3); }
dialog { max-height: calc(100% - 24px); overflow-y: auto; }
dialog.wide { width: min(860px, calc(100% - 24px)); }
.stitch-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stitch-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 12px; white-space: normal; font-size: 13px; line-height: 1.3; }
.stitch-opt canvas { width: 72px; height: 72px; border-radius: 8px; }
.stitch-opt small { color: var(--muted); font-size: 11px; }
.stitch-opt.on { border-color: var(--accent); background: var(--accent-soft); outline: 2px solid var(--accent); font-weight: 600; }
.fab-wrap { max-height: 62vh; overflow: auto; padding: 14px; border-radius: 12px; background: var(--stage); text-align: center; }
.fab-wrap canvas { max-width: 100%; height: auto; border-radius: 6px; box-shadow: 0 2px 10px rgba(60, 40, 20, .25); vertical-align: top; }
.arc-card .lib-thumb { border: 0; cursor: zoom-in; width: 100%; }
dialog::backdrop { background: rgba(43, 38, 34, .35); }
dialog form, dialog form > div:not(.row):not(.field):not(.seg) { display: flex; flex-direction: column; gap: 14px; }
dialog form { padding: 22px; }
dialog .seg { display: flex; }
.summary { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }

@media (max-width: 700px) {
  body { font-size: 15px; }
  .top { gap: 6px; padding-inline: 12px; flex-wrap: wrap; }
  #btnHome { display: none; }
  #patternName { flex: 1 1 100px; }
  .sync { order: 5; flex-basis: 100%; text-align: right; }
  body[data-mode="edit"] .sync, body[data-mode="track"] .sync,
  body[data-mode="edit"] #btnAccount, body[data-mode="track"] #btnAccount { display: none; }
  .zoom { font-size: 0; gap: 0; }
  .library > * { padding-inline: 14px; }
  .lib-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .lib-thumb { height: 120px; }
  .lib-bar .spacer { display: none; }
  .lib-bar .chips { flex-basis: 100%; }
  .lib-bar input[type="search"] { flex: 1 1 120px; width: auto; }
  .stage-wrap { margin: 0 8px; }
  .strip { padding-inline: 14px; }
  .dock { padding-inline: 10px; }
  .color-edit { font-size: 0; }
  .go-row button { padding: 16px 12px; }
  .sheet { top: auto; left: 0; width: auto; max-height: 82vh; border-radius: 18px 18px 0 0; transform: translateY(105%); box-shadow: 0 -8px 30px rgba(60, 40, 20, .2); padding-bottom: max(16px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .toast, .bar i, .sheet, .scrim, button { transition: none; }
}

.arc-note { grid-column: 1 / -1; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); font-size: 14px; }

/* 관리자 메뉴 */
#admSearch { flex: 1 1 200px; min-width: 0; }
.adm-list { display: flex; flex-direction: column; gap: 8px; padding-bottom: 40px; }
.adm-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.adm-thumb { flex: none; display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; padding: 4px; border: 0; border-radius: 8px; background: var(--stage); cursor: zoom-in; }
.adm-thumb canvas { max-width: 100%; max-height: 100%; image-rendering: pixelated; }
.adm-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.adm-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .adm-row { flex-wrap: wrap; } .adm-info { flex-basis: calc(100% - 70px); } }

/* 로그인 · 내 정보 페이지 */
.library > .card-form { max-width: 440px; margin-top: 36px; margin-bottom: 40px; padding: 26px 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 6px 24px rgba(60, 40, 20, .08); }
.card-form > div:not([hidden]) { display: flex; flex-direction: column; gap: 16px; }
.card-form #authNameField:not([hidden]), .card-form #authUser > div:not(.row):not(.stat-row) { display: flex; flex-direction: column; gap: 6px; }
.card-form .seg { display: flex; }
.card-form .seg button { flex: 1; }
.card-form .seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(60, 40, 20, .15); }
.card-form .row input { flex: 1; min-width: 0; }
button.big { padding-block: 12px; font-size: 16px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 12px; background: var(--stage); }
.stat b { font-size: 20px; }
.stat span { font-size: 12px; color: var(--muted); }
body[data-mode="account"] #btnAccount, body[data-mode="admin"] #btnAccount { border-color: var(--accent); }
/* 관리자 페이지 */
#admTabs button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(60, 40, 20, .15); }
.badge-off, .badge-me { margin-left: 8px; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; vertical-align: 1px; }
.badge-off { background: #f3e2dc; color: var(--danger); }
.badge-me { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 700px) { .library > .card-form { margin: 16px 12px 30px; padding: 20px 16px; } }

/* 체험 모드 안내 */
.demo-bar { margin: 0 16px; padding: 7px 16px; border-radius: 999px; background: var(--accent-soft); color: var(--muted); font-size: 12px; text-align: center; }
.demo-bar[hidden] { display: none; }
/* 회원 단계 */
.lv { display: inline-block; margin-left: 6px; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; white-space: nowrap; vertical-align: 1px; }
/* 단계가 오를수록 진해진다 */
.lv0 { background: #f1ece3; color: #8b8379; }
.lv1 { background: #e4ddd0; color: #6b645b; }
.lv2 { background: #cfc6b6; color: #4a443e; }
.lv3 { background: #8b8379; color: #fffdfa; }
.lv4 { background: var(--ink); color: #fffdfa; }
.card-form #authUser > .my-level { gap: 8px; padding: 14px; border-radius: 12px; background: var(--stage); }
.my-level .row { gap: 8px; font-weight: 600; }
.my-level .lv { margin-left: 0; font-size: 13px; padding: 3px 11px; }
.lv-bar { height: 8px; border-radius: 99px; background: rgba(60, 40, 20, .12); overflow: hidden; }
.lv-bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
/* 후기 */
.rev-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.rev-list > .hint { grid-column: 1 / -1; }
.rev { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.rev-photo { display: block; width: 100%; padding: 0; border: 0; border-radius: 0; background: var(--stage); cursor: zoom-in; }
.rev img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
.rev figcaption { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px 10px; font-size: 13px; }
.rev figcaption p { margin: 0; overflow-wrap: anywhere; }
.rev-by { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.rev-by .lv { margin-left: 0; }
button.small { align-self: flex-start; padding: 2px 10px; font-size: 12px; }
dialog form > .rev-form:not([hidden]) { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
.rev-form[hidden] { display: none !important; }
.rev-form input[type="text"] { flex: 1 1 180px; min-width: 0; }
#revPreview { width: 64px; height: 64px; border-radius: 8px; object-fit: contain; background: var(--stage); cursor: zoom-in; }
button.link { padding: 0; border: 0; background: none; color: var(--accent); font-weight: 600; text-decoration: underline; }
#revLogin[hidden] { display: none; }
.adm-thumb.photo { cursor: zoom-in; padding: 0; overflow: hidden; }
.adm-thumb.photo img { width: 100%; height: 100%; object-fit: contain; }
#dlgFabric .fab-wrap { max-height: 44vh; }
dialog.photo-view { width: auto; max-width: calc(100% - 24px); max-height: calc(100% - 24px); padding: 0; background: #000; overflow: hidden; cursor: zoom-out; }
dialog.photo-view img { display: block; max-width: min(100%, 94vw); max-height: 92vh; }
dialog.photo-view::backdrop { background: rgba(20, 15, 10, .75); }


/* 모노톤 정리: 둥글고 부드럽게 */
h1 { font-weight: 800; }
.brand:hover { color: var(--muted); }
.seg { border-radius: 999px; padding: 4px; }
.seg button { border-radius: 999px; }
.menu-list button, .go-row button, .stitch-opt { border-radius: 14px; }
.lib-open, .sheet-head button, .adm-thumb, .rev-photo { border-radius: var(--radius); }
.rev-photo { border-radius: 0; }
.adm-thumb { border-radius: 10px; }
input[type="number"], input[type="text"], input[type="password"], input[type="search"], select { border-radius: 12px; }
.lib-thumb { border-radius: 12px; }
.badge.doing { color: var(--ink); }
.strip-sub #tDir { color: var(--ink); }
.sw.on { outline-color: var(--ink); }
.run.cur { border-color: var(--ink); background: var(--ink); color: var(--accent-ink); }
.adm-row, .rev { border-radius: 16px; }
body[data-mode="account"] #btnAccount, body[data-mode="admin"] #btnAccount { background: var(--accent-soft); border-color: var(--accent-soft); }
@media (max-width: 700px) { .demo-bar { margin: 0 10px; border-radius: 14px; } }

/* 아이콘과 마무리 다듬기 */
.ic { flex: none; width: 1.2em; height: 1.2em; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.menu-list button { justify-content: flex-start; }
.icon-btn { width: 40px; height: 40px; padding: 0; border-radius: 50%; }
.icon-btn .ic { width: 20px; height: 20px; }
.sheet-head .icon-btn { width: 34px; height: 34px; }
.menu summary .ic { width: 20px; height: 20px; }
.menu summary { border-radius: 50%; }
.sw.add { display: grid; place-items: center; }
.sw.add .ic { width: 16px; height: 16px; }
.seg button .ic { width: 1.05em; height: 1.05em; opacity: .75; }
.go-row .icon-btn { width: 52px; height: 52px; flex: none; }
#btnAccount { padding-left: 10px; }

/* 저장 상태 글은 문제가 있을 때만 보인다(평소에는 내 정보 페이지에서 확인) */
.sync { display: none; }
.sync[data-state="error"], .sync[data-state="offline"] { display: inline; padding: 3px 10px; border-radius: 999px; background: #f3e2dc; }

/* 찾기 칸의 돋보기 */
input[type="search"] {
  padding-left: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8379' stroke-width='1.800' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.200'/%3E%3Cpath d='M20 20l-4.300-4.300'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px center; background-size: 17px;
}

/* 카드: 올리면 살짝 뜬다 */
.lib-card { transition: transform .16s, box-shadow .16s; }
.lib-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(60, 45, 25, .06), 0 14px 30px rgba(60, 45, 25, .1); }
.lib-open:hover { background: none; }
.top { padding-block: 12px; }
.lib-hero { padding-top: 26px; }
.hint { line-height: 1.55; }
button:active { transform: scale(.97); }
.lib-open:active, .seg button:active { transform: none; }

@media (max-width: 700px) {
  #homeNav .ic, .modes .ic { display: none; }      /* 좁은 화면에서는 글자만 */
  #tools button { padding-inline: 10px; }
  .tool-row [data-fabric] .ic, .tool-row [data-sheet] .ic { display: none; }
  .color-edit + #btnPick { font-size: 0; gap: 0; width: 40px; height: 40px; padding: 0; border-radius: 50%; }
  .color-edit + #btnPick .ic { width: 20px; height: 20px; }
}
@media (prefers-reduced-motion: reduce) { .lib-card, button { transition: none; } .lib-card:hover, button:active { transform: none; } }
.lib-open { align-items: stretch; justify-content: flex-start; }
.lib-open .lib-thumb { align-items: center; }
.arc-card .lib-thumb { display: flex; }
.go-row .icon-btn { border-radius: 16px; height: auto; }

/* 알림: 목록 화면에서는 아래쪽, 그리기·뜨기 화면에서는 도안 위쪽 */
.toast { position: fixed; top: auto; bottom: 34px; z-index: 30; padding: 11px 22px; box-shadow: 0 8px 24px rgba(40, 30, 15, .22); transform: translate(-50%, 10px); max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; }
.toast.show { transform: translate(-50%, 0); }
body[data-mode="edit"] .toast, body[data-mode="track"] .toast { top: 128px; bottom: auto; transform: translate(-50%, -8px); }
body[data-mode="edit"] .toast.show, body[data-mode="track"] .toast.show { transform: translate(-50%, 0); }
button.done-mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.demo-bar button.link { display: inline; color: var(--ink); font-size: inherit; }

/* 문의 · 알림 */
textarea { font: inherit; color: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; resize: vertical; }
.card-form #inqMine:not([hidden]) { display: flex; flex-direction: column; gap: 10px; }
.inq-list, .notices { display: flex; flex-direction: column; gap: 10px; }
.inq, .notice { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.notice { background: #f6ece8; border-color: #ecd9d2; }
.inq-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.inq-reply { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); }
.inq-row { align-items: stretch; }
.inq-row .adm-info { gap: 8px; }
.inq-row .adm-info strong, .inq-row .inq-body { white-space: pre-wrap; }
#btnAccount.has-note { position: relative; }
#btnAccount.has-note::after { content: ""; position: absolute; top: 2px; right: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--mark); border: 2px solid var(--bg); }
.card-form #inqGuest:not([hidden]), .card-form #inqWrite:not([hidden]) { display: flex; flex-direction: column; gap: 12px; }
.adm-sec { margin-top: 10px; }
.notice.good { background: #e9f0e9; border-color: #d5e2d6; }

/* 맨 아래: 저작권 표시 */
.foot { display: flex; align-items: center; gap: 10px; padding: 6px 16px; padding-bottom: max(6px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.foot button { font-size: 13px; padding: 4px 10px; }
body[data-mode="edit"] .foot, body[data-mode="track"] .foot { display: none; }
.toast { bottom: 58px; }
.adm-row .menu { flex: none; }
.adm-row .menu-list { min-width: 180px; }
@media (max-width: 700px) { .foot-note { display: none; } }

/* 키로 잠긴 도안 */
.arc-card.locked .lib-thumb { position: relative; cursor: pointer; overflow: hidden; }
.arc-card.locked .lib-thumb img { max-width: 100%; max-height: 100%; border-radius: 6px; filter: blur(3px) saturate(.9); opacity: .85; }
.lock-mark { position: absolute; inset: 0; margin: auto; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .94); color: var(--ink); box-shadow: 0 2px 10px rgba(60, 40, 20, .18); }
.lock-mark .ic { width: 22px; height: 22px; }
.badge-key { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; padding: 2px 9px 2px 6px; border-radius: 99px; background: var(--accent-soft); color: var(--ink); font-size: 11px; font-weight: 600; vertical-align: 1px; user-select: all; }
.badge-key .ic { width: 12px; height: 12px; }
