:root {
  --green: #0b4b38;
  --green-deep: #07382b;
  --green-soft: #dfece4;
  --sage: #8fa99b;
  --gold: #c39b4a;
  --ivory: #f5f1e8;
  --paper: #fbfaf6;
  --white: #ffffff;
  --ink: #1d2924;
  --muted: #68736e;
  --line: rgba(11, 75, 56, .14);
  --danger: #a23b3b;
  --danger-soft: #f6e7e4;
  --sidebar-width: 240px;
  --shadow: 0 18px 46px rgba(22, 48, 38, .09);
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; color: var(--ink); background: var(--ivory); font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sidebar-width); display: flex; flex-direction: column; padding: 0 13px 15px; overflow-y: auto; background: var(--green-deep); color: white; }
.brand { margin: 0 -13px 10px; min-height: 90px; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 13px 21px 11px; background: var(--paper); border-bottom: 1px solid var(--line); color: var(--green); }
.brand img { display: block; width: 181px; height: auto; }
.brand > span { padding-left: 46px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.main-nav { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav-search { display: grid; grid-template-columns: minmax(0,1fr) 32px; gap: 5px; margin: 7px 2px 0; }
.nav-search input { min-width: 0; height: 36px; padding: 8px 9px; border: 1px solid rgba(255,255,255,.13); border-radius: 8px; background: rgba(255,255,255,.08); color: white; outline: none; font-size: 10px; }
.nav-search input::placeholder { color: rgba(255,255,255,.45); }
.nav-search button { border: 0; border-radius: 8px; background: rgba(255,255,255,.1); color: white; }
.nav-section { margin: 22px 11px 7px; color: rgba(255,255,255,.46); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.main-nav > a { min-height: 43px; display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 10px; color: rgba(255,255,255,.72); font-size: 13px; transition: background .16s ease, color .16s ease; }
.main-nav > a:hover { background: rgba(255,255,255,.08); color: white; }
.main-nav > a.active { background: var(--paper); color: var(--green-deep); font-weight: 800; box-shadow: 0 9px 24px rgba(0,0,0,.13); }
.nav-icon { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 8px; font-size: 10px; font-weight: 800; }
.sidebar-user { margin-top: 20px; min-height: 58px; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.07); }
.user-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--gold); color: white; font-weight: 900; }
.user-meta { min-width: 0; }
.user-meta strong, .user-meta small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta strong { font-size: 12px; }
.user-meta small { margin-top: 3px; color: rgba(255,255,255,.5); font-size: 9px; }
.sidebar-user button { padding: 0; border: 0; background: transparent; color: rgba(255,255,255,.56); font-size: 10px; }

