/* Nodi's default desk palette and workspace proportions. Shared chrome is
   copied locally so the vault never imports the ordinary app's runtime. */
:root {
  color-scheme: dark;
  --bg: #17191c;
  --paper: #2c2e30;
  --ink: #ffffff;
  --muted: #b8babc;
  --line: #515356;
  --accent: #ffb020;
  --button-text: #17191c;
  --error: #ffb3ad;
  --warning: #f3d295;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
}
button:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 5%, transparent); }
button:disabled { opacity: .4; cursor: default; }
button.primary {
  padding: 14px 22px;
  border-color: var(--accent);
  background: var(--accent);
  color: var(--button-text);
  font-size: 14px;
  font-weight: 500;
}
button.primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.08); }
button.quiet { background: transparent; }
button.danger { color: var(--error); border-color: color-mix(in srgb, var(--error) 40%, var(--line)); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.ui-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.subpage.vault-page {
  --site-shell-width: 1208px;
  --site-gutter: 36px;
  font-size: 14px;
  letter-spacing: -.015em;
}
.vault-header .site-nav { gap: 4px; }
.vault-header .current-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
#lockButton { flex: none; margin-left: auto; }
#lockButton .ui-icon { width: 16px; height: 16px; }
main#main { max-width: 1208px; margin: 0 auto; padding: 38px 36px 48px; }
.page-heading { margin: 12px 0 32px; }
.eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 2px; color: var(--accent); margin: 0 0 10px; }
.page-heading h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 600; letter-spacing: -.05em; line-height: 1.4; margin: 0; }
.page-heading > p:last-child { margin: 12px 0 0; font-size: 14px; line-height: 1.8; color: var(--muted); }
.note-intro { margin: 0 0 24px; padding-left: 18px; border-left: 2px solid color-mix(in srgb, var(--accent) 55%, var(--line)); }
.note-intro h2 { margin: 0 0 8px; font-size: 15px; font-weight: 500; }
.note-intro p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
h2, h3, p { overflow-wrap: anywhere; }
h2 { margin: 0 0 12px; font-size: 20px; font-weight: 500; line-height: 1.5; letter-spacing: -.035em; }
h3 { margin: 0; font-size: 16px; font-weight: 500; }
p { line-height: 1.8; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.8; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 400; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.panel { min-width: 0; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.welcome-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; margin-top: 24px; }
.open-panel { border-color: color-mix(in srgb, var(--line) 70%, var(--accent)); }
.file-heading { display: flex; align-items: center; gap: 14px; }
.file-heading h2 { margin: 0; }
.file-heading .hint { margin: 2px 0 0; }
.file-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent); border-radius: 12px; }
.file-icon .ui-icon { width: 24px; height: 24px; }
.welcome-grid article > p:not(.hint) { margin: 20px 0 24px; color: var(--muted); font-size: 14px; line-height: 1.9; }
.file-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.file-actions .primary { gap: 30px; }
.create-panel { display: flex; flex-direction: column; align-items: flex-start; }
.create-panel h2 { margin: 0; font-size: 18px; }
.create-panel button { margin-top: auto; }
.create-panel .recovery-hint { margin: 12px 0 0; font-size: 11px; }
.message { margin: 0 0 18px; padding: 12px 16px; border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--ink) 3%, transparent); color: var(--muted); font-size: 12px; line-height: 1.8; }
.message.error { color: var(--error); border-color: color-mix(in srgb, var(--error) 35%, transparent); background: color-mix(in srgb, var(--error) 7%, transparent); }
.message.warning { color: var(--warning); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.message p { margin: 6px 0 12px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.vault-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 12px 0 28px; }
.vault-toolbar h2 { max-width: 440px; margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -.05em; }
.vault-toolbar .eyebrow { margin-bottom: 10px; }
.vault-toolbar .hint { margin: 8px 0 0; }
.vault-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.library { padding: 0; border: 0; background: transparent; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-heading button { min-height: 40px; padding: 8px 10px; font-size: 12px; }
.section-heading h3 span { margin-left: 4px; color: var(--muted); font-size: 12px; font-weight: 400; }
label { display: block; margin-bottom: 18px; font-size: 13px; font-weight: 400; line-height: 1.6; }
input:not([type=checkbox]), textarea, select { display: block; width: 100%; min-width: 0; margin-top: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 14px; font-weight: 400; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .65; }
textarea { resize: vertical; }
input[type=checkbox] { width: 18px; height: 18px; flex: none; margin: 3px 0 0; accent-color: var(--accent); }
input[type=password] { letter-spacing: .08em; }
input[type=search] { background: var(--paper); font-size: 13px; }
.search-label { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.input-action { display: flex; align-items: stretch; gap: 8px; margin-top: 8px; }
.input-action input { margin: 0; }
.input-action button { padding: 8px 12px; white-space: nowrap; }
.entry-list { max-height: 65vh; margin: 16px 0 0; padding: 2px; list-style: none; overflow: auto; }
.entry-list li + li { margin-top: 10px; }
.entry-list button { display: block; width: 100%; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); text-align: left; font-weight: 400; }
.entry-list button[aria-current=true] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--paper)); }
.entry-list strong { display: block; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.entry-list small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.editor { padding: 26px; }
#legacySite { margin: -10px 0 18px; }
.editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.spacer { flex: 1; }
.settings-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-top: 32px; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.settings-row h2 { margin: 0; font-size: 14px; font-weight: 500; }
.settings-row p { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.settings-row label { min-width: 140px; margin: 0; font-size: 11px; color: var(--muted); }
.select-field { position: relative; display: block; margin-top: 8px; color: var(--ink); }
.settings-row .select-field select { -webkit-appearance: none; appearance: none; min-height: 44px; margin-top: 0; padding: 10px 38px 10px 14px; font-size: 13px; color: var(--ink); cursor: pointer; }
.select-chevron { position: absolute; top: 50%; right: 12px; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.usage-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; padding-top: 28px; color: var(--muted); }
.usage-notes section { min-width: 0; }
.usage-notes h2 { margin: 0 0 12px; color: var(--ink); font-size: 14px; font-weight: 500; }
.usage-notes p, .usage-notes li { font-size: 12px; line-height: 1.9; overflow-wrap: anywhere; }
.usage-notes p { margin: 10px 0 0; }
.usage-notes h2 + p { margin-top: 0; }
.usage-notes ul { margin: 0; padding-left: 16px; }
.usage-notes li + li { margin-top: 8px; }
.usage-notes p + ul { margin-top: 10px; }
.usage-notes li::marker { color: var(--line); }
.locked-panel { max-width: 680px; margin-top: 24px; }
.locked-panel .file-icon { margin-bottom: 18px; }
.locked-panel > p { font-size: 14px; color: var(--muted); }
.vault-page .site-footer-inner { max-width: 1208px; padding-block: 26px; }
dialog { width: min(520px, calc(100% - 32px)); max-height: 90dvh; padding: 28px; overflow: auto; border: 1px solid var(--line); border-radius: 20px; background: var(--bg); color: var(--ink); box-shadow: inset 0 1px 0 #ffffff20, 0 24px 72px #00000038; }
dialog::backdrop { background: #00000070; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog h2 { margin: 0; font-size: 20px; font-weight: 600; }
dialog .primary { margin-top: 6px; }
#authHelp { margin: 0 0 24px; }
#authForm > label { margin-bottom: 22px; }
#authForm > label > input:not([type=checkbox]) { margin-top: 10px; }
#noteTitleHelp { display: block; margin-top: 10px; line-height: 1.7; }
.check-label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.error-text { min-height: 20px; color: var(--error); font-size: 13px; }
body.screen-away #workspace, body.screen-away #authDialog { visibility: hidden; }
body[data-phase=locked] :is(.page-heading, .note-intro), body[data-phase=unlocked] :is(.page-heading, .note-intro), body[data-phase=locking] :is(.page-heading, .note-intro) { display: none; }
@media (max-width: 980px) {
  .subpage.vault-page { --site-gutter: 24px; }
  .vault-header .site-header-inner { gap: 8px 20px; }
  .vault-header .site-nav { order: 3; flex-direction: row; flex-basis: 100%; align-items: center; flex-wrap: nowrap; gap: 4px; overflow-x: auto; }
  .vault-header .site-nav > * { flex: none; }
  .vault-header .site-nav a, .vault-header .current-page { min-height: 40px; padding: 8px 10px; font-size: 12px; }
  main#main { padding: 28px 24px 40px; }
  .vault-grid { grid-template-columns: 240px minmax(0, 1fr); gap: 16px; }
  .vault-toolbar { flex-direction: column; align-items: flex-start; gap: 16px; }
  .vault-toolbar .actions button { font-size: 12px; }
  .entry-list { max-height: 400px; }
}
@media (max-width: 640px) {
  .subpage.vault-page { --site-gutter: 16px; }
  main#main { padding: 24px 16px 32px; }
  .page-heading { margin: 8px 0 24px; }
  .page-heading h1 { font-size: 28px; }
  .welcome-grid, .vault-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .welcome-grid { margin-top: 18px; }
  .panel, .editor { padding: 20px; }
  .library { max-height: 340px; padding: 0; overflow: auto; }
  .entry-list { max-height: 190px; }
  .vault-toolbar h2 { font-size: 24px; }
  .settings-row { align-items: flex-start; gap: 16px; }
  .settings-row label { min-width: 104px; }
  .usage-notes { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 24px; }
  .input-action { flex-wrap: wrap; }
  .input-action input { flex-basis: 100%; }
  .editor-actions { gap: 8px; }
  .editor-actions .spacer { display: none; }
  .editor-actions button { flex: 1; font-size: 12px; white-space: nowrap; }
  .message .actions button { font-size: 12px; }
  input:not([type=checkbox]), textarea { font-size: 16px; }
  .vault-page .site-footer-inner { padding: 24px 16px; }
  .vault-page .site-footer-nav a:last-child { grid-column: auto; margin: 0; padding: 0; border-top: 0; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
