/* 여행 마감표. Grammar: docs/DESIGN.md (wall tear-off calendar). Colours only from these tokens. */
:root {
  --wall: #1d2d50; --paper: #fbfbf9; --paper-edge: #e4e6e3; --ink: #151515; --sub: #55595a; --line: #c3c9d2;
  --board: #2c4377; --board-deep: #070d1c; --board-ink: #f2f4f7; --staple: #8d969b;
  --on-wall: #f2f4f7; --on-wall-sub: #b9c4d8; --wall-line: #4a5a7e;
  /* function colours: Sunday, overdue, warning / Saturday / done */
  --sun: #c8202a; --sat: #1f5fbf; --done: #2f6b3f;
  /* 외교부 여행경보 단계색: 1 파랑, 2 노랑, 3 빨강, 4 검정 */
  --lv1: #2563c9; --lv2: #e3b10b; --lv3: #d33a2c; --lv4: #111111; --lvn: #9aa0a8;
  --font: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --shade: rgba(0, 0, 0, .18);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--wall); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: inherit; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px 40px; }

.top { display: flex; align-items: flex-start; gap: 12px; padding: 18px 0 12px; color: var(--on-wall); }
.top > div { flex: 1; min-width: 0; }
.top .home { font-size: 14px; color: var(--on-wall-sub); text-decoration: none; font-weight: 700; }
.top h1 { margin: 0; font-size: 28px; line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; }
.lede { margin: 2px 0 0; color: var(--on-wall-sub); font-size: 15px; }
.fbk { flex: none; font: inherit; font-size: 14px; font-weight: 700; height: 40px; padding: 0 14px; border-radius: 3px;
  border: 1.5px solid var(--on-wall); background: transparent; color: var(--on-wall); cursor: pointer; }

/* ---------- the deck: pad + form ---------- */
.deck { display: grid; grid-template-columns: 280px 1fr; gap: 18px 28px; align-items: start; margin: 4px 0 16px; }
.pad { position: relative; width: 280px; }
.board { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; height: 46px; padding: 0 18px;
  background: var(--board); color: var(--board-ink); font-weight: 800; font-size: 15px; box-shadow: 0 2px 0 var(--shade); }
.staple { display: block; width: 26px; height: 7px; background: var(--staple); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25); }
/* torn paper ends left under the staples */
.stubs { height: 7px; margin: 0 6px; background: var(--paper);
  clip-path: polygon(0 0, 100% 0, 100% 60%, 96% 100%, 92% 50%, 88% 100%, 84% 40%, 80% 100%, 76% 55%, 72% 100%, 68% 45%, 64% 100%, 60% 50%, 56% 100%, 52% 40%, 48% 100%, 44% 55%, 40% 100%, 36% 45%, 32% 100%, 28% 50%, 24% 100%, 20% 40%, 16% 100%, 12% 55%, 8% 100%, 4% 45%, 0 100%); }
.sheets { position: relative; height: 252px; margin: -1px 6px 0; }
.edge { height: 6px; margin: 0 6px; background: repeating-linear-gradient(var(--paper) 0 1px, var(--paper-edge) 1px 2px); box-shadow: 0 3px 4px var(--shade); }
.sheet { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto auto; justify-items: center; padding: 10px 12px 12px;
  background: var(--paper); color: var(--ink); text-align: center; transform-origin: 0 0; }
