:root {
  color-scheme: light;
  --ink: #1b2822;
  --muted: #78817b;
  --green: #355d4c;
  --green-dark: #233d32;
  --paper: #f7f7f4;
  --line: #e9ebe6;
  --white: #fff;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 14px/1.5 "Segoe UI", Arial, sans-serif; }
body:has(.auth-screen:not([hidden])) { background: #17251f; }
button:disabled { cursor: not-allowed; opacity: .48; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 2; display: flex; width: 252px; flex-direction: column; padding: 27px 17px 16px; color: #e8eee8; background: #17251f; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; width: 37px; height: 37px; place-items: center; border: 1px solid #718a7c; border-radius: 12px 12px 12px 3px; color: #f2d5a5; font: 24px/1 Georgia, serif; }
.brand-name { font: 23px/1 Georgia, serif; letter-spacing: -.7px; }
.brand-dot, .preview-logo span { color: #d7b889; }
.brand-name small { display: block; margin-top: 6px; color: #97a69c; font: 9px/1 "Segoe UI", Arial, sans-serif; letter-spacing: 1.7px; }
.workspace-label { margin: 42px 9px 12px; color: #819087; font-size: 10px; font-weight: 700; letter-spacing: 1.1px; }
.navigation { display: grid; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 43px; padding: 0 11px; border: 0; border-radius: 8px; color: #b7c1ba; background: transparent; text-align: left; }
.nav-link:hover { color: #fff; background: #24352c; }
.nav-link.active { color: #fff; background: #30483b; box-shadow: inset 3px 0 #d9bd91; }
.nav-icon { width: 19px; color: #a6b3a9; font-size: 18px; text-align: center; }
.nav-count { margin-left: auto; padding: 1px 7px; border-radius: 12px; color: #cad3cd; background: #3a4d42; font-size: 11px; }
.sidebar-bottom { margin-top: auto; }
.local-status { display: flex; align-items: center; gap: 10px; padding: 12px 10px; border: 1px solid #33443a; border-radius: 9px; }
.status-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #6fbd8b; }
.local-status strong, .local-status small, .user-card strong, .user-card small { display: block; }
.local-status strong { font-size: 12px; font-weight: 600; }
.local-status small { margin-top: 2px; color: #9baa9f; font-size: 10px; }
.user-card { display: flex; align-items: center; gap: 10px; margin-top: 13px; padding: 12px 4px 0; border-top: 1px solid #334139; }
.avatar, .top-avatar { display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 50%; color: #465e50; background: #e2d5bf; font-weight: 700; }
.user-card strong { font-size: 12px; }
.user-card small { margin-top: 2px; color: #96a39a; font-size: 10px; }
.user-menu { margin-left: auto; color: #b9c3bc; font-size: 20px; letter-spacing: 2px; }
.main-area { min-height: 100vh; margin-left: 252px; }
.topbar { position: sticky; top: 0; z-index: 1; display: flex; height: 65px; align-items: center; justify-content: space-between; padding: 0 38px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(12px); }
.breadcrumbs { color: #919992; font-size: 12px; }
.breadcrumbs span { margin: 0 9px; color: #c4c9c4; }
.breadcrumbs strong { color: #39483f; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 17px; }
.local-pill { display: flex; align-items: center; gap: 7px; color: #607066; font-size: 11px; }
.local-pill .status-dot { width: 6px; height: 6px; flex-basis: 6px; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; color: #59665d; background: white; font-size: 16px; }
.icon-button:hover { border-color: #b4c3b9; }
.top-avatar { width: 30px; height: 30px; }
.page-content { max-width: 1330px; margin: auto; padding: 34px 38px 70px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 25px; }
.eyebrow { color: #8b948c; font-size: 10px; font-weight: 700; letter-spacing: 1.3px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 4px 0 5px; font: 31px/1.2 Georgia, serif; letter-spacing: -.6px; }
.page-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.button { display: inline-flex; min-height: 39px; align-items: center; justify-content: center; gap: 7px; padding: 0 15px; border: 1px solid transparent; border-radius: 7px; font-size: 12px; font-weight: 600; }
.button.primary { color: white; background: var(--green); }
.button.primary:hover { background: var(--green-dark); }
.button.secondary { border-color: #e2e6df; color: #48564d; background: white; }
.button.secondary:hover { border-color: #c6d0c8; }
.button.small { min-height: 32px; padding: 0 10px; font-size: 11px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card, .panel, .project-card, .message-card, .setting-card, .media-card { border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.stat-card { min-height: 112px; padding: 16px 17px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: #78847b; font-size: 11px; }
.stat-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; color: var(--green); background: #edf3ee; font-size: 15px; }
.stat-value { margin-top: 10px; font: 26px/1 Georgia, serif; }
.stat-foot { margin-top: 5px; color: #8c958e; font-size: 10px; }
.stat-foot .positive { color: #4a9065; }
.notice-banner, .publish-notice { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 17px; padding: 11px 13px; border: 1px solid #dfe9df; border-radius: 8px; color: #627167; background: #f0f5ef; font-size: 11px; }
.notice-banner.pending { border-color: #e9dcc2; background: #faf6ed; }
.notice-banner strong { color: #365b48; }
.publish-error { margin-bottom: 17px; padding: 12px 14px; border: 1px solid #e6b9b2; border-radius: 8px; color: #7c3028; background: #fff3f1; font-size: 12px; }
.publish-error pre { max-height: 240px; margin: 8px 0 0; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.5 "Segoe UI", Arial, sans-serif; }
.publish-notice { align-items: center; margin-bottom: 14px; }
.publish-notice .status-dot { margin: 0 1px; }
.publish-notice strong { color: #42584a; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .9fr); gap: 17px; }
.panel { padding: 19px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-heading h2 { margin: 0; font: 18px/1.2 Georgia, serif; }
.text-button { padding: 4px 0; border: 0; color: #557460; background: transparent; font-size: 11px; font-weight: 600; }
.project-list { display: grid; }
.project-row { display: grid; grid-template-columns: 55px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid #f0f1ee; }
.project-thumb { width: 55px; height: 48px; overflow: hidden; border-radius: 6px; background: #e8e8e1; }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; }
.project-thumb.tone-2 { background: linear-gradient(135deg, #80938c, #e2d8c8 52%, #ad846b); }
.project-thumb.tone-3 { background: linear-gradient(135deg, #d2c2aa, #f1e7d8 50%, #82918a); }
.project-thumb.tone-4 { background: linear-gradient(135deg, #576b64, #d3c4ac 54%, #a67c63); }
.project-row h3 { margin: 0; font-size: 12px; font-weight: 600; }
.project-row p { margin: 3px 0 0; color: #929991; font-size: 10px; }
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 20px; color: #4d795a; background: #edf5ed; font-size: 9px; white-space: nowrap; }
.badge.draft { color: #867351; background: #f6f1e7; }
.activity-list { display: grid; gap: 16px; }
.activity-item { display: flex; gap: 10px; }
.activity-dot { width: 8px; height: 8px; flex: 0 0 8px; margin-top: 5px; border-radius: 50%; background: #9ab5a2; }
.activity-item strong { display: block; font-size: 11px; font-weight: 600; }
.activity-item p { margin: 2px 0 0; color: #919991; font-size: 10px; }
.activity-item time { display: block; margin-top: 4px; color: #a3aaa4; font-size: 9px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 17px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-button { padding: 7px 12px; border: 1px solid #e6e9e3; border-radius: 20px; color: #6e7971; background: white; font-size: 11px; }
.filter-button.active { border-color: #355d4c; color: white; background: #355d4c; }
.project-grid, .media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.project-card { overflow: hidden; }
.project-cover { display: flex; height: 153px; align-items: flex-end; padding: 12px; background: linear-gradient(145deg, #bba78b, #eee4d6 51%, #829187); }
.project-cover img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; }
.project-cover { position: relative; overflow: hidden; }
.cover-empty { align-self: center; margin: auto; color: #78817b; font-size: 11px; }
.project-cover.tone-2 { background: linear-gradient(145deg, #718880, #d7d1c2 53%, #a27b68); }
.project-cover.tone-3 { background: linear-gradient(145deg, #d2c4ac, #ece1d1 53%, #89988d); }
.project-cover.tone-4 { background: linear-gradient(145deg, #53695f, #c4b79f 53%, #ab8064); }
.project-cover.tone-5 { background: linear-gradient(145deg, #ad8c73, #e4d7c4 53%, #66776e); }
.project-cover.tone-6 { background: linear-gradient(145deg, #76837b, #e2d7c7 53%, #c2a789); }
.cover-label { padding: 4px 8px; border-radius: 4px; color: #fff; background: rgba(26,39,32,.68); font-size: 9px; }
.project-card-body { padding: 13px; }
.project-card-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.project-card h3 { margin: 0; font: 16px/1.2 Georgia, serif; }
.project-card p { margin: 6px 0 12px; color: #8b948d; font-size: 11px; }
.card-meta { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid #f0f1ee; color: #8b948d; font-size: 10px; }
.card-actions { display: flex; align-items: center; gap: 13px; }
.danger-text { color: #a64e43; }
.inbox-list { display: grid; gap: 10px; }
.message-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 16px; }
.message-card.unread { border-left: 3px solid #7ba386; }
.message-title { display: flex; align-items: center; gap: 8px; }
.message-title h3 { margin: 0; font-size: 13px; }
.message-card p { margin: 6px 0; color: #6e7971; font-size: 12px; }
.message-meta { color: #a0a7a1; font-size: 10px; }
.message-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.message-heading h3 { margin: 0 0 4px; font-size: 13px; }
.message-heading select { min-width: 130px; padding: 7px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); font-size: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.message-actions { display: flex; align-items: center; gap: 7px; }
.form-section { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.setting-card { padding: 18px; }
.setting-card h2 { margin: 0 0 13px; font: 17px/1.2 Georgia, serif; }
.setting-card label, .dialog label { display: block; margin-bottom: 12px; color: #68746b; font-size: 11px; font-weight: 600; }
.setting-card input, .setting-card textarea, .dialog input, .dialog select { display: block; width: 100%; margin-top: 5px; padding: 10px 11px; border: 1px solid #e3e7e1; border-radius: 6px; outline: none; color: #344239; background: #fff; font-size: 12px; }
.setting-card textarea { min-height: 85px; resize: vertical; }
.setting-card input:focus, .setting-card textarea:focus, .dialog input:focus, .dialog select:focus { border-color: #799382; box-shadow: 0 0 0 3px #e9f0eb; }
.language-tabs { display: flex; gap: 7px; margin-bottom: 12px; }
.language-tab { padding: 6px 10px; border: 1px solid #e5e9e3; border-radius: 5px; color: #69756c; background: white; font-size: 10px; }
.language-tab.active { border-color: #355d4c; color: #355d4c; background: #f1f5f1; }
.settings-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.setting-card .settings-toolbar input { flex: 1 1 220px; margin-top: 0; }
.site-section { margin-bottom: 10px; border: 1px solid #e5e9e3; border-radius: 8px; }
.site-section-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 13px; border: 0; border-radius: 8px; color: #344239; background: #f6f8f5; text-align: left; font-size: 12px; }
.site-section-head strong { flex: 1; }
.site-section-body { padding: 13px 13px 2px; }
.site-field { margin-bottom: 12px; padding-left: 8px; border-left: 3px solid transparent; }
.site-field.modified { border-left-color: #c9a86a; }
.site-field-head { display: flex; justify-content: space-between; gap: 8px; color: #68746b; font-size: 11px; font-weight: 600; }
.site-field-tools { display: flex; align-items: center; gap: 10px; }
.char-count { color: #98a39b; font-weight: 400; }
.upload-zone { display: grid; min-height: 136px; place-content: center; justify-items: center; gap: 6px; border: 1px dashed #cfd8d0; border-radius: 9px; color: #728078; background: #fbfcfa; text-align: center; }
.upload-zone strong { color: #4a5b50; font-size: 12px; }
.upload-zone span { font-size: 10px; }
.media-grid { margin-top: 15px; }
.media-card { overflow: hidden; }
.media-preview { height: 145px; background: linear-gradient(140deg, #bda98f, #e5dac9 50%, #809187); }
.media-preview.tone-2 { background: linear-gradient(140deg, #697d74, #e8dece 50%, #ad8068); }
.media-preview.tone-3 { background: linear-gradient(140deg, #d2c0a3, #f2e7d5 50%, #7d8b82); }
.media-caption { display: flex; align-items: center; justify-content: space-between; padding: 10px; color: #68746b; font-size: 10px; }
.media-upload-toolbar { display: flex; align-items: end; gap: 16px; margin: 12px 0; color: #78817b; font-size: 11px; }
.media-upload-toolbar label { display: grid; gap: 4px; color: #68746b; font-weight: 600; }
.media-upload-toolbar select { min-width: 220px; padding: 9px 10px; border: 1px solid #e3e7e1; border-radius: 6px; color: #344239; background: white; }
.media-preview { display: block; width: 100%; height: 145px; object-fit: cover; }
.existing-photos { display: flex; flex-wrap: wrap; gap: 9px; margin: 2px 0 14px; }
.existing-photo { display: grid; width: 88px; gap: 3px; justify-items: center; color: #78817b; font-size: 9px; }
.existing-photo img { width: 88px; height: 68px; border-radius: 5px; object-fit: cover; }
.field-help { display: block; margin-top: 5px; color: #8b948d; font-size: 10px; font-weight: 400; }
.auth-screen { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(ellipse at 50% 0%, #2a4035, #17251f 62%); }
.auth-card { display: grid; width: min(420px, 100%); gap: 13px; padding: 32px; border: 1px solid #34463b; border-radius: 13px; color: #e8eee8; background: #1d2c24; box-shadow: 0 20px 70px #0003; }
.auth-brand { margin-bottom: 13px; }
.auth-card .eyebrow { color: #d7b889; }
.auth-card h1 { margin: 0; color: #fff; font-size: 27px; }
.auth-card > p { margin: 0; color: #abb6ad; font-size: 12px; }
.auth-card label { display: grid; gap: 5px; color: #d0d8d1; font-size: 11px; }
.auth-card input { padding: 11px 12px; border: 1px solid #405249; border-radius: 6px; outline: none; color: white; background: #15221b; }
.auth-card input:focus { border-color: #9fb6a5; }
.auth-card small { color: #9eaaa1; font-size: 10px; }
.auth-error { min-height: 16px; color: #e49b8f !important; font-size: 11px !important; }
.logout-button { padding: 7px 10px; border: 1px solid #e5e9e3; border-radius: 7px; color: #647168; background: white; font-size: 11px; }
.logout-button:hover { border-color: #bdc9bf; color: #32473a; }
.empty-state { padding: 35px 20px; border: 1px dashed #dfe4dd; border-radius: 9px; color: #879188; text-align: center; }
.privacy-note { position: fixed; right: 0; bottom: 0; left: 252px; padding: 9px 24px; border-top: 1px solid #eceee9; color: #939b94; background: rgba(247,247,244,.96); font-size: 10px; text-align: center; }
.dialog { max-height: calc(100dvh - 40px); overflow-y: auto; width: min(460px, calc(100% - 28px)); padding: 22px; border: 1px solid #e3e8e2; border-radius: 12px; color: var(--ink); box-shadow: 0 20px 70px #16251f30; }
.project-dialog { width: min(640px, calc(100% - 28px)); }
.dialog::backdrop { background: #17251f75; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.dialog-heading h2 { margin: 4px 0 0; font: 23px/1.2 Georgia, serif; }
.close-button { width: 30px; height: 30px; border: 0; border-radius: 50%; color: #657168; background: #f1f3ef; font-size: 22px; line-height: 1; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.preview-dialog { width: min(1180px, calc(100% - 28px)); }
.preview-toolbar { display: flex; align-items: center; gap: 8px; margin: -7px 0 13px; }
.preview-toolbar .text-button { margin-left: auto; }
.website-preview { display: block; width: 100%; height: min(72vh, 760px); border: 1px solid #e5e6e1; border-radius: 7px; background: #0d0d0d; transition: width .2s ease; }
.website-preview.mobile { width: min(375px, 100%); margin-inline: auto; }
.website-preview.tablet { width: min(768px, 100%); margin-inline: auto; }
.preview-toolbar .filter-button[data-inspect].active { border-color: #3fa66b; color: #fff; background: #3fa66b; }
.global-card { margin-bottom: 14px; }
.check-grid, .field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 16px; }
.setting-card .check-row { display: flex; align-items: center; gap: 8px; }
.setting-card .check-row input { display: inline-block; width: auto; margin: 0; }
.setting-card select { display: block; width: 100%; margin-top: 5px; padding: 10px 11px; border: 1px solid #e3e7e1; border-radius: 6px; background: #fff; font-size: 12px; }
.hero-preview { display: block; max-width: 280px; max-height: 160px; margin: 0 0 12px; border-radius: 6px; object-fit: cover; }
.catalog-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12px; }
.site-field.flash { background: #eaf6ee; transition: background .4s; }
.toast { position: fixed; right: 22px; bottom: 24px; z-index: 5; padding: 11px 16px; transform: translateY(12px); border-radius: 8px; color: #fff; background: #263d31; box-shadow: 0 8px 25px #16251f2b; opacity: 0; pointer-events: none; transition: .2s ease; font-size: 12px; }
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 1050px) {
  .sidebar { width: 218px; }
  .main-area { margin-left: 218px; }
  .privacy-note { left: 218px; }
  .page-content { padding-right: 24px; padding-left: 24px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-grid, .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .sidebar { position: static; width: auto; min-height: auto; padding: 13px 15px; }
  .brand { padding: 0; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-name { font-size: 20px; }
  .workspace-label, .sidebar-bottom { display: none; }
  .navigation { display: flex; overflow-x: auto; gap: 5px; margin-top: 14px; }
  .nav-link { min-width: max-content; min-height: 36px; gap: 6px; padding: 0 9px; font-size: 11px; }
  .nav-link.active { box-shadow: inset 0 -2px #d9bd91; }
  .nav-icon { width: auto; font-size: 14px; }
  .nav-count { padding: 0 5px; }
  .main-area { margin-left: 0; }
  .topbar { height: 48px; padding: 0 15px; }
  .local-pill { display: none; }
  .topbar-actions { gap: 10px; }
  .page-content { padding: 23px 15px 64px; }
  .page-heading { align-items: flex-start; }
  h1 { font-size: 27px; }
  .page-heading .button { min-height: 35px; padding: 0 10px; font-size: 10px; }
  .dashboard-grid, .form-section { grid-template-columns: 1fr; }
  .project-grid, .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .project-cover { height: 115px; }
  .project-card h3 { font-size: 14px; }
  .project-card-body { padding: 10px; }
  .project-card p { font-size: 10px; }
  .toolbar { align-items: flex-start; }
  .privacy-note { left: 0; padding: 8px; font-size: 9px; }
}
@media (max-width: 390px) {
  .nav-link { font-size: 10px; }
  .nav-count { display: none; }
  .stats-grid { gap: 8px; }
  .stat-card { padding: 12px; }
  .project-grid, .media-grid { grid-template-columns: 1fr; }
  .message-card { grid-template-columns: 1fr; }
}

.nav-editor { display: grid; gap: 10px; margin-bottom: 12px; }
.nav-row-edit { display: grid; grid-template-columns: auto minmax(160px, 1fr) minmax(160px, 1fr) auto; align-items: end; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.nav-row-edit .nav-move { display: flex; gap: 4px; }
.nav-row-edit .icon-button { min-width: 32px; height: 32px; }
.nav-row-edit .icon-button:disabled { opacity: .3; cursor: default; }
.media-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.media-slot { display: grid; align-content: start; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.media-slot-preview { width: 100%; max-height: 150px; object-fit: contain; border-radius: 8px; background: #f3f5f3; }
@media (max-width: 760px) { .nav-row-edit { grid-template-columns: 1fr; } }