.main-content { min-height: 100vh; margin-left: var(--sidebar-width); padding: 36px clamp(24px, 4vw, 58px) 60px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 26px; }
.page-header h1 { margin: 9px 0 7px; color: var(--green-deep); font-family: "Noto Serif SC", "Songti SC", STSong, serif; font-size: clamp(31px, 3.2vw, 45px); font-weight: 600; letter-spacing: -.035em; }
.page-header p, .form-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.eyebrow { color: var(--gold); font-size: 9px; font-weight: 900; letter-spacing: .18em; }
.segmented { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.62); }
.segmented a { min-width: 58px; padding: 8px 14px; border-radius: 999px; text-align: center; color: var(--muted); font-size: 11px; font-weight: 800; }
.segmented a.active { background: var(--green); color: white; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; margin-bottom: 20px; }
.metric-card { min-height: 134px; display: flex; flex-direction: column; justify-content: space-between; padding: 19px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); box-shadow: 0 8px 26px rgba(22,48,38,.045); transition: transform .16s ease, box-shadow .16s ease; }
.metric-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.metric-card span, .metric-card small { color: var(--muted); font-size: 11px; }
.metric-card strong { color: var(--green); font-family: Georgia, serif; font-size: 34px; font-weight: 500; }
.metric-card.urgent { border-color: rgba(162,59,59,.25); background: linear-gradient(135deg, var(--paper), var(--danger-soft)); }
.metric-card.urgent strong { color: var(--danger); }
.workspace-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(260px,.7fr); gap: 20px; align-items: start; }
.search-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; align-items: start; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 8px 26px rgba(22,48,38,.045); }
.panel-heading { min-height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.panel-heading h2, .settings-card h2 { margin: 6px 0 0; color: var(--green-deep); font-size: 17px; }
.record-row { min-height: 72px; display: grid; grid-template-columns: 76px minmax(0,1fr) 10px; align-items: center; gap: 13px; padding: 11px 20px; border-bottom: 1px solid var(--line); }
.record-row:last-child { border-bottom: 0; }
.record-row:hover { background: rgba(223,236,228,.42); }
.record-kind { color: var(--gold); font-size: 10px; font-weight: 900; }
.record-main { min-width: 0; }
.record-main strong, .record-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-main strong { font-size: 13px; }
.record-main small { margin-top: 6px; color: var(--muted); font-size: 10px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.status-dot.danger { background: var(--danger); }
.empty-state { padding: 54px 22px; text-align: center; }
.empty-state strong { color: var(--green-deep); }
.empty-state p, .panel-note { color: var(--muted); font-size: 11px; line-height: 1.7; }
.summary-line { display: flex; justify-content: space-between; align-items: center; min-height: 62px; padding: 13px 20px; border-bottom: 1px solid var(--line); font-size: 12px; }
.summary-line strong { color: var(--green); font-family: Georgia, serif; font-size: 23px; font-weight: 500; }
.panel-note { margin: 0; padding: 17px 20px 21px; }
.settings-card { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 24px; }
.settings-card p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.settings-card form { display: flex; align-items: center; gap: 12px; }
.feature-state { padding: 7px 11px; border-radius: 999px; background: #eeeae1; color: var(--muted); font-size: 10px; font-weight: 800; }
.feature-state.enabled { background: var(--green-soft); color: var(--green); }
.button { min-height: 42px; display: inline-grid; place-items: center; padding: 9px 17px; border: 0; border-radius: 10px; font-size: 12px; font-weight: 800; }
.button.primary { background: var(--green); color: white; box-shadow: 0 11px 24px rgba(11,75,56,.18); }
.button.wide { width: 100%; }
.button.secondary { border: 1px solid var(--line); background: var(--paper); color: var(--green); }
.button.text { min-height: 34px; padding: 5px 7px; background: transparent; color: var(--green); box-shadow: none; }
.button.text.muted { color: var(--muted); }
.button.small { min-height: 35px; padding: 6px 11px; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.header-actions, .card-actions, .form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-bar { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(251,250,246,.74); }
.filter-bar input[type="text"], .filter-bar input:not([type]), .filter-bar select { min-height: 40px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.filter-bar input[name="q"] { min-width: 280px; flex: 1; }
.check-filter { color: var(--muted); font-size: 11px; white-space: nowrap; }
.source-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.source-card { min-height: 250px; display: flex; flex-direction: column; padding: 19px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 7px 24px rgba(22,48,38,.04); }
.source-card-top { display: flex; align-items: center; gap: 7px; }
.source-card-top time { margin-left: auto; color: var(--muted); font-size: 9px; }
.source-card > p { flex: 1; max-height: 150px; overflow: hidden; margin: 17px 0; color: #35433d; font-size: 13px; line-height: 1.85; }
.source-meta { display: flex; gap: 14px; margin-bottom: 12px; color: var(--muted); font-size: 10px; }
.card-actions { padding-top: 12px; border-top: 1px solid var(--line); }
.status-chip, .hot-chip { display: inline-flex; align-items: center; min-height: 23px; padding: 4px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 900; white-space: nowrap; }
.hot-chip { background: #f3e7c8; color: #8a681f; }
.status-chip.danger { background: var(--danger-soft); color: var(--danger); }
.status-chip.warn { background: #f6ecd2; color: #89671c; }
.status-chip.ok { background: var(--green-soft); color: var(--green); }
.form-panel { max-width: 930px; padding: 24px; }
.form-panel > .panel-heading { margin: -24px -24px 22px; }
.form-panel .field-group { margin-bottom: 18px; }
.field-group textarea, .field-group input:not([type="checkbox"]), .field-group select { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); outline: none; }
.field-group textarea:focus, .field-group input:focus, .field-group select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(11,75,56,.08); }
.field-group textarea { resize: vertical; line-height: 1.75; }
.checkbox-field { display: flex; align-items: center; gap: 9px; }
.checkbox-field label { order: 2; }
.help-text, .field-error { display: block; margin-top: 5px; font-size: 10px; }
.help-text { color: var(--muted); }
.field-error { color: var(--danger); }
.form-actions { justify-content: flex-end; margin-top: 25px; }
.preview-panel { margin-bottom: 16px; }
.preview-row { min-height: 86px; display: grid; grid-template-columns: 34px minmax(0,1fr) 110px; align-items: start; gap: 13px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.preview-row:last-child { border-bottom: 0; }
.preview-row.duplicate { opacity: .62; background: var(--danger-soft); }
.preview-row.blocked { background: var(--danger-soft); }
.preview-row.blocked .preview-editor { background: rgba(255,255,255,.7); }
.preview-index { color: var(--gold); font: 11px Georgia,serif; }
.preview-row p { max-height: 94px; overflow: auto; margin: 0; font-size: 12px; line-height: 1.7; }
.preview-editor { width: 100%; min-height: 96px; padding: 10px 12px; resize: vertical; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); font-size: 12px; line-height: 1.7; }
.sticky-actions { position: sticky; bottom: 14px; width: max-content; margin-left: auto; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: rgba(251,250,246,.94); box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th, .data-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; }
.data-table th { color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.data-table tr:last-child td { border-bottom: 0; }
.table-title { color: var(--green-deep); font-weight: 800; }
.row-link { color: var(--green); font-weight: 800; }
.inline-danger { margin-left: 8px; color: var(--danger); font-size: 9px; }
.pagination { display: flex; justify-content: center; gap: 16px; margin-top: 20px; color: var(--muted); font-size: 11px; }
.pagination a { color: var(--green); font-weight: 800; }
.detail-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(300px,.65fr); gap: 20px; align-items: start; }
.detail-aside { display: grid; gap: 15px; }
.side-form { padding: 18px; }
.immutable-source { margin-bottom: 20px; padding: 17px; border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0; background: #f3eee3; }
.immutable-source span { color: var(--gold); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.immutable-source p { max-height: 220px; overflow: auto; margin: 10px 0 0; color: #4d5954; font-size: 11px; line-height: 1.8; }
.platform-line { display: flex; align-items: center; justify-content: space-between; min-height: 50px; padding: 10px 18px; border-bottom: 1px solid var(--line); font-size: 11px; }
.platform-line:last-child { border-bottom: 0; }
.platform-line strong { color: var(--green); font-size: 10px; }
.calendar-wrap { overflow-x: auto; }
.calendar-head, .calendar-grid { min-width: 860px; display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); }
.calendar-head span { padding: 12px; border-bottom: 1px solid var(--line); color: var(--muted); text-align: center; font-size: 9px; font-weight: 800; }
.calendar-day { min-height: 145px; padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.blank { background: rgba(223,236,228,.2); }
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--gold); }
.calendar-number { display: block; margin-bottom: 8px; color: var(--green-deep); font: 15px Georgia,serif; }
.calendar-task { display: grid; gap: 3px; margin-bottom: 5px; padding: 6px 7px; border-left: 2px solid var(--green); border-radius: 5px; background: var(--green-soft); }
.calendar-task span { color: var(--green); font-size: 8px; font-weight: 900; }
.calendar-task b { overflow: hidden; color: var(--ink); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-task.status-delayed { border-left-color: var(--danger); background: var(--danger-soft); }
.calendar-task.status-published { opacity: .68; }
.table-sub { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(7,56,43,.28); backdrop-filter: blur(2px); }
.drawer-backdrop a { position: absolute; inset: 0; }
.drawer { position: fixed; z-index: 80; inset: 0 0 0 auto; width: min(640px,92vw); display: flex; flex-direction: column; background: var(--paper); box-shadow: -24px 0 70px rgba(7,56,43,.18); animation: drawer-in .18s ease-out; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: .5; } }
.drawer > header { min-height: 108px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 26px; border-bottom: 1px solid var(--line); }
.drawer > header h2 { margin: 7px 0 4px; color: var(--green-deep); font-family: "Noto Serif SC","Songti SC",serif; font-size: 28px; }
.drawer > header p { margin: 0; color: var(--muted); font-size: 10px; }
.drawer-close { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 23px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px 26px 40px; }
.drawer-module { margin-bottom: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.drawer-module h3 { margin: 0 0 14px; color: var(--green-deep); font-size: 14px; }
.module-heading { display: flex; align-items: center; justify-content: space-between; }
.module-heading a { color: var(--green); font-size: 10px; font-weight: 800; }
.drawer-module dl { margin: 0; }
.drawer-module dl > div { display: grid; grid-template-columns: 92px minmax(0,1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.drawer-module dl > div:last-child { border-bottom: 0; }
.drawer-module dt { color: var(--muted); }
.drawer-module dd { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.drawer-row { min-height: 52px; display: grid; grid-template-columns: 88px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 10px; }
.drawer-row:last-child { border-bottom: 0; }
.drawer-row span, .drawer-row small { color: var(--muted); }
.module-empty { margin: 0; color: var(--muted); font-size: 11px; }
.credential-module { background: linear-gradient(145deg,#f3eee3,var(--paper)); }
.credential-value { margin-bottom: 12px; padding: 13px; overflow-wrap: anywhere; border: 1px dashed rgba(11,75,56,.28); border-radius: 9px; background: rgba(255,255,255,.7); color: var(--green-deep); font: 14px Consolas,monospace; }
.credential-module p { margin: 10px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.duplicate-warning { max-width: 930px; margin-bottom: 15px; padding: 18px 21px; border: 1px solid rgba(195,155,74,.35); border-radius: 13px; background: #f6ecd2; }
.duplicate-warning h2 { margin: 7px 0 5px; color: var(--green-deep); font-size: 16px; }
.duplicate-warning p { margin: 5px 0; color: #655a3f; font-size: 11px; line-height: 1.6; }
.customer-profile { overflow: hidden; }
.profile-list { margin: 0; padding: 8px 20px 20px; }
.profile-list > div { display: grid; grid-template-columns: 130px minmax(0,1fr); gap: 15px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.profile-list > div:last-child { border-bottom: 0; }
.profile-list dt { color: var(--muted); }
.profile-list dd { margin: 0; line-height: 1.7; }
.touch-row { display: grid; grid-template-columns: 100px 130px minmax(0,1fr); align-items: start; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 10px; }
.touch-row:last-child { border-bottom: 0; }
.touch-row span { color: var(--muted); }
.touch-row p { margin: 0; color: #4c5a54; line-height: 1.6; }
.metric-inline { min-width: 190px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.metric-inline span, .metric-inline strong { display: block; }
.metric-inline span { color: var(--muted); font-size: 9px; }
.metric-inline strong { margin-top: 8px; color: var(--green); font: 24px Georgia,serif; }
.team-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.team-card { min-height: 78px; display: grid; grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.team-card > div { min-width: 0; }
.team-card > div strong, .team-card > div small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-card > div strong { color: var(--green-deep); font-size: 13px; }
.team-card > div small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.team-card.inactive { opacity: .55; }
.center-state { max-width: 620px; margin: 16vh auto 0; padding: 48px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); text-align: center; }
.center-state h1 { color: var(--green-deep); font-family: "Noto Serif SC", "Songti SC", serif; font-size: 36px; }
.center-state p { color: var(--muted); line-height: 1.8; }
.message-stack { position: fixed; z-index: 100; top: 18px; right: 24px; display: grid; gap: 8px; }
.message { padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); box-shadow: var(--shadow); color: var(--green); font-size: 12px; }

.mobile-header, .sidebar-backdrop { display: none; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 12% 10%, rgba(195,155,74,.15), transparent 30%), var(--ivory); }
.login-shell { width: min(980px, 100%); min-height: 610px; display: grid; grid-template-columns: 1.12fr .88fr; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--paper); box-shadow: 0 35px 90px rgba(7,56,43,.15); }
.login-brand-panel { position: relative; padding: 50px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; background: linear-gradient(145deg, var(--green-deep), var(--green)); color: white; }
.login-brand-panel::after { content: "TS"; position: absolute; right: -24px; bottom: -75px; color: rgba(255,255,255,.045); font: 260px/1 Georgia, serif; }
.login-logo { position: relative; z-index: 1; width: 230px; padding: 11px 14px; border-radius: 12px; background: var(--paper); }
.login-statement { position: relative; z-index: 1; }
.login-statement > span { color: #e7c778; font-size: 10px; font-weight: 900; letter-spacing: .2em; }
.login-statement h1 { margin: 19px 0 20px; font-family: "Noto Serif SC", "Songti SC", serif; font-size: clamp(34px,4vw,52px); font-weight: 500; line-height: 1.35; }
.login-statement p { color: rgba(255,255,255,.63); font-size: 12px; letter-spacing: .06em; }
.login-form-panel { display: grid; place-items: center; padding: 50px; }
.login-form { width: min(330px,100%); }
.form-heading { margin-bottom: 30px; }
.form-heading h2 { margin: 9px 0 8px; color: var(--green-deep); font-family: "Noto Serif SC", "Songti SC", serif; font-size: 31px; }
.field-group { display: grid; gap: 7px; margin-bottom: 17px; }
.field-group label { color: var(--muted); font-size: 11px; font-weight: 800; }
.field-group input { width: 100%; min-height: 47px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; background: white; outline: none; }
.field-group input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(11,75,56,.09); }
.form-errors { margin-bottom: 16px; padding: 10px 12px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-size: 11px; }

@media (max-width: 960px) {
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .workspace-grid { grid-template-columns: 1fr; }
  .search-grid { grid-template-columns: 1fr; }
  .source-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --sidebar-width: min(86vw, 310px); }
  .sidebar { transform: translateX(-102%); transition: transform .18s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.show { position: fixed; inset: 0; z-index: 35; display: block; background: rgba(0,0,0,.36); }
  .mobile-header { position: sticky; top: 0; z-index: 30; min-height: 60px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: rgba(251,250,246,.94); backdrop-filter: blur(12px); }
  .mobile-header button { min-height: 40px; border: 0; border-radius: 9px; background: var(--green-soft); color: var(--green); }
  .mobile-brand { display: flex; align-items: center; gap: 8px; color: var(--green-deep); font-size: 12px; }
  .mobile-brand img { width: 34px; height: 34px; object-fit: cover; border-radius: 9px; }
  .main-content { margin-left: 0; padding: 24px 15px 45px; }
  .page-header { align-items: flex-start; flex-direction: column; gap: 16px; }
  .page-header h1 { font-size: 34px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { min-height: 116px; padding: 15px; }
  .settings-card { align-items: flex-start; flex-direction: column; }
  .settings-card form { width: 100%; align-items: stretch; flex-direction: column; }
  .header-actions { width: 100%; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-bar input[name="q"] { min-width: 0; width: 100%; }
  .preview-row { grid-template-columns: 25px minmax(0,1fr); }
  .preview-row > div { grid-column: 2; }
  .sticky-actions { width: 100%; justify-content: stretch; }
  .sticky-actions .button { flex: 1; }
  .login-page { padding: 0; }
  .login-shell { min-height: 100vh; grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .login-brand-panel { min-height: 280px; padding: 30px; }
  .login-logo { width: 190px; }
  .login-statement h1 { margin-block: 14px; font-size: 32px; }
  .login-form-panel { padding: 38px 26px; }
  .drawer { width: 100vw; }
  .drawer > header, .drawer-body { padding-inline: 18px; }
  .team-grid { grid-template-columns: 1fr; }
  .profile-list > div { grid-template-columns: 1fr; gap: 5px; }
  .touch-row { grid-template-columns: 1fr; gap: 5px; }
  .data-table-wrap { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .data-table { min-width: 0; }
  .data-table thead { display: none; }
  .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr { margin-bottom: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); box-shadow: 0 6px 18px rgba(22,48,38,.04); }
  .data-table td { padding: 5px 0; border: 0; font-size: 12px; }
  .data-table td[data-label] { display: grid; grid-template-columns: 78px minmax(0,1fr); gap: 10px; align-items: start; }
  .data-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 10px; font-weight: 700; }
  .data-table td:last-child { padding-top: 10px; }
  .calendar-wrap { overflow: visible; }
  .calendar-head { display: none; }
  .calendar-grid { min-width: 0; display: block; }
  .calendar-day { min-height: 82px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px; }
  .calendar-day.blank { display: none; }
}

@media (max-width: 390px) {
  .metric-grid { grid-template-columns: 1fr; }
}

/* v2: compact, durable operating surfaces */
.filter-shell { margin-bottom: 20px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(135deg, rgba(255,255,255,.94), rgba(243,238,224,.62)); box-shadow: 0 8px 24px rgba(7,56,43,.04); }
.filter-primary, .more-filters > div { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.filter-primary > input:first-child { min-width: 260px; flex: 1; }
.filter-shell input, .filter-shell select { min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-pills label { position: relative; cursor: pointer; }
.filter-pills input {
  position: absolute;
  width: 1px !important;
  height: 1px;
  min-height: 0 !important;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.filter-pills span { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--muted); font-size: 11px; font-weight: 800; }
.filter-pills input:checked + span { border-color: var(--green); background: var(--green); color: white; }
.filter-reset { color: var(--muted); font-size: 11px; font-weight: 800; }
.more-filters { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.more-filters summary { cursor: pointer; color: var(--green); font-size: 11px; font-weight: 900; }
.more-filters > div { margin-top: 10px; }
.more-filters label { display: grid; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 800; }
.filter-count { margin-top: 10px; color: var(--muted); font-size: 10px; }
.page-tabs { display: flex; gap: 4px; margin-top: -4px; margin-bottom: 18px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.7); }
.page-tabs a { padding: 8px 15px; border-radius: 9px; color: var(--muted); font-size: 11px; font-weight: 900; }
.page-tabs a.active { background: var(--green); color: white; }
.source-card.archived { opacity: .65; }
.similarity-alert { margin-top: 18px; padding: 18px; border: 1px solid #d5b75f; border-radius: 14px; background: #fff9e9; }
.similarity-alert.exact { border-color: var(--danger); background: var(--danger-soft); }
.similarity-alert h2 { margin: 4px 0 6px; }
.similarity-alert article { margin-top: 10px; padding: 12px; border-radius: 10px; background: rgba(255,255,255,.75); }
.similarity-alert article p { margin: 6px 0; }
.match-card { margin-top: 5px; padding: 8px; border: 1px solid #d5b75f; border-radius: 8px; background: #fff9e9; }
.match-card.exact { border-color: var(--danger); background: var(--danger-soft); }
.match-card p { margin: 5px 0; font-size: 10px; }
.team-card { display: grid; }
.team-card-main { display: flex; align-items: center; gap: 12px; color: inherit; }
.team-card-main > div { flex: 1; display: grid; }
.team-actions { display: flex; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 10px; font-weight: 800; }
.team-actions form { margin: 0; }
.team-actions button { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.danger-link { color: var(--danger) !important; }
.button.danger { background: var(--danger); color: white; }
.danger-panel { border-color: rgba(176,55,55,.32); }
.brand-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.brand-content-card { display: flex; min-height: 320px; flex-direction: column; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(155deg, #fff 0%, #faf7ee 100%); color: inherit; box-shadow: 0 16px 40px rgba(7,56,43,.06); transition: transform .18s ease, box-shadow .18s ease; }
.brand-content-card:hover { transform: translateY(-3px); box-shadow: 0 20px 46px rgba(7,56,43,.1); }
.brand-content-card.status-archived { opacity: .64; }
.brand-card-top, .brand-content-card footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand-content-card h2 { margin: 22px 0 10px; font-family: Georgia, 'Noto Serif SC', serif; font-size: 22px; }
.brand-point { color: var(--green); font-weight: 800; }
.brand-copy { flex: 1; color: var(--muted); line-height: 1.7; }
.brand-content-card footer { padding-top: 14px; border-top: 1px solid var(--line); }
.brand-content-card footer b { margin-left: auto; color: var(--green); font-size: 10px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 16px; }
.tag-row span { padding: 5px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 800; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(240px, .7fr) minmax(220px, .55fr); gap: 16px; margin-bottom: 16px; }
.chart-panel { min-height: 250px; }
.panel-total { color: var(--green); }
.mini-trend { display: flex; align-items: end; gap: 4px; height: 160px; padding-top: 22px; }
.trend-column { position: relative; display: flex; flex: 1; height: 100%; align-items: end; }
.trend-column span { display: block; width: 100%; min-height: 2px; border-radius: 5px 5px 2px 2px; background: linear-gradient(to top, var(--green), #89aa73); }
.trend-column small { position: absolute; bottom: -20px; left: 0; color: var(--muted); font-size: 7px; white-space: nowrap; }
.bar-list { display: grid; gap: 16px; margin-top: 20px; }
.bar-row { display: grid; grid-template-columns: 56px 1fr 28px; gap: 8px; align-items: center; font-size: 10px; }
.bar-row > div { height: 9px; overflow: hidden; border-radius: 99px; background: var(--green-soft); }
.bar-row i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.topic-cloud { min-height: 104px; display: flex; align-content: center; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: 18px 20px 10px; }
.topic-panel { min-height: 0; display: flex; flex-direction: column; }
.topic-panel .topic-cloud { flex: 1; }
.topic-cloud a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid rgba(7,82,61,.13); border-radius: 999px; background: rgba(223,236,228,.38); color: var(--green-deep); transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.topic-cloud a:hover { transform: translateY(-1px); border-color: rgba(7,82,61,.32); background: var(--green-soft); }
.topic-cloud a strong { min-width: 21px; height: 21px; display: grid; place-items: center; padding-inline: 5px; border-radius: 999px; background: #fff; color: var(--green); font-size: 9px; }
.topic-level-1 { font-size: 11px; }
.topic-level-2 { font-size: 13px; font-weight: 700; }
.topic-level-3 { font-size: 15px; font-weight: 800; }
.topic-level-4 { font-size: 18px; font-weight: 900; }
.topic-note { margin: 0 20px 18px; color: var(--muted); font-size: 9px; }
.dashboard-empty { min-height: 165px; display: grid; align-content: center; margin: 0 20px 20px; }
.pending-total { color: var(--orange); font-size: 12px; }
.asset-task-list { display: grid; gap: 9px; margin-top: 14px; }
.asset-task { min-height: 49px; display: flex; align-items: center; gap: 12px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.62); color: var(--ink); }
.asset-task:hover { border-color: rgba(7,82,61,.28); background: #fff; }
.asset-task > span { min-width: 0; display: grid; gap: 3px; }
.asset-task small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.asset-task b { min-width: 30px; height: 30px; display: grid; place-items: center; margin-left: auto; border-radius: 9px; background: var(--green-soft); color: var(--green); font-size: 13px; }
.asset-task.urgent b, .asset-task.danger b { background: var(--danger-soft); color: var(--danger); }
.asset-task.warning b { background: #fff2d7; color: #89671c; }
.asset-all-clear { min-height: 155px; display: grid; place-items: center; align-content: center; gap: 7px; text-align: center; }
.asset-all-clear > span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 20px; font-weight: 900; }
.asset-all-clear small { max-width: 190px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.active-filter-note { display: inline-flex; margin-left: 8px; padding: 4px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-weight: 800; }
.slot-card { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(251,250,246,.7); }
.slot-label { color: var(--muted); font-size: 9px; font-weight: 900; }
.slot-main { display: grid; margin-top: 6px; }
.slot-accounts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.slot-accounts a, .slot-accounts span { padding: 5px 8px; border-radius: 8px; background: white; color: var(--green); font-size: 9px; }
.inline-create { margin-top: 12px; }
.inline-create summary { cursor: pointer; color: var(--green); font-weight: 900; }
.inline-create form { display: grid; gap: 8px; margin-top: 10px; }
.choice-row { display: flex; gap: 12px; font-size: 10px; }
.relation-warning { margin-top: 12px; padding: 10px; border-radius: 9px; background: #fff2d7; color: #89671c; font-size: 10px; }
.row-actions { display: flex; align-items: center; gap: 8px; }
.inline-operation { position: relative; }
.inline-operation > summary { color: var(--green); font-size: 10px; font-weight: 900; cursor: pointer; list-style: none; }
.inline-operation > summary::-webkit-details-marker { display: none; }
.inline-operation[open] > summary { color: var(--ink); }
.inline-operation form { position: absolute; z-index: 20; right: 0; top: calc(100% + 8px); width: 250px; display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: 0 14px 34px rgba(24, 27, 29, .14); }
.inline-operation select { width: 100%; min-height: 36px; border: 1px solid var(--line); border-radius: 4px; padding: 0 9px; background: #fff; }
@media (max-width: 900px) { .brand-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dashboard-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .filter-primary, .more-filters > div { align-items: stretch; flex-direction: column; } .filter-primary > input:first-child { min-width: 0; width: 100%; } .filter-shell input, .filter-shell select, .filter-shell .button { width: 100%; } .filter-pills span { width: 100%; justify-content: center; } .brand-card-grid { grid-template-columns: 1fr; } }

/* v2.1: unified page rhythm and form controls */
:root {
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --content-max: 1420px;
}

.main-content { padding-top: 32px; }
.main-content > *:not(.message-stack):not(.drawer-backdrop):not(.drawer) { width: min(100%, var(--content-max)); margin-left: auto; margin-right: auto; }
.demo-readonly-banner { margin-bottom: 16px; padding: 10px 14px; border: 1px solid rgba(181,137,38,.28); border-radius: var(--radius-sm); background: #fff8e7; color: #765b1c; font-size: 11px; font-weight: 800; }
.page-header { align-items: flex-start; margin-bottom: 22px; }
.page-header > div:first-child { max-width: 780px; }
.page-header h1 { margin: 7px 0 6px; font-size: clamp(30px, 2.8vw, 40px); line-height: 1.15; }
.page-header p { max-width: 760px; }
.page-header .button, .header-actions { flex: 0 0 auto; }
.panel, .filter-shell, .source-card, .team-card, .brand-content-card { border-radius: var(--radius-lg); box-shadow: 0 8px 24px rgba(22,48,38,.045); }
.panel-heading { min-height: 70px; padding: 15px 20px; }
.panel-heading > span { color: var(--muted); font-size: 10px; }
.button { min-height: 40px; border-radius: var(--radius-sm); }
.button.primary { box-shadow: 0 8px 20px rgba(11,75,56,.16); }
.button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid rgba(195,155,74,.38); outline-offset: 2px; }

.form-panel { width: min(100%, 1120px) !important; max-width: none; padding: 26px; }
.form-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-fields > .field-group { min-width: 0; margin: 0; align-content: start; }
.field-type-textarea, .field-type-clearablefileinput, .field-type-checkbox, .field-type-checkboxselectmultiple, .field-type-radioselect, .field-type-choices, .field-notes, .field-working_text, .field-reference_notes, .field-goal, .field-core_point, .field-issues, .field-situation, .field-source_notes { grid-column: 1 / -1; }
.field-group { min-width: 0; }
.field-group > label:not(.toggle-field), .field-group legend { display: block; margin: 0 0 7px; padding: 0; color: var(--ink); font-size: 12px; font-weight: 800; }
.field-group input:not([type="checkbox"]):not([type="radio"]), .field-group select, .field-group textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid rgba(11,75,56,.18); border-radius: var(--radius-sm); background: #fff; color: var(--ink); outline: none; }
.field-group textarea { min-height: 108px; line-height: 1.75; }
.field-group input[type="file"] { padding: 9px; background: rgba(255,255,255,.7); }
.field-group input::placeholder, .field-group textarea::placeholder { color: #98a19d; }
.help-text { margin-top: 6px; color: var(--muted); line-height: 1.55; }
.field-error { margin-top: 6px; padding: 7px 9px; border-radius: 7px; background: var(--danger-soft); line-height: 1.5; }
.form-errors { grid-column: 1 / -1; margin: 18px 0 0; }
.form-footer-actions { margin: 24px -26px -26px; padding: 18px 26px; border-top: 1px solid var(--line); background: rgba(255,255,255,.42); }

.toggle-field { position: relative; min-height: 72px; display: flex; align-items: center; gap: 13px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; cursor: pointer; }
.toggle-field:hover { border-color: rgba(11,75,56,.34); background: rgba(223,236,228,.25); }
.toggle-field > input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-control { position: relative; width: 42px; height: 24px; flex: 0 0 42px; border-radius: 999px; background: #d7ddda; transition: background .16s ease; }
.toggle-control::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.15); transition: transform .16s ease; }
.toggle-field > input:checked + .toggle-control { background: var(--green); }
.toggle-field > input:checked + .toggle-control::after { transform: translateX(18px); }
.toggle-field > input:focus-visible + .toggle-control { outline: 3px solid rgba(195,155,74,.38); outline-offset: 2px; }
.toggle-copy { min-width: 0; display: grid; gap: 4px; }
.toggle-copy strong { color: var(--green-deep); font-size: 12px; }
.toggle-copy small { color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.5; }
.priority-toggle { border-color: rgba(195,155,74,.32); background: linear-gradient(135deg,#fffdf8,#f7f0df); }

.field-type-choices { min-width: 0; margin: 0; padding: 0; border: 0; }
.field-type-choices ul,
.field-type-choices > div { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; margin: 0; padding: 0; list-style: none; }
.field-type-choices li,
.field-type-choices > div > div { min-width: 0; }
.field-type-choices li label,
.field-type-choices > div > div > label { min-height: 44px; display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--ink); cursor: pointer; font-size: 11px; font-weight: 700; }
.field-type-choices input { width: 17px !important; height: 17px; min-height: 17px !important; flex: 0 0 17px; padding: 0 !important; border: 0; accent-color: var(--green); }
.field-type-choices li:has(input:checked) label,
.field-type-choices > div > div:has(input:checked) > label { border-color: rgba(11,75,56,.42); background: var(--green-soft); color: var(--green-deep); }

.section-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.section-heading > span { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--green-soft); color: var(--green); font: 700 10px Georgia,serif; }
.section-heading h2 { margin: 0 0 4px; color: var(--green-deep); font-size: 17px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.section-heading.compact { margin-bottom: 20px; }
.source-entry-panel { overflow: visible; }
.source-entry-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(280px,.7fr); gap: 0; margin: -26px -26px 0; }
.source-entry-main, .source-entry-aside { padding: 26px; }
.source-entry-main { border-right: 1px solid var(--line); }
.source-entry-main textarea { min-height: 520px; font-size: 14px; line-height: 1.9; }
.source-entry-aside { background: rgba(243,238,224,.34); border-radius: 0 var(--radius-lg) 0 0; }
.source-entry-aside .field-group { margin-bottom: 18px; }
.form-note-card { padding: 14px; border-left: 3px solid var(--gold); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: #f5eedc; }
.form-note-card strong { color: var(--green-deep); font-size: 11px; }
.form-note-card p { margin: 6px 0 0; color: #655d49; font-size: 10px; line-height: 1.65; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.batch-import-panel .field-raw_text textarea { min-height: 360px; }
.asset-form-panel { padding: 0; }
.asset-form-panel .form-footer-actions { margin: 0; }
.form-section { padding: 24px 26px; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { border-bottom: 0; }
.form-section-tinted { background: rgba(243,238,224,.32); }
.section-fields { display: grid; gap: 18px 20px; }
.section-fields.two-columns { grid-template-columns: repeat(2,minmax(0,1fr)); }
.section-fields.three-columns { grid-template-columns: repeat(3,minmax(0,1fr)); }
.section-fields .wide-field { grid-column: span 2; }
.slot-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.slot-form-card { display: grid; gap: 15px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; }
.slot-form-card > strong { padding-bottom: 11px; border-bottom: 1px solid var(--line); color: var(--green-deep); font-size: 13px; }
.generic-form-section { border-bottom: 0; }
.brand-form-panel { padding: 0; }
.brand-form-panel .form-footer-actions { margin: 0; }
.brand-basics { grid-template-columns: minmax(0,1.5fr) repeat(3,minmax(150px,.65fr)); }
.brand-planning { grid-template-columns: repeat(2,minmax(0,1fr)); }
.brand-planning .field-reference_notes { grid-column: 1 / -1; }
.brand-planning textarea { min-height: 126px; }
.brand-working-field textarea { min-height: 440px; font-size: 13px; line-height: 1.85; }

.filter-shell { padding: 13px 14px; background: rgba(251,250,246,.88); }
.filter-primary { align-items: stretch; }
.filter-shell input, .filter-shell select { min-height: 40px; border-radius: var(--radius-sm); }
.filter-primary > .filter-pills { align-self: center; }
.filter-pills span { min-height: 40px; border-radius: var(--radius-sm); }
.filter-reset { min-height: 40px; display: inline-flex; align-items: center; padding: 0 7px; }
.more-filters { margin-top: 12px; }
.more-filters summary { width: max-content; list-style: none; }
.more-filters summary::-webkit-details-marker { display: none; }
.more-filters summary::after { content: "＋"; margin-left: 5px; }
.more-filters[open] summary::after { content: "－"; }
.filter-count { padding-top: 9px; border-top: 1px solid rgba(11,75,56,.07); }

.source-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.source-card { min-height: 270px; padding: 20px; }
.source-card > p { margin: 18px 0; line-height: 1.9; }
.source-meta { flex-wrap: wrap; }
.card-actions { min-height: 47px; align-items: flex-end; }
.source-state-tabs { margin-bottom: 14px; }
.source-bulk-form { display: block; margin-bottom: 16px; }
.source-bulk-toolbar { min-height: 64px; display: flex; align-items: center; gap: 10px; padding: 11px 14px; }
.source-bulk-toolbar select { min-width: 170px; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--ink); }
.source-bulk-toolbar select[hidden] { display: none; }
.bulk-selection { min-width: 150px; display: grid; gap: 3px; margin-right: auto; }
.bulk-selection strong { color: var(--green-deep); font-size: 12px; }
.bulk-selection span { color: var(--muted); font-size: 10px; }
.source-table-wrap { margin-top: 0; }
.source-table { min-width: 1080px; table-layout: fixed; }
.source-table th:nth-child(1) { width: 48px; }
.source-table th:nth-child(2) { width: 112px; }
.source-table th:nth-child(3) { width: auto; }
.source-table th:nth-child(4) { width: 105px; }
.source-table th:nth-child(5) { width: 125px; }
.source-table th:nth-child(6) { width: 140px; }
.source-table th:nth-child(7) { width: 240px; }
.source-select-column { text-align: center !important; }
.source-select-column input { width: 17px; height: 17px; accent-color: var(--green); cursor: pointer; }
.source-status-stack { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 5px; }
.source-copy-cell { padding-block: 12px !important; }
.source-copy-preview { display: -webkit-box; overflow: hidden; color: var(--ink); font-size: 12px; line-height: 1.75; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.source-copy-preview:hover { color: var(--green); }
.source-row-hot td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.source-row-trashed { opacity: .64; background: rgba(127,57,57,.035); }
.table-muted { color: var(--muted); }
.source-table .row-actions form { margin: 0; }
.source-table .row-actions button { padding-inline: 6px; }
.brand-card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.brand-content-card { min-height: 290px; padding: 21px; border-radius: var(--radius-lg); }
.brand-content-card h2 { margin: 18px 0 9px; }
.brand-copy { max-height: 86px; overflow: hidden; font-size: 12px; }
.brand-content-header { padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(135deg,rgba(255,255,255,.72),rgba(243,238,224,.72)); }
.brand-card-top time { color: var(--muted); font-size: 9px; }
.brand-content-card footer { margin-top: 15px; }
.side-card.brand-guidance { padding: 20px; }
.side-card.brand-guidance h2 { margin: 8px 0; color: var(--green-deep); font-size: 17px; }
.side-card.brand-guidance p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.75; }

.dashboard-grid { grid-template-columns: minmax(0,1.55fr) minmax(280px,.7fr); align-items: stretch; }
.dashboard-grid .wide-panel { grid-column: 1 / -1; grid-row: auto; }
.chart-panel { min-height: 220px; }
.bar-list { padding: 0 20px 20px; }
.asset-pending-panel { min-height: 220px; }
.workspace-grid { gap: 16px; }

.team-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.team-card { min-height: 132px; display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 17px; }
.team-card-main { width: 100%; flex: 1; }
.team-card-main > div { min-width: 0; }
.team-actions { min-height: 29px; align-items: flex-end; }
.team-card .user-avatar { flex: 0 0 34px; }
.team-card-main .status-chip { margin-left: auto; }
.team-actions a, .team-actions button { min-height: 28px; display: inline-flex; align-items: center; }
.danger-panel { overflow: hidden; }

.data-table-wrap { overflow-x: auto; }
.data-table { min-width: 820px; }
.data-table th { padding-block: 12px; background: rgba(223,236,228,.23); color: #59655f; }
.data-table td { padding-block: 15px; vertical-align: middle; line-height: 1.55; }
.data-table tbody tr:hover { background: rgba(223,236,228,.18); }
.row-actions { min-width: max-content; flex-wrap: wrap; }
.inline-operation form { border-radius: var(--radius-md); }
.drawer { width: min(620px,94vw); }
.drawer-body { display: grid; gap: 14px; }
.drawer-module { margin: 0; }
.drawer-module dl > div { grid-template-columns: 104px minmax(0,1fr); }
.slot-card { padding: 14px; background: #fbfaf6; }
.choice-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.choice-row label { min-height: 38px; display: flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.choice-row input { accent-color: var(--green); }
.inline-create form input, .inline-create form select { min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.metric-inline { min-width: 210px; border-radius: var(--radius-md); }
.detail-grid { gap: 16px; }
.detail-aside { gap: 16px; }

@media (min-width: 1600px) {
  .brand-card-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .source-entry-grid { grid-template-columns: 1fr; }
  .source-entry-main { border-right: 0; border-bottom: 1px solid var(--line); }
  .source-entry-aside { border-radius: 0; }
  .source-entry-main textarea { min-height: 400px; }
  .brand-basics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .brand-topic-field { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .main-content { padding: 22px 14px 44px; }
  .page-header { gap: 14px; }
  .page-header h1 { font-size: 30px; }
  .page-header > .button { width: 100%; }
  .header-actions { width: 100%; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .form-panel { padding: 18px; }
  .form-fields { grid-template-columns: 1fr; gap: 16px; }
  .brand-basics, .brand-planning { grid-template-columns: 1fr; }
  .brand-planning .field-reference_notes, .brand-topic-field { grid-column: auto; }
  .brand-working-field textarea { min-height: 340px; }
  .form-fields > .field-group, .field-type-textarea, .field-type-checkbox, .field-type-choices { grid-column: 1; }
  .field-type-choices ul,
  .field-type-choices > div { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .form-footer-actions { margin: 22px -18px -18px; padding: 15px 18px; }
  .form-footer-actions .button { flex: 1; }
  .source-entry-grid { margin: -18px -18px 0; }
  .source-entry-main, .source-entry-aside { padding: 18px; }
  .source-entry-main textarea { min-height: 360px; }
  .source-grid, .brand-card-grid, .team-grid, .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid .wide-panel { grid-column: auto; }
  .filter-primary, .more-filters > div { align-items: stretch; flex-direction: column; }
  .filter-primary > input:first-child { min-width: 0; width: 100%; }
  .filter-shell input, .filter-shell select, .filter-shell .button, .filter-primary > .filter-pills { width: 100%; }
  .filter-pills { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-pills span { width: 100%; justify-content: center; }
  .filter-reset { justify-content: center; }
  .page-tabs { width: 100%; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .page-tabs a { text-align: center; }
  .source-state-tabs { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .source-bulk-toolbar { align-items: stretch; flex-direction: column; }
  .bulk-selection { width: 100%; margin: 0; }
  .source-bulk-toolbar select, .source-bulk-toolbar .button { width: 100%; }
  .data-table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--paper); box-shadow: none; }
  .data-table { min-width: 760px; display: table; }
  .data-table thead { display: table-header-group; }
  .data-table tbody { display: table-row-group; }
  .data-table tr { display: table-row; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .data-table th, .data-table td { display: table-cell; width: auto; padding: 12px 13px; border-bottom: 1px solid var(--line); font-size: 10px; }
  .data-table td:last-child { padding-top: 12px; }
  .drawer { width: 100vw; }
  .sticky-actions { position: static; width: 100%; }
  .asset-form-panel { padding: 0; }
  .asset-form-panel .form-footer-actions { margin: 0; }
  .form-section { padding: 20px 18px; }
  .section-fields.two-columns, .section-fields.three-columns, .slot-form-grid { grid-template-columns: 1fr; }
  .section-fields .wide-field { grid-column: auto; }
}

@media (max-width: 430px) {
  .metric-grid { grid-template-columns: 1fr; }
  .header-actions { grid-template-columns: 1fr; }
  .field-type-choices ul, .field-type-choices > div, .filter-pills { grid-template-columns: 1fr; }
  .toggle-field { align-items: flex-start; }
  .source-entry-main textarea { min-height: 310px; }
}

/* Permission, copy-type and approval surfaces */
.category-chip { display: inline-flex; align-items: center; min-height: 26px; padding: 5px 9px; border: 1px solid rgba(11,75,56,.13); border-radius: 999px; background: var(--green-soft); color: var(--green-deep); font-size: 10px; font-weight: 800; white-space: nowrap; }
.source-table.is-editable th:nth-child(1) { width: 48px; }
.source-table.is-editable th:nth-child(2) { width: 105px; }
.source-table.is-editable th:nth-child(3) { width: 95px; }
.source-table.is-editable th:nth-child(4) { width: auto; }
.source-table.is-editable th:nth-child(5) { width: 100px; }
.source-table.is-editable th:nth-child(6) { width: 116px; }
.source-table.is-editable th:nth-child(7) { width: 134px; }
.source-table.is-editable th:nth-child(8) { width: 220px; }
.source-table.is-readonly th:nth-child(1) { width: 105px; }
.source-table.is-readonly th:nth-child(2) { width: 95px; }
.source-table.is-readonly th:nth-child(3) { width: auto; }
.source-table.is-readonly th:nth-child(4) { width: 105px; }
.source-table.is-readonly th:nth-child(5) { width: 122px; }
.source-table.is-readonly th:nth-child(6) { width: 138px; }
.source-table.is-readonly th:nth-child(7) { width: 82px; }
.field-category { min-width: 0; }
.field-category select { width: 100%; }
.header-count-badge { min-width: 92px; min-height: 46px; display: inline-grid; place-items: center; padding: 9px 15px; border: 1px solid rgba(177,126,34,.2); border-radius: var(--radius-sm); background: #fff5df; color: #7d5a17; font-size: 12px; font-weight: 900; white-space: nowrap; }
.approval-table { min-width: 900px; table-layout: fixed; }
.approval-table th:nth-child(1) { width: 120px; }
.approval-table th:nth-child(2) { width: auto; }
.approval-table th:nth-child(3) { width: 100px; }
.approval-table th:nth-child(4) { width: 145px; }
.approval-table th:nth-child(5) { width: 100px; }
.approval-table th:nth-child(6) { width: 80px; }
.approval-detail-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(300px,.72fr); gap: 18px; align-items: start; }
.approval-summary-card, .approval-action-card { padding: 24px; }
.approval-action-card { position: sticky; top: 22px; }
.approval-action-card h2 { margin: 7px 0 8px; color: var(--green-deep); font-family: "Noto Serif SC", "Songti SC", STSong, serif; font-size: 24px; }
.approval-action-card > p { margin: 0 0 18px; color: var(--muted); font-size: 11px; line-height: 1.75; }
.approval-action-card .field-type-choices ul,
.approval-action-card .field-type-choices > div { grid-template-columns: repeat(2,minmax(0,1fr)); }
.change-detail-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 0; }
.change-detail-list > div { min-width: 0; min-height: 68px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(251,250,246,.72); }
.change-detail-list dt { color: var(--muted); font-size: 9px; font-weight: 800; }
.change-detail-list dd { margin: 7px 0 0; overflow-wrap: anywhere; color: var(--ink); font-size: 11px; font-weight: 700; line-height: 1.55; }
.review-result { margin-top: 16px; padding: 14px; border-left: 3px solid var(--green); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--green-soft); }
.review-result strong { color: var(--green-deep); font-size: 11px; }
.review-result p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.approval-note-section { border-top: 1px solid var(--line); background: rgba(255,249,232,.42); }
.team-form-panel .field-type-choices { grid-column: 1 / -1; }
.team-form-panel .field-type-choices ul,
.team-form-panel .field-type-choices > div { grid-template-columns: repeat(5,minmax(0,1fr)); }
.team-form-panel .form-note-card { margin-top: 4px; }
.team-card-main > div small + small { margin-top: 3px; color: #728078; }
.category-table { min-width: 680px; }
.category-table th:first-child { width: 90px; }
.category-table th:nth-child(3), .category-table th:nth-child(4) { width: 130px; }
.category-table th:last-child { width: 80px; }
.compact-form-panel { max-width: 760px !important; }

@media (max-width: 980px) {
  .approval-detail-grid { grid-template-columns: 1fr; }
  .approval-action-card { position: static; }
  .team-form-panel .field-type-choices ul,
  .team-form-panel .field-type-choices > div { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 640px) {
  .change-detail-list { grid-template-columns: 1fr; }
  .approval-summary-card, .approval-action-card { padding: 18px; }
  .team-form-panel .field-type-choices ul,
  .team-form-panel .field-type-choices > div { grid-template-columns: 1fr; }
  .header-count-badge { width: 100%; }
}