.sheet .mo { font-size: 14px; font-weight: 700; color: var(--sub); }
.sheet .mo em { font-style: normal; margin-left: 6px; padding: 0 5px; border: 1px solid var(--sub); font-size: 12px; }
.sheet .num { align-self: center; font-size: 118px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.04em; }
.sheet .wd { font-size: 15px; font-weight: 700; }
.sheet .wd b { margin-left: 4px; }
.sheet .task { margin-top: 6px; min-height: 26px; max-width: 100%; padding: 1px 8px; font-size: 15px; line-height: 1.35; font-weight: 800; word-break: keep-all;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.sheet.has .task { border: 2px solid var(--ink); }
.sheet.warn .task { border-color: var(--sun); color: var(--sun); }
.sheet.sun .num, .sheet.sun .wd { color: var(--sun); }
.sheet.sat .num, .sheet.sat .wd { color: var(--sat); }
.sheet.fall { z-index: 2; pointer-events: none; animation: tear 260ms cubic-bezier(.5, 0, .75, 0) forwards; box-shadow: 0 6px 14px var(--shade); }
@keyframes tear {
  0% { transform: rotate(0) translate(0, 0); opacity: 1; }
  35% { transform: rotate(-7deg) translate(-4px, -10px); opacity: 1; }
  100% { transform: rotate(-24deg) translate(-40px, 260px); opacity: 0; }
}

/* trip form */
.trip { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.trip label { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.trip .f-country { grid-column: 1 / -1; }
.trip label > span { font-size: 13px; color: var(--on-wall-sub); font-weight: 700; }
.trip select, .trip input { font: inherit; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 3px;
  height: 48px; padding: 0 10px; width: 100%; min-width: 0; }
.trip select:focus, .trip input:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--on-wall); outline-offset: 2px; }
.paper a:focus-visible, .facts a:focus-visible, .day a:focus-visible, .day button:focus-visible { outline-color: var(--sat); }
.acts { grid-column: 1 / -1; display: flex; gap: 8px; align-items: stretch; }
.tear { flex: 1; font: inherit; font-size: 20px; font-weight: 800; height: 56px; border: 0; border-radius: 0; cursor: pointer;
  background: var(--paper); color: var(--ink); box-shadow: 0 2px 0 var(--paper-edge), 0 4px 0 var(--paper), 0 5px 0 var(--paper-edge);
  clip-path: polygon(0 5px, 4% 0, 8% 5px, 12% 0, 16% 5px, 20% 0, 24% 5px, 28% 0, 32% 5px, 36% 0, 40% 5px, 44% 0, 48% 5px, 52% 0, 56% 5px, 60% 0, 64% 5px, 68% 0, 72% 5px, 76% 0, 80% 5px, 84% 0, 88% 5px, 92% 0, 96% 5px, 100% 0, 100% 100%, 0 100%);
  transition: transform 60ms; }
.tear.pressed, .tear:active { transform: translateY(3px) rotate(-1deg); }
.opt { position: relative; flex: none; font: inherit; font-size: 14px; font-weight: 700; min-width: 70px; padding: 14px 10px 0; border: 0; border-radius: 0; cursor: pointer;
  background: transparent; color: var(--on-wall-sub); border-bottom: 1.5px dashed var(--wall-line); }
/* a staple on top: closed when on, open when off */
.opt::before { content: ""; position: absolute; left: 50%; top: 4px; width: 22px; height: 6px; margin-left: -11px; border: 2px solid var(--staple); border-bottom: 0; }
.opt[aria-pressed="true"] { color: var(--on-wall); border-bottom: 2px solid var(--on-wall); }
.opt[aria-pressed="true"]::before { background: var(--staple); border: 0; }
.trips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.trip-chip { display: inline-flex; align-items: center; height: 34px; padding: 0 10px 0 14px; color: var(--on-wall); border-left: 4px solid var(--staple);
  text-decoration: none; font-size: 14px; font-weight: 700; }

/* travel alarm strip */
.alarm { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 12px;
  background: var(--paper); border-left: 6px solid var(--lvn); font-size: 15px; }
.alarm b { font-weight: 800; }
.alarm small { color: var(--sub); }
.alarm a { margin-left: auto; font-size: 14px; color: var(--sub); }
.lv-1 { border-left-color: var(--lv1); } .lv-2 { border-left-color: var(--lv2); }
.lv-3 { border-left-color: var(--lv3); } .lv-4 { border-left-color: var(--lv4); }

/* ---------- the list: each day is a torn sheet ---------- */
.plan { margin-top: 18px; min-height: 60px; }
.hint { color: var(--on-wall-sub); font-size: 15px; }
.facts .hint, .recent .hint { color: var(--sub); }
.count { margin: 0 0 10px; font-size: 15px; color: var(--on-wall-sub); }
.count b { color: var(--on-wall); font-size: 20px; }
.days { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; filter: drop-shadow(0 2px 2px var(--shade)); }
.day { position: relative; display: grid; grid-template-columns: 96px 1fr; gap: 0 14px; padding: 16px 14px 14px; background: var(--paper);
  clip-path: polygon(0 6px, 3% 0, 6% 5px, 9% 1px, 12% 6px, 15% 0, 18% 5px, 21% 1px, 24% 6px, 27% 0, 30% 5px, 33% 1px, 36% 6px, 39% 0, 42% 5px, 45% 1px, 48% 6px, 51% 0, 54% 5px, 57% 1px, 60% 6px, 63% 0, 66% 5px, 69% 1px, 72% 6px, 75% 0, 78% 5px, 81% 1px, 84% 6px, 87% 0, 90% 5px, 93% 1px, 96% 6px, 100% 0, 100% 100%, 0 100%); }
.day.wait { visibility: hidden; }
.day.land { animation: land 180ms cubic-bezier(.2, .7, .2, 1); }
@keyframes land { from { transform: translateY(-14px) rotate(-1.5deg); opacity: 0; } to { transform: none; opacity: 1; } }
.day h3 { margin: 0; display: flex; flex-direction: column; align-items: center; text-align: center; font-size: 13px; font-weight: 700; color: var(--sub); word-break: keep-all; }
.day h3 .num { font-size: 48px; line-height: 1.05; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.day h3 .dd { font-size: 15px; font-weight: 800; color: var(--ink); }
.day.sun h3 .num, .day.sun h3 .mo { color: var(--sun); }
.day.sat h3 .num, .day.sat h3 .mo { color: var(--sat); }
.day.late h3 .num, .day.late h3 .mo { color: var(--sun); }
.day.local h3 .num { font-size: 26px; padding: 8px 0 2px; }
.day ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; align-content: start; }
.item { display: grid; gap: 3px; }
.item label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.item input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--done); }
.item .t { font-weight: 800; }
.item.warn .t { color: var(--sun); }
.item.done .t { text-decoration: line-through; color: var(--sub); }
.item .d { margin-left: 30px; color: var(--sub); font-size: 14px; }
.item .ln { margin-left: 30px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 14px; }
.item .src { color: var(--sub); }
.item .apply, .item .buy { display: inline-flex; align-items: center; height: 32px; padding: 0 10px; border-radius: 3px;
  text-decoration: none; font-weight: 800; font-size: 14px; }
