@font-face {
  font-family: "Beeum Soft";
  src: url("../assets/fonts/GowunDodum-Beeum.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #f7f4f1;
  --card: #fffdfb;
  --ink: #334044;
  --muted: #626a6c;
  --teal: #4b726e;
  --teal-deep: #345b58;
  --teal-soft: #e4efec;
  --rose: #8f5959;
  --rose-soft: #f4e5e5;
  --lavender: #6b6388;
  --lavender-soft: #eeeaf4;
  --line: #ded9d4;
  --shadow: 0 18px 45px rgba(52,64,68,.08);
  --radius-lg: 30px;
  --radius-md: 22px;
  --radius-sm: 15px;
  --font-soft: "Beeum Soft", "Gowun Dodum", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-body: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 280px; color: var(--ink); background: var(--paper); scroll-behavior: smooth; }
body { min-width: 280px; margin: 0; overflow-x: hidden; font-family: var(--font-body); line-height: 1.65; }
button, input, textarea { font: inherit; }
h1, h2, h3, .brand strong, button, .primary-button, .file-button, .eyebrow { font-family: var(--font-soft); }
input, textarea { font-family: var(--font-body); }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; display: inline-flex; align-items: center; min-height: 44px; padding: 9px 13px; color: white; background: var(--ink); border-radius: 8px; transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.site-header { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; padding: 12px max(20px, calc((100vw - 1120px) / 2)); background: rgba(247,244,241,.93); border-bottom: 1px solid rgba(222,217,212,.82); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 11px; min-width: 44px; min-height: 44px; padding: 0; text-align: left; background: none; border: 0; cursor: pointer; }
.brand-mark { position: relative; display: block; width: 40px; height: 40px; overflow: hidden; background: var(--teal); border-radius: 50%; }
.brand-mark::after { position: absolute; right: 6px; bottom: 7px; width: 8px; height: 8px; content: ""; background: #b97676; border-radius: 50%; }
.brand-mark i { position: absolute; left: 11px; top: 12px; width: 17px; height: 9px; border-bottom: 1.5px solid rgba(255,255,255,.8); border-radius: 50%; transform: rotate(-6deg); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: .95rem; letter-spacing: -.04em; }
.brand small { color: var(--muted); font-size: .72rem; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.back-to-bium, .help-button, .lock-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px; font-size: .78rem; font-weight: 800; background: var(--card); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.back-to-bium { color: var(--teal-deep); text-decoration: none; }
.help-button { color: var(--rose); background: #fff8f6; border-color: #ead1cc; }

main { width: min(100%, 1120px); margin: 0 auto; padding: 64px 24px 90px; }
.screen { animation: fade-up .4s ease both; }
.hero { max-width: 760px; margin-bottom: 38px; }
.eyebrow { margin: 0 0 10px; color: var(--teal); font-size: .76rem; font-weight: 900; letter-spacing: .09em; }
h1, h2, p { word-break: keep-all; }
h1, h2, h3, p, strong, span { min-width: 0; overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(1.95rem, 4.4vw, 3.4rem); line-height: 1.22; letter-spacing: -.04em; }
h1 em { color: var(--teal); font-style: normal; }
.hero > p:last-child { max-width: 690px; margin: 24px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.85; }

.boundary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.boundary-grid article { padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow); }
.boundary-grid svg { width: 38px; height: 38px; margin-bottom: 20px; fill: none; stroke: var(--teal); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.boundary-grid strong, .boundary-grid span { display: block; }
.boundary-grid strong { margin-bottom: 7px; font-size: .94rem; }
.boundary-grid span { color: var(--muted); font-size: .8rem; line-height: 1.7; }
.warning-card, .vault-notice { display: flex; gap: 14px; align-items: flex-start; margin: 18px 0 28px; padding: 18px 20px; color: var(--ink); background: #f8efd8; border: 1px solid #ead59a; border-radius: var(--radius-sm); }
.warning-card > span, .vault-notice > span { display: grid; flex: 0 0 30px; place-items: center; width: 30px; height: 30px; color: white; background: #aa7d39; border-radius: 50%; font-weight: 900; }
.warning-card p, .vault-notice p { margin: 3px 0 0; color: var(--muted); font-size: .8rem; }

.access-card { max-width: 650px; margin: 0 auto; padding: 30px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card-step { margin: 0 0 6px; color: var(--teal); font-size: .75rem; font-weight: 900; letter-spacing: .08em; }
.access-card h2 { margin: 0; font-size: 1.5rem; letter-spacing: -.055em; }
.access-card > p:not(.card-step):not(.status) { margin: 10px 0 22px; color: var(--muted); font-size: .85rem; }
label { display: block; margin-top: 16px; font-size: .82rem; font-weight: 800; }
label small { margin-left: 5px; color: var(--muted); font-weight: 500; }
input, textarea { width: 100%; margin-top: 8px; padding: 14px 15px; color: var(--ink); background: #fcfaf7; border: 1px solid var(--line); border-radius: 13px; outline: none; resize: vertical; }
input:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(75,114,110,.11); }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.check-row input { flex: 0 0 19px; width: 19px; height: 19px; margin: 3px 0 0; accent-color: var(--teal); }
.check-row span { color: var(--muted); font-size: .78rem; }
.primary-button, .danger-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; margin-top: 22px; padding: 0 22px; color: white; background: var(--teal); border: 0; border-radius: 999px; font-weight: 900; cursor: pointer; }
.primary-button.small { margin-top: 0; min-height: 44px; }
.primary-button:disabled { opacity: .55; cursor: wait; }
.danger-button { color: white; background: var(--rose); }
.text-button { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 0; color: var(--teal-deep); background: none; border: 0; font-size: .8rem; font-weight: 900; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.status { min-height: 25px; margin: 12px 0 0; color: var(--teal-deep); font-size: .78rem; }
.restore-block { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.restore-block > strong { font-size: .82rem; }
.restore-block > p { margin: 4px 0 10px; color: var(--muted); font-size: .75rem; }
.file-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin: 0; padding: 0 16px; color: var(--teal-deep); background: var(--teal-soft); border: 1px solid rgba(75,114,110,.22); border-radius: 999px; cursor: pointer; }
.file-button input { position: absolute; width: 1px; height: 1px; overflow: hidden; margin: -1px; padding: 0; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.file-button:focus-within { outline: 3px solid rgba(75,114,110,.2); outline-offset: 2px; }
.delete-vault-details { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.delete-vault-details summary { display: flex; align-items: center; min-height: 44px; color: var(--rose); font-size: .8rem; font-weight: 800; cursor: pointer; }
.delete-vault-details p { color: var(--muted); font-size: .78rem; }

.vault-heading, .section-heading, .editor-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.vault-heading h1 { font-size: clamp(1.9rem, 4.8vw, 3rem); }
.vault-heading p:last-child { margin: 10px 0 0; color: var(--muted); }
.vault-notice { margin: 26px 0 34px; background: var(--teal-soft); border-color: rgba(75,114,110,.22); }
.vault-notice > span { background: var(--teal); }
.vault-notice p { margin: 0; }
.section-heading { align-items: center; margin-bottom: 15px; }
.section-heading h2 { margin: 0; font-size: 1.15rem; letter-spacing: -.04em; }
.entry-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.entry-card { position: relative; min-height: 170px; padding: 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow); }
.entry-card time { color: var(--teal); font-size: .74rem; font-weight: 900; }
.entry-card h3 { margin: 12px 0 7px; font-size: 1rem; letter-spacing: -.035em; }
.entry-card p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted); font-size: .8rem; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.entry-card-actions { display: flex; gap: 13px; margin-top: 17px; }
.entry-card-actions button { display: inline-flex; align-items: center; min-height: 44px; padding: 0; color: var(--teal-deep); background: none; border: 0; font-size: .76rem; font-weight: 900; cursor: pointer; }
.entry-card-actions .delete-entry { color: var(--rose); }
.empty-card { padding: 42px 24px; text-align: center; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius-md); }
.empty-card > span { display: block; margin-bottom: 10px; color: var(--teal); font-size: 2.2rem; }
.empty-card strong { display: block; }
.empty-card p { margin: 6px 0 0; color: var(--muted); font-size: .8rem; }

.editor { margin-top: 34px; padding: 30px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.editor h2 { margin: 0; font-size: 1.45rem; letter-spacing: -.055em; }
.icon-button { display: grid; flex: 0 0 44px; place-items: center; width: 44px; height: 44px; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 50%; font-size: 1.25rem; cursor: pointer; }
.editor-intro { color: var(--muted); font-size: .82rem; }
.editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.editor-grid label { margin: 0; padding: 18px; background: #fcfaf7; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.editor-grid label > span, .editor-grid label > strong { display: block; }
.editor-grid label > span { color: var(--teal); font-size: .72rem; letter-spacing: .06em; }
.editor-grid label > strong { margin-top: 4px; font-size: .84rem; }
.editor-grid textarea { min-height: 126px; background: var(--card); }
.editor-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }

.modal { position: fixed; z-index: 100; inset: 0; overflow-y: auto; padding: 18px; background: rgba(36,47,49,.64); backdrop-filter: blur(8px); }
.modal-dialog { position: relative; width: min(100%, 650px); margin: 3vh auto; padding: 32px; background: var(--paper); border-radius: var(--radius-lg); box-shadow: 0 30px 80px rgba(20,30,32,.26); outline: none; }
.modal-close { position: absolute; top: 17px; right: 17px; }
.modal-dialog h2 { max-width: 470px; margin: 0 0 14px; font-size: 1.7rem; letter-spacing: -.06em; }
.modal-dialog > p:not(.eyebrow):not(.modal-note) { color: var(--muted); font-size: .86rem; }
.hotline-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 22px 0; }
.hotline-grid a { display: flex; align-items: center; gap: 10px; padding: 14px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 13px; text-decoration: none; }
.hotline-grid strong { color: var(--rose); font-size: 1.1rem; }
.hotline-grid span { color: var(--muted); font-size: .75rem; }
.modal-note { padding: 14px; color: var(--muted); background: var(--rose-soft); border-radius: 12px; font-size: .76rem; }

@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (max-width: 720px) {
  .site-header { min-height: 67px; padding: 11px 16px; }
  .brand small { display: none; }
  .back-to-bium, .help-button, .lock-button { min-height: 44px; padding: 0 11px; font-size: .7rem; }
  main { padding: 36px 16px 70px; }
  h1 { font-size: clamp(1.8rem, 9vw, 2.4rem); line-height: 1.28; }
  .boundary-grid, .entry-list, .editor-grid { grid-template-columns: 1fr; }
  .boundary-grid article { display: grid; grid-template-columns: 42px 1fr; column-gap: 13px; padding: 18px; }
  .boundary-grid svg { grid-row: 1 / 3; width: 34px; height: 34px; margin: 0; }
  .access-card, .editor { padding: 22px 18px; border-radius: var(--radius-md); }
  .vault-heading { align-items: flex-end; }
  .primary-button.small { flex: 0 0 auto; padding-inline: 16px; }
  .hotline-grid { grid-template-columns: 1fr; }
  .modal { padding: 0; }
  .modal-dialog { min-height: 100dvh; margin: 0; padding: 28px 20px 38px; border-radius: 0; }
}

@media (max-width: 390px) {
  .brand > span:last-child { display: none; }
  .brand-mark { width: 40px; height: 40px; }
  .header-actions { margin-left: auto; gap: 5px; }
  .back-to-bium, .help-button, .lock-button { padding-inline: 9px; }
  .vault-heading { display: block; }
  .vault-heading .primary-button { margin-top: 18px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .section-heading .text-button { align-self: flex-start; }
  .vault-notice { gap: 11px; padding-inline: 16px; }
  .editor-actions { align-items: stretch; flex-direction: column; gap: 8px; }
  .editor-actions .primary-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
