:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #13243d;
  background: #f4f7fb;
  --navy: #07376c;
  --ink: #13243d;
  --muted: #56677d;
  --line: #dbe4ef;
  --blue: #175fb1;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 290px; }
button, input { color: inherit; font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
h1, h2, p { margin: 0; }
svg { width: 1.2rem; height: 1.2rem; flex: none; }
.shell { width: min(1536px, calc(100% - 56px)); margin-inline: auto; }
.app-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-content { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 17px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 45px; height: 45px; flex: none; border-radius: 13px; color: var(--navy); background: #e8f1fc; }
.brand-mark svg { width: 25px; height: 25px; }
.brand h1 { font-size: clamp(1.12rem, 2.35vw, 1.38rem); font-weight: 800; line-height: 1.18; letter-spacing: -.025em; }
.brand p { margin-top: 4px; color: var(--muted); font-size: .875rem; }
.header-actions { display: flex; gap: 8px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 41px; padding: 7px 13px; border: 1px solid transparent; border-radius: 10px; font-size: .91rem; font-weight: 700; white-space: nowrap; transition: background-color .16s, border-color .16s; }
.primary { background: var(--navy); color: #fff; }
.primary:hover { background: #134b83; }
.primary:disabled { opacity: .65; }
.secondary { background: #fff; border-color: var(--line); color: #1b385a; }
.secondary:hover { background: #f2f7fe; border-color: #b8cde7; }
.section-nav { display: flex; flex-wrap: wrap; gap: 5px; width: fit-content; margin-top: 15px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.section-nav button { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 7px 12px; border: 0; border-radius: 9px; background: transparent; color: #52657c; font-size: .91rem; font-weight: 700; }
.section-nav button:hover { background: #f1f6fd; color: var(--navy); }
.section-nav button[aria-pressed="true"] { background: #e6effc; color: var(--navy); }
.section-nav svg { width: 17px; height: 17px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; padding-block: 15px; }
.month-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.month-label { margin-right: 3px; font-size: .94rem; font-weight: 750; }
.month-picker { display: flex; align-items: center; gap: 3px; padding: 3px; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.icon-button { display: grid; place-items: center; flex: none; width: 33px; height: 33px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--navy); }
.icon-button:hover { background: #edf4fc; }
.icon-button:disabled { color: #aab8c8; background: transparent; }
.icon-button svg { width: 17px; height: 17px; }
#report-month { width: 146px; min-height: 33px; padding: 3px 5px; border: 0; border-radius: 7px; background: #fff; font-size: .9rem; font-weight: 700; }
.latest { min-height: 39px; background: #e7eef8; color: #174980; }
.latest:hover { background: #dceafa; }
.latest[aria-current="date"] { color: #174980; background: #e7eef8; }
.edit-hint { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .88rem; }
.edit-hint svg { width: 16px; height: 16px; }
.ad-tools, .slide-controls { display: flex; align-items: center; gap: 8px; }
.slide-controls { padding: 2px; border: 1px solid var(--line); border-radius: 9px; background: #fff; white-space: nowrap; }
.slide-controls .icon-button { font-size: 1.35rem; line-height: 1; }
#slide-number { padding-inline: 4px; font-size: .86rem; font-weight: 700; }
.report-scroll { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 28px #1939600a; }
.report-sheet { position: relative; width: 100%; min-width: 820px; aspect-ratio: 16/9; }
#report { display: block; width: 100%; height: 100%; }
.edit-layer { position: absolute; inset: 0; pointer-events: none; }
.edit-region { position: absolute; display: block; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; pointer-events: auto; }
.edit-region:hover, .edit-region:focus-visible, .edit-region[aria-expanded="true"] { border-color: #448be5; background: #4b9efa16; }
.edit-region:focus-visible { outline-offset: 1px; }
.sheet-footer { display: flex; justify-content: space-between; gap: 10px; margin-block: 11px 24px; color: var(--muted); font-size: .82rem; }
.footer-dot { padding-inline: 2px; }
.value-editor { position: fixed; z-index: 5; width: min(282px, calc(100% - 16px)); padding: 10px 12px 12px; border: 1px solid #ccdbea; border-radius: 14px; background: #fff; box-shadow: 0 12px 34px #0b326127; }
.editor-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.editor-top label { color: #24405e; font-size: .88rem; font-weight: 750; }
.editor-top .icon-button { width: 29px; height: 29px; }
.editor-fields { display: flex; gap: 6px; margin-top: 3px; }
.editor-fields input, #share-url { min-width: 0; width: 100%; padding: 8px 9px; border: 1px solid #b9cbe0; border-radius: 8px; background: #f9fbfe; }
.editor-fields input { font-variant-numeric: tabular-nums; }
.editor-fields input[aria-invalid="true"] { border-color: #b94356; }
#editor-error { color: #a2243d; font-size: .83rem; }
#editor-error:not(:empty) { margin-top: 6px; }
dialog { width: min(410px, calc(100% - 32px)); padding: 20px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); box-shadow: 0 12px 40px #0b326125; }
dialog::backdrop { background: #112a4b59; }
dialog label { display: block; margin: 7px 0; color: var(--muted); }
dialog form { margin-top: 12px; text-align: right; }
.ad-dialog { width: min(920px, calc(100% - 26px)); padding: 0; max-height: calc(100dvh - 30px); }
.ad-dialog form { margin: 0; text-align: left; }
.ad-dialog-head, .ad-dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 13px 20px; background: #f7faff; }
.ad-dialog-head { justify-content: space-between; border-bottom: 1px solid var(--line); }
.ad-dialog-head h2 { font-size: 1.15rem; }
.ad-dialog-content { display: grid; grid-template-columns: minmax(0, 1.13fr) minmax(0, 1fr); gap: 18px; padding: 17px 20px; }
.ad-fields { display: grid; align-content: start; gap: 9px; min-width: 0; }
.ad-fields .ad-field { display: grid; gap: 5px; margin: 0; color: #263f5d; font-size: .875rem; font-weight: 700; }
.ad-field input, .ad-field select { min-width: 0; width: 100%; min-height: 38px; padding: 6px 9px; border: 1px solid #bdcce0; border-radius: 8px; background: #fff; font-size: 1rem; font-weight: 400; }
.ad-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(75px, 1fr)); gap: 7px; min-width: 0; margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 11px; background: #f6f9fd; }
.ad-metrics legend { padding-inline: 5px; color: #263f5d; font-size: .85rem; font-weight: 750; }
.ad-fields .file-label { display: inline-flex; margin: 0; color: var(--navy); cursor: pointer; }
.media-field:has(input:focus-visible) .file-label { outline: 2px solid var(--blue); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#ad-media-status, #ad-error { color: #a2243d; font-size: .85rem; }
#ad-error:not(:empty) { padding: 0 20px 10px; }
.media-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 9px 0 0; list-style: none; }
.media-list:empty { margin: 0; }
.media-list li { position: relative; width: 63px; aspect-ratio: 1; border-radius: 9px; }
.media-list img { display: block; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.media-list button { position: absolute; top: 2px; right: 2px; width: 23px; height: 23px; padding: 0; border: 0; border-radius: 50%; background: #142a49d9; color: #fff; line-height: 1; }
.fb-preview { display: grid; align-content: start; gap: 9px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #f6f9fe; }
.fb-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fb-preview h3 { margin: 0; color: #19385b; font-size: .94rem; }
.fb-preview a { color: #155aa3; font-size: .85rem; font-weight: 700; }
.fb-preview p { color: var(--muted); font-size: .85rem; }
.fb-post-details { min-width: 0; padding: 9px; border-radius: 8px; background: #eaf2fc; overflow-wrap: anywhere; }
.fb-post-details strong { display: block; color: #19385b; font-size: .88rem; }
.fb-post-details p { display: -webkit-box; margin-top: 3px; white-space: pre-line; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
#refresh-facebook { justify-self: start; min-height: 36px; }
.fb-frame { overflow: hidden; min-height: 230px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.fb-frame iframe { display: block; width: 100%; height: 285px; border: 0; }
.ad-dialog-actions { justify-content: flex-end; border-top: 1px solid var(--line); }
.ad-dialog-actions .danger { margin-right: auto; border-color: #f1cdd4; background: #fff; color: #9a2540; }
.ad-dialog-actions .danger:hover { background: #fff1f3; }
#remove-ad-note { color: #93263e; font-size: .85rem; }
.notice { position: fixed; z-index: 6; right: max(15px, 3vw); bottom: 18px; max-width: calc(100% - 30px); border-radius: 10px; color: #fff; background: #13365e; box-shadow: 0 8px 24px #173c6a29; font-size: .92rem; }
.notice:not(:empty) { padding: 9px 13px; }
@media (max-width: 700px) {
  .shell { width: calc(100% - 28px); }
  .header-content { flex-wrap: wrap; gap: 12px; padding-block: 12px; }
  .header-actions { flex-wrap: wrap; }
  .toolbar { padding-block: 12px; }
  .report-scroll { border-radius: 12px; }
  .section-nav { width: 100%; }
  .section-nav button { padding-inline: 7px; font-size: .84rem; }
  .ad-dialog-content { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
