:root {
  color-scheme: light;
  --ink: #17342d;
  --muted: #65746f;
  --cream: #f5f0e5;
  --paper: #fffdf8;
  --green: #1f6b55;
  --green-dark: #154b3d;
  --line: #d9ded8;
  --danger: #a73c38;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--cream); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { border: 0; border-radius: 999px; padding: .78rem 1.2rem; background: var(--green); color: white; font-weight: 700; cursor: pointer; }
button:hover { background: var(--green-dark); }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 .4rem; color: var(--green); font-size: .72rem; font-weight: 800; letter-spacing: .16em; }
.brand-mark { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: #0c1714; color: #a8e96d; font: 800 2rem Georgia, serif; }
.brand-mark.small { width: 34px; height: 34px; font-size: 1.35rem; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(circle at 25% 15%, #dce7c6, transparent 35%), var(--cream); }
.login-card { width: min(420px, 100%); padding: 2.2rem; border-radius: 28px; background: var(--paper); box-shadow: 0 24px 70px #274a3b1c; }
.login-card h1 { margin: .4rem 0; font-size: 2.2rem; }
.intro { color: var(--muted); line-height: 1.55; margin-bottom: 1.6rem; }
label { display: grid; gap: .45rem; margin: 1rem 0; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 13px; padding: .8rem .9rem; background: white; color: var(--ink); }
textarea { min-height: 130px; resize: vertical; line-height: 1.45; }
.message { min-height: 1.2rem; color: var(--danger); }
.studio { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1.5rem; padding: 1.3rem; background: var(--ink); color: white; }
.studio-brand { display: flex; align-items: center; gap: .7rem; }
nav { display: grid; gap: .35rem; }
nav button { width: 100%; border-radius: 12px; padding: .75rem .8rem; text-align: left; background: transparent; color: #d7e4df; font-weight: 600; }
nav button.active, nav button:hover { background: #ffffff18; color: white; }
.sidebar > .quiet { margin-top: auto; color: #d7e4df; }
.quiet { background: transparent; color: var(--ink); border: 1px solid currentColor; }
.workspace { padding: 2rem clamp(1rem, 4vw, 4rem); }
.workspace-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.workspace-header h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.2rem); }
.workspace-actions { display: flex; align-items: end; gap: .75rem; }
.sort-control { min-width: 170px; margin: 0; color: var(--muted); font-size: .78rem; }
.sort-control select { margin: 0; padding: .68rem .8rem; background: var(--paper); }
.notice { padding: .9rem 1rem; margin-bottom: 1rem; border-radius: 12px; background: #dff1e8; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.content-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 8px 30px #17342d0d; cursor: pointer; }
.content-card:hover { transform: translateY(-2px); box-shadow: 0 12px 35px #17342d18; }
.content-card img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #e5e7df; }
.card-body { padding: 1rem; }
.card-body h3 { margin: 0 0 .4rem; }
.meta { color: var(--muted); font-size: .86rem; }
.updated-date { margin-top: .4rem; color: var(--green-dark); font-size: .8rem; font-weight: 700; }
.badge { display: inline-block; margin-top: .7rem; padding: .25rem .55rem; border-radius: 999px; background: #e1eee8; color: var(--green-dark); font-size: .74rem; font-weight: 800; text-transform: uppercase; }
dialog { width: min(760px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); overflow: auto; border: 0; border-radius: 24px; padding: 0; background: var(--paper); color: var(--ink); box-shadow: 0 25px 90px #10291f55; }
dialog::backdrop { background: #10291f88; backdrop-filter: blur(5px); }
#editor-form { padding: 1.4rem; }
.dialog-header, .dialog-actions { display: flex; align-items: center; gap: .7rem; }
.dialog-header { justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
.dialog-header h2 { margin: 0; }
.dialog-actions { position: sticky; bottom: -1.4rem; margin: 1.4rem -1.4rem -1.4rem; padding: 1rem 1.4rem; border-top: 1px solid var(--line); background: var(--paper); }
.icon-button { width: 40px; height: 40px; padding: 0; background: transparent; color: var(--ink); font-size: 1.7rem; }
.spacer { flex: 1; }
.danger { background: var(--danger); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.preview-panel { margin-top: 1rem; padding: 1rem; border-radius: 16px; background: #e9eee7; }
.preview-panel img { display: block; max-width: 100%; max-height: 330px; margin: .7rem auto 0; border-radius: 12px; }
.image-picker { display: grid; grid-template-columns: 1fr auto; gap: .6rem; align-items: end; }
.empty { padding: 3rem 1rem; border: 1px dashed #adb9b3; border-radius: 18px; text-align: center; color: var(--muted); }
@media (max-width: 760px) {
  .studio { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  nav { grid-template-columns: repeat(2, 1fr); }
  .sidebar > .quiet { margin-top: 0; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .workspace-header { align-items: end; gap: 1rem; }
  .workspace-actions { align-items: stretch; flex-direction: column; }
  .sort-control { min-width: 150px; }
}
