:root {
  color-scheme: light;
  --paper: #f6f3eb;
  --card: #fffefa;
  --ink: #383a32;
  --muted: #898b7d;
  --line: #e9e6dc;
  --sage: #78866c;
  --sage-dark: #64745a;
  --sage-pale: #edf0e8;
  --clay: #b8795b;
  --shadow: 0 18px 48px rgba(58, 61, 49, .08);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.shell { min-height: 100vh; }

.sign-in-card {
  width: min(100% - 32px, 430px);
  margin: 11vh auto 0;
  padding: 48px 42px 38px;
  border: 1px solid rgba(232, 229, 218, .8);
  border-radius: 26px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
}
.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 15px;
  background: var(--sage-pale);
  color: var(--sage-dark);
  font-family: serif;
  font-size: 1.35rem;
  font-weight: 700;
}
.sign-in-card > .brand-mark { margin: 0 auto 22px; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--sage);
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .16em;
}
.sign-in-card h1 {
  margin: 0;
  font-family: "Nanum Myeongjo", "Batang", serif;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -.06em;
}
.welcome-copy {
  margin: 17px 0 28px;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.8;
}
.button {
  min-height: 38px;
  border: 0;
  border-radius: 11px;
  padding: 0 14px;
  font-size: .85rem;
  font-weight: 600;
  transition: background .15s, color .15s, transform .15s;
}
.button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(120, 134, 108, .35);
  outline-offset: 2px;
}
.button-primary { background: var(--sage); color: white; }
.button-primary:hover { background: var(--sage-dark); }
.button-primary:disabled { cursor: wait; opacity: .7; }
.sign-in-button { width: 100%; min-height: 48px; }
.button-quiet { background: transparent; color: var(--muted); }
.button-quiet:hover { background: var(--sage-pale); color: var(--ink); }
.button-delete:hover { background: #f8ece8; color: #a05240; }
.message { min-height: 1.3em; margin: 14px 0 0; color: #a05240; font-size: .82rem; }
.privacy-note { margin: 18px 0 0; color: #a2a294; font-size: .75rem; }

.topbar {
  display: flex;
  height: 76px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 250, .68);
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; border-radius: 13px; font-size: 1.15rem; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: "Nanum Myeongjo", "Batang", serif; font-size: 1rem; }
.brand small { margin-top: 3px; color: var(--muted); font-size: .7rem; }
.account { display: flex; align-items: center; gap: 14px; }
.account-email { max-width: 240px; overflow: hidden; color: var(--muted); font-size: .78rem; text-overflow: ellipsis; }

.workspace { display: grid; width: min(100%, 1440px); min-height: calc(100vh - 76px); grid-template-columns: 340px minmax(0, 1fr); margin: 0 auto; }
.library { display: flex; flex-direction: column; min-height: calc(100vh - 76px); padding: 38px 26px 20px; border-right: 1px solid var(--line); background: rgba(255, 254, 250, .42); }
.library-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.library-heading .eyebrow { margin-bottom: 6px; font-size: .6rem; }
.library-heading h1 { margin: 0; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 1.45rem; font-weight: 600; letter-spacing: -.04em; }
.new-note { width: 40px; height: 40px; padding: 0; border-radius: 13px; font-size: 1.4rem; }
.search-wrap input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 12px;
  background: var(--card);
  color: var(--ink);
  font-size: .8rem;
}
.search-wrap input::placeholder { color: #a5a698; }
.filters { display: flex; gap: 4px; overflow-x: auto; margin: 15px -4px 8px; padding: 0 4px 5px; }
.filter { flex: none; border: 0; border-radius: 99px; padding: 7px 10px; background: transparent; color: var(--muted); font-size: .75rem; }
.filter:hover { color: var(--ink); }
.filter.is-active { background: var(--sage-pale); color: var(--sage-dark); font-weight: 700; }
.list-status { min-height: 1.2em; margin: 9px 0 4px; color: var(--muted); font-size: .73rem; }
.note-list { display: grid; gap: 7px; align-content: start; }
.note-card {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 13px;
  padding: 13px 14px;
  background: transparent;
  color: inherit;
  text-align: left;
}
.note-card:hover { background: rgba(255, 254, 250, .8); }
.note-card.is-selected { border-color: #e3e7dd; background: var(--card); box-shadow: 0 5px 16px rgba(58, 61, 49, .045); }
.note-card-title { display: block; overflow: hidden; font-size: .86rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.note-card-preview { display: block; overflow: hidden; margin-top: 6px; color: var(--muted); font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.note-card-meta { display: flex; justify-content: space-between; margin-top: 10px; color: #a4a595; font-size: .66rem; }
.note-kind { color: var(--sage-dark); }
.list-empty { padding: 24px 10px; color: var(--muted); font-size: .8rem; line-height: 1.7; text-align: center; }
.library-footnote { margin: auto 0 0; padding-top: 20px; color: #a2a294; font-size: .68rem; line-height: 1.6; }

.editor { min-width: 0; padding: clamp(24px, 6vw, 76px) clamp(22px, 7vw, 96px); }
.editor-empty { display: grid; min-height: 55vh; align-content: center; justify-items: center; text-align: center; }
.empty-illustration { display: grid; width: 64px; height: 64px; place-items: center; border: 1px solid #e8e8dd; border-radius: 22px; color: var(--sage); font-size: 1.7rem; }
.editor-empty h2 { margin: 24px 0 8px; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 1.3rem; font-weight: 600; }
.editor-empty p { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.8; }
.note-form { max-width: 780px; margin: 0 auto; }
.editor-toolbar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 35px; }
.editor-toolbar select { border: 1px solid var(--line); border-radius: 10px; padding: 0 11px; background: var(--card); color: var(--sage-dark); font-size: .78rem; }
.editor-actions { display: flex; gap: 7px; }
.save-button { min-width: 88px; }
.title-input { width: 100%; border: 0; padding: 0; background: transparent; color: var(--ink); font-family: "Nanum Myeongjo", "Batang", serif; font-size: clamp(1.7rem, 3vw, 2.35rem); font-weight: 600; letter-spacing: -.055em; }
.title-input:focus-visible { outline: none; box-shadow: 0 2px 0 var(--sage); }
.title-input::placeholder { color: #c4c4b8; }
.note-meta { min-height: 1.2em; margin: 12px 0 30px; color: #a2a294; font-size: .73rem; }
.note-form textarea { width: 100%; min-height: min(55vh, 620px); resize: vertical; border: 0; padding: 0; background: transparent; color: #51534a; font-size: .95rem; line-height: 1.95; }
.note-form textarea:focus-visible { outline: none; }
.note-form textarea::placeholder { color: #b0b1a5; }
.save-status { min-height: 1.3em; margin: 16px 0 0; color: var(--sage-dark); font-size: .78rem; }
.save-status.is-error { color: #a05240; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 3; max-width: calc(100vw - 48px); border-radius: 12px; padding: 12px 16px; background: #383a32; color: white; font-size: .82rem; box-shadow: var(--shadow); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

@media (max-width: 760px) {
  .topbar { height: 66px; padding: 0 16px; }
  .workspace { min-height: calc(100vh - 66px); grid-template-columns: 1fr; }
  .library { min-height: auto; padding: 25px 18px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .library-heading { margin-bottom: 16px; }
  .note-list { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); max-height: 250px; overflow: auto; }
  .library-footnote { display: none; }
  .editor { padding: 30px 22px 54px; }
  .editor-empty { min-height: 35vh; }
  .editor-toolbar { margin-bottom: 28px; }
  .account { gap: 4px; }
  .account-email { max-width: 130px; font-size: .68rem; }
}
@media (max-width: 420px) {
  .sign-in-card { margin-top: 7vh; padding: 40px 24px 32px; }
  .brand small { font-size: .63rem; }
  .note-list { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