.item .apply { border: 1.5px solid var(--ink); }
.item .apply::after { content: " ↗"; font-weight: 500; }
.item .buy { border: 1.5px solid var(--ink); }
.item .buy::before { content: "사러 가기 "; font-weight: 500; }
.item .buy.wait { border-style: dashed; color: var(--sub); border-color: var(--sub); }
.item .buy.wait::before { content: ""; }
.item .row { display: flex; align-items: flex-start; gap: 6px; }
.item .row label { flex: 1; min-width: 0; }
/* a fact to know (visa-free days, tipping): no checkbox, a staple dot in its place so the column still lines up */
.item .info-t { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 8px; }
.item .info-t::before { content: ""; flex: none; width: 22px; height: 22px; background: radial-gradient(circle, var(--staple) 0 4px, transparent 5px); }
button.more { flex: none; height: 28px; padding: 0 8px; border-radius: 3px; border: 1.5px solid var(--sub); background: var(--paper);
  color: var(--sub); font: 800 13px/1 var(--font); cursor: pointer; }
button.more[aria-expanded="true"] { border-width: 2.5px; color: var(--ink); border-color: var(--ink); }
button.more[aria-expanded="true"]::before { content: "✓ "; }
.more-text { margin: 2px 0 2px 30px; padding: 8px 10px; background: var(--paper-edge); font-size: 14px; }

.tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.tools button, .fbf button { font: inherit; font-weight: 800; height: 44px; padding: 0 14px; border-radius: 3px; border: 1.5px solid var(--on-wall-sub);
  background: transparent; color: var(--on-wall); cursor: pointer; }
.fbf button { border-color: var(--ink); color: var(--ink); }
.fbf .primary { background: var(--wall); border-color: var(--wall); color: var(--on-wall); }

/* facts, recent changes, tables: plain paper */
.facts, .recent, .paper { margin-top: 24px; padding: 14px 16px; background: var(--paper); box-shadow: 0 2px 0 var(--paper-edge); }
.facts h2, .recent h2, .paper h2 { font-size: 18px; margin: 0 0 8px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 8px 6px; border-top: 1px solid var(--line); }
th { width: 30%; font-weight: 700; color: var(--sub); }
th[title] { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
td.src { width: 22%; font-size: 14px; color: var(--sub); white-space: nowrap; }
table.log th { width: auto; }

/* home: the 12 places as small sheets */
.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 6px 0 0; }
.tile { display: flex; align-items: center; justify-content: center; height: 52px; padding: 0 6px; color: var(--on-wall); border: 1.5px solid var(--wall-line);
  border-top: 5px solid var(--lvn); text-decoration: none; font-weight: 800; }
