:root {
  color: #29392e;
  background: #f6f6f1;
  font: 15px/1.6 "Noto Sans KR", "Malgun Gothic", sans-serif;
  --ink: #29392e;
  --muted: #52634b;
  --green: #2e4433;
  --border: #dce0d4;
  --paper: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 1px solid #cdd5c6; background: var(--paper); color: var(--ink); border-radius: 7px; padding: 9px 15px; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid #647d51; outline-offset: 3px; }
.primary { background: var(--green); border-color: var(--green); color: white; }
.danger { color: #8c4336; }
input:not([type="checkbox"]), textarea, select { width: 100%; min-width: 0; border: 1px solid #cdd5c6; border-radius: 6px; padding: 10px 12px; color: var(--ink); background: var(--paper); }
textarea { resize: vertical; }
input[type="file"] { font-size: .875rem; }
small { color: var(--muted); }

.sidebar { position: fixed; inset: 0 auto 0 0; width: 218px; overflow-y: auto; display: flex; flex-direction: column; padding: 38px 24px 28px; background: #25392c; color: #dce4d6; }
.brand { display: inline-block; font: 49px/.9 Georgia, serif; letter-spacing: -3px; color: inherit; }
.brand span { display: block; margin-top: 9px; font: 10px/1.5 sans-serif; letter-spacing: 2px; }
.aside-label { margin: 52px 10px 10px; color: #acbda3; font-size: .75rem; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a { padding: 10px; border-radius: 7px; font-size: .93rem; }
.sidebar nav a:hover, .sidebar nav a[aria-current] { background: #ffffff16; color: white; }
.aside-foot { align-self: start; margin-top: auto; padding: 12px 10px 0; font-size: .82rem; color: #c7d3c1; }
.aside-foot button { padding: 0; border: 0; background: none; color: inherit; font: inherit; }
.sidebar :focus-visible { outline-color: #b6cba9; }

main { max-width: 1600px; margin-left: 218px; padding: 52px 5% 64px; }
.page-header { display: flex; justify-content: space-between; align-items: start; gap: 18px; }
.page-header h1 { margin: 0; font-size: clamp(1.5rem, 4.5vw, 2rem); font-weight: 600; letter-spacing: -.04em; }
.page-header p { color: var(--muted); margin: 8px 0 0; }
.page-header > button { flex: none; margin-top: 4px; }
.hero-shortcut { display: inline-block; margin-top: 10px; color: #405b35; font-size: .88rem; text-decoration: underline; text-underline-offset: 4px; }
#notice { margin: 16px 0; color: var(--muted); }
#notice:empty, #form-message:empty { display: none; }
#notice.error, #form-message.error { color: #8c372c; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 26px 0; }
.stats article { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 21px 24px; border: 1px solid var(--border); border-radius: 10px; background: var(--paper); }
.stats span { color: var(--muted); font-size: .88rem; }
.stats strong { color: #395238; font: 2.15rem Georgia, serif; }
.toolbar, .order-toolbar, .content-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.toolbar { border-bottom: 1px solid var(--border); padding-bottom: 15px; }
.filters { display: flex; margin-right: auto; gap: 4px; }
.filters button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); font-size: .9rem; }
.filters button[aria-pressed="true"] { border-color: var(--green); color: var(--green); font-weight: 600; }
#query { width: min(210px, 100%); }
.order-toolbar { justify-content: space-between; margin: 16px 0 20px; }
.order-toolbar p { margin: 0; color: var(--muted); font-size: .9rem; }
.order-toolbar > div, .order-actions { display: flex; gap: 8px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.card { overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--paper); }
.card > img, .card-placeholder { width: 100%; display: block; aspect-ratio: 1.55; object-fit: cover; background: #e9ede3; }
.card-copy { padding: 16px 18px; min-width: 0; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; background: #e9efdf; color: #405d2b; font-size: .8rem; }
.badge.draft { background: #f1eee7; color: #675b44; }
.card h2 { margin: 8px 0 4px; font-size: 1rem; overflow-wrap: anywhere; }
.card-meta { min-height: 1.5em; margin: 0; color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.card-actions button, .order-actions button { padding: 7px 10px; font-size: .86rem; }
.card-actions .danger { margin-left: auto; }
.order-actions { margin-top: 10px; }
.empty { padding: 38px 0; text-align: center; color: var(--muted); }

.content-tools { position: sticky; top: 0; z-index: 1; justify-content: end; background: #f6f6f1; padding: 16px 0; }
.content-group { margin-bottom: 18px; padding: 24px; border: 1px solid var(--border); border-radius: 10px; background: var(--paper); }
.hero-preview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; padding: 24px; background: #314236; color: #f4f4e9; border-radius: 10px; }
.hero-preview img { display: block; width: 100%; aspect-ratio: 1.5; object-fit: cover; border-radius: 6px; }
.hero-preview h2, .hero-preview p { margin: 0 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.hero-preview small { color: #d0ddc8; }

dialog { width: min(760px, 94vw); max-height: 90svh; border: 0; border-radius: 14px; padding: 28px; background: #fafbf6; color: var(--ink); }
dialog::backdrop { background: #16221aaa; }
.editor-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.editor-head h2 { margin: 0; }
#close-editor { border: 0; background: transparent; padding: 0 10px; font-size: 1.85rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.form-grid label { display: grid; gap: 6px; align-content: start; color: var(--muted); font-size: .92rem; }
.wide { grid-column: 1 / -1; }
.upload-zone { margin: 21px 0 12px; padding: 15px; border: 1px dashed #aab89d; border-radius: 8px; background: #f0f3e9; }
.upload-zone label { display: block; margin-bottom: 6px; font-weight: 600; cursor: pointer; }
.upload-zone small { display: block; font-weight: 400; }
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.photo img { display: block; width: 100%; aspect-ratio: 1.2; object-fit: cover; border-radius: 5px; }
.photo p { margin: 5px 0; color: var(--muted); font-size: .83rem; }
.photo > div { display: flex; flex-wrap: wrap; gap: 4px; }
.photo button { font-size: .82rem; padding: 5px 7px; }
.publish-toggle { display: flex; align-items: center; gap: 8px; }
.publish-toggle input { width: 18px; height: 18px; accent-color: var(--green); }
.helper { color: var(--muted); font-size: .87rem; }
.form-actions { display: flex; justify-content: end; flex-wrap: wrap; gap: 10px; margin-top: 20px; border-top: 1px solid var(--border); padding-top: 17px; }
#confirm-dialog { max-width: 440px; }
#confirm-dialog h2 { margin-top: 0; font-size: 1.25rem; }
#retry { margin-bottom: 16px; }

.auth-page { display: grid; place-items: center; min-height: 100svh; padding: 24px; background: #f4f2ee; color: #182938; }
.auth-page main { width: min(100%, 480px); margin: 0; padding: 36px; border: 1px solid #e4dfd7; border-radius: 18px; background: white; box-shadow: 0 16px 55px #1829380a; }
.auth-page .brand { font-size: 40px; }
.auth-page h1 { margin: 22px 0 8px; font-size: 1.65rem; }
.auth-page p { margin: 0 0 20px; }
.auth-page .primary { display: block; text-align: center; border-radius: 8px; padding: 12px; background: #182938; }

@media (max-width: 1120px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar { width: 180px; padding-inline: 18px; }
  main { margin-left: 180px; padding-inline: 4%; }
}
@media (max-width: 720px) {
  .sidebar { position: static; width: auto; display: grid; grid-template-columns: 1fr auto; padding: 19px 6%; gap: 14px; }
  .brand { font-size: 37px; }
  .brand span { font-size: 8px; }
  .aside-label { display: none; }
  .sidebar nav { grid-row: 2; grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 3px; }
  .sidebar nav a { padding: 6px 8px; font-size: .85rem; }
  .aside-foot { grid-row: 1; grid-column: 2; margin: 0; align-self: center; }
  main { margin: 0; padding: 28px 6% 45px; }
  .page-header { flex-wrap: wrap; gap: 9px; }
  .stats { gap: 8px; }
  .stats article { display: block; padding: 12px 9px; }
  .stats span { display: block; font-size: .81rem; }
  .stats strong { font-size: 1.75rem; }
  .filters { flex-basis: 100%; }
  #query { flex: 1; width: auto; }
  .cards, .form-grid, .hero-preview { grid-template-columns: minmax(0, 1fr); }
  .photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-group, .hero-preview, dialog, .auth-page main { padding: 19px; }
}