.tile:hover { border-color: var(--on-wall-sub); }
.tile.lv-none { border-top-color: var(--wall-line); }
.tile.lv-1 { border-top-color: var(--lv1); } .tile.lv-2 { border-top-color: var(--lv2); }
.tile.lv-3 { border-top-color: var(--lv3); } .tile.lv-4 { border-top-color: var(--lv4); }
.recent ul { list-style: none; padding: 0; margin: 0; font-size: 15px; }
.recent li { padding: 6px 0; border-top: 1px solid var(--line); }
.recent time { color: var(--sub); font-size: 14px; margin-right: 6px; }
.prose { color: var(--on-wall); }
.prose li { margin: 6px 0; }
.prose a { color: var(--on-wall); }

.foot { max-width: 860px; margin: 0 auto; padding: 18px 16px 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 14px;
  color: var(--on-wall-sub); border-top: 1px solid var(--wall-line); }
.foot a, .foot .linkish { display: inline-flex; align-items: center; min-height: 32px; }
.foot .built { margin-left: auto; }
.linkish { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

dialog { border: 0; border-radius: 0; background: var(--paper); color: var(--ink); width: min(520px, calc(100vw - 32px)); box-shadow: 0 10px 30px var(--shade); }
dialog::backdrop { background: rgba(0, 0, 0, .35); }
.fbf h2 { margin: 0 0 8px; font-size: 18px; }
.fbf textarea { width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 3px; padding: 8px; }
.fbf .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

@media (max-width: 720px) {
  .top h1 { font-size: 24px; }
  .deck { grid-template-columns: 1fr; gap: 14px; }
  .pad { width: min(260px, 100%); margin: 0 auto; }
  .sheets { height: 186px; }
  .sheet .num { font-size: 84px; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .day { grid-template-columns: 64px 1fr; gap: 0 10px; padding: 14px 10px 12px; }
  .day h3 .num { font-size: 36px; }
  .day.local h3 .num { font-size: 20px; }
  .item .d, .item .ln, .more-text { margin-left: 0; }
  th { width: 34%; }
  .facts table, .facts tbody, .facts tr, .facts th, .facts td { display: block; width: auto; }
  .facts tr { padding: 8px 0; border-top: 1px solid var(--line); }
  .facts th, .facts td { border: 0; padding: 0; }
  .facts th { font-size: 14px; }
  .facts td.src { white-space: normal; }
  .alarm a { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet.fall, .day.land { animation: none; }
  .tear { transition: none; }
}

@media print {
  ivel-bar, .pad, .trip, .tools, .foot, .facts, .buy, .apply, .home, .fbk, button.more { display: none !important; }
  body { font-size: 12px; color: #000; background: #fff; }
  .deck { display: block; margin: 0; }
  .top { padding-top: 0; color: #000; }
  .count, .count b { color: #000; }
  .days { filter: none; }
  .day { break-inside: avoid; padding: 6px 0; clip-path: none; border-top: 1px solid #999; }
  .day.wait { visibility: visible; }
  .item .src::after { content: " " attr(href); font-size: 10px; word-break: break-all; }
  .more-text[hidden] { display: none; }
}
.tear:focus-visible { outline: none; text-decoration: underline 3px; text-underline-offset: 5px; }
dialog :focus-visible, .alarm a:focus-visible, .recent a:focus-visible { outline-color: var(--sat); }
.countries { margin-top: 22px; color: var(--on-wall); }
.countries h2 { font-size: 15px; margin: 0 0 4px; color: var(--on-wall-sub); }
.countries p { margin: 0; line-height: 2.1; }
.countries a { display: inline-block; min-height: 32px; padding: 0 2px; }
.ex-note { margin: 0 0 10px; padding: 8px 12px; color: var(--on-wall); border-left: 4px solid var(--staple); }
.ex-note b { margin-right: 6px; }

/* document pages: official address and fee (judge 2026-11-06 item 1) */
.doc td a { font-weight: 800; word-break: break-all; }
.looks, .docs { list-style: none; padding: 0; margin: 0; font-size: 15px; }
.looks li, .docs li { padding: 6px 0; border-top: 1px solid var(--line); word-break: keep-all; overflow-wrap: anywhere; }
.docs small { color: var(--sub); margin-left: 6px; white-space: nowrap; }
.top h1 { word-break: keep-all; }
.go { margin: 20px 0 8px; display: flex; }
a.tear { display: flex; align-items: center; justify-content: center; text-decoration: none; padding: 0 16px; }
.doclinks { margin: 10px 0 0; font-size: 15px; line-height: 1.9; }
