:root {
  --bg: #f3f6f5;
  --card: #ffffff;
  --text: #17231f;
  --muted: #66736e;
  --line: #dbe4e0;
  --accent: #0d7667;
  --accent-dark: #075a4f;
  --accent-soft: #e6f3f0;
  --danger: #b23b42;
  --danger-soft: #fbe7e8;
  --warning-soft: #fff1cf;
  --shadow: 0 10px 28px rgba(30, 54, 47, .06);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 90% 0, rgba(13,118,103,.08), transparent 28rem),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  line-height: 1.55;
}

.site-header {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 30px;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}
.brand { color: var(--text); font-weight: 800; letter-spacing: -.01em; }
.brand small { color: var(--accent); font-size: 11px; margin-left: 4px; }
nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
nav a { color: #35534b; font-weight: 650; }
.nav-toggle { display: none; padding: 7px 12px; font-size: 21px; line-height: 1; }
.user-chip { padding: 4px 10px; border-radius: 999px; background: #edf2f0; color: #43534e; font-size: 13px; }

main { max-width: 1280px; margin: 30px auto; padding: 0 20px 48px; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
h1, h2, h3 { line-height: 1.2; }
h1 { margin: .05em 0 .2em; letter-spacing: -.025em; }
h2 { margin: 0 0 12px; font-size: 21px; }
h3 { margin: 0 0 10px; font-size: 17px; }
p { margin: .45em 0 1em; }
.eyebrow { margin: 0 0 5px; color: var(--accent); font-size: 11px; font-weight: 850; letter-spacing: .14em; }
.muted, .hint, .field-help { color: var(--muted); }
.field-help { margin-top: 7px; font-size: 13px; }

.topbar, .section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.topbar { margin-bottom: 20px; }
.topbar > div > p:not(.eyebrow) { color: var(--muted); margin: .3em 0 0; }
.section-heading { align-items: center; margin-bottom: 14px; }
.section-heading p { margin: 4px 0 0; }
.meta-row { display: flex; align-items: center; gap: 9px 14px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }

.card {
  margin-bottom: 20px;
  padding: 23px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.card.compact { padding: 17px 20px; }
.narrow { max-width: 860px; }
.grid2 { display: grid; grid-template-columns: minmax(0,1.18fr) minmax(0,1fr); gap: 20px; }
.review-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; }
.formal-review { border-top: 4px solid #375f8b; }
.discussion { border-top: 4px solid var(--accent); }

.stats { display: grid; grid-template-columns: repeat(5,1fr); gap: 12px; margin-bottom: 20px; }
.stats div {
  padding: 14px 16px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 4px 16px rgba(30,54,47,.035);
}
.stats strong { display: block; margin-top: 3px; color: var(--text); font-size: 27px; }

label { display: block; margin: 13px 0 7px; font-weight: 700; }
fieldset { margin: 18px 0; padding: 16px; border: 1px solid var(--line); border-radius: 11px; }
legend { padding: 0 7px; font-weight: 800; }
input, select, textarea {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  color: var(--text);
  background: #fff;
  border: 1px solid #cbd7d2;
  border-radius: 9px;
  font: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(13,118,103,.12);
  border-color: var(--accent);
}
textarea { line-height: 1.65; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: auto; margin: 0; }
.inline-form { display: flex; align-items: center; gap: 10px; min-width: 340px; }
.inline-form select { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.filter-form { margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.filter-grid { display: grid; grid-template-columns: minmax(240px,2fr) repeat(2,minmax(150px,1fr)); gap: 12px; }
.filter-grid-five { grid-template-columns: minmax(220px,1.6fr) repeat(4,minmax(135px,1fr)); }
.audit-filter-grid { grid-template-columns: minmax(220px,1.5fr) repeat(5,minmax(125px,1fr)); }
.filter-grid label { margin-top: 0; }

button, .button {
  display: inline-block;
  padding: 10px 16px;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 9px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
button:hover, .button:hover { color: #fff; background: var(--accent-dark); }
.secondary { color: #245c53; background: var(--accent-soft); }
.secondary:hover { color: #17463f; background: #d5ebe6; }
.danger { background: var(--danger); }
.danger:hover { background: #8f2930; }
.small { padding: 7px 10px; font-size: 13px; }
.full { width: 100%; margin-top: 10px; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.actions form { display: inline-block; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: #5b6964; font-size: 13px; }
.item-link { font-weight: 750; }
.empty { padding: 34px; text-align: center; color: var(--muted); }

.badge, .source-tag, .review-provider {
  display: inline-block;
  padding: 4px 9px;
  background: #e8eeeb;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}
.badge.submitted { background: #fff1c9; }
.badge.approved { color: #176647; background: #ddf3e8; }
.badge.changes_requested { color: #8a2e35; background: #f8dddd; }
.badge.published { color: #315c95; background: #dfe9f8; }
.source-tag { margin-left: 6px; color: #285e55; background: var(--accent-soft); }
.review-provider { color: #355d84; background: #e8f0fa; }

.score { color: var(--accent); font-size: 52px; font-weight: 850; line-height: 1; }
.score small { margin-left: 3px; color: var(--muted); font-size: 15px; }
.issue, .comment, .version, .rule, .decision { padding: 13px 0; border-top: 1px solid var(--line); }
.issue.success strong { color: #25714f; }
.issue.warning strong { color: #a05c14; }
.issue.info strong { color: #365d83; }
.issue p, .comment p, .version p, .decision p { margin-bottom: 0; }
.comment > div, .decision > div { display: flex; justify-content: space-between; gap: 14px; }
.comment span, .version > span, .decision span, .rule small, .event span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.decision.changes { border-left: 3px solid var(--danger); padding-left: 12px; }
.decision.approve { border-left: 3px solid var(--accent); padding-left: 12px; }
.subsection { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }

pre {
  overflow-x: auto;
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f7f9f8;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-family: inherit;
  line-height: 1.62;
}
.copy-preview { min-height: 310px; }
details > summary { color: var(--accent); font-weight: 700; cursor: pointer; }
.suggestion, .history-summary { margin-top: 18px; }
.mini-row { display: grid; grid-template-columns: 44px 72px 100px 1fr; gap: 7px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.unchecked {
  padding: 26px;
  background: #f5f8f7;
  border: 1px dashed #afc0b9;
  border-radius: 12px;
  text-align: center;
}
.unchecked strong { font-size: 20px; }
.unchecked p { margin-bottom: 0; color: var(--muted); }
.notice { padding: 13px 14px; background: #edf2f0; border-radius: 9px; }
.notice.success { color: #176647; background: #ddf3e8; }
.notice.warning { color: #795912; background: #fff1ce; }

.timeline { padding-left: 7px; }
.event { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding-bottom: 18px; }
.event::before { content: ""; position: absolute; left: 7px; top: 12px; bottom: -1px; width: 2px; background: var(--line); }
.event:last-child::before { display: none; }
.event .dot { width: 16px; height: 16px; margin-top: 3px; z-index: 1; border: 4px solid var(--accent-soft); border-radius: 50%; background: var(--accent); }
.event-changes_requested .dot { border-color: var(--danger-soft); background: var(--danger); }
.event p { margin: 3px 0 0; }
.file { display: inline-block; margin: 4px; padding: 8px 12px; background: var(--accent-soft); border-radius: 8px; }
.csv-fields { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 16px; }
.csv-fields code { padding: 5px 8px; background: #eef2f0; border-radius: 6px; }
.external-link { white-space: nowrap; }
.publication-card { border-top: 4px solid #416fa5; }
.source-info { border-left: 4px solid #987637; }
.platform-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 20px; }
.platform-stats div { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; background: var(--card); border: 1px solid var(--line); border-radius: 11px; }
.platform-stats span { color: var(--muted); }
.platform-stats strong { font-size: 22px; }
.detail-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin: 0; }
.detail-list div { min-width: 0; }
.detail-list dt { color: var(--muted); font-size: 12px; font-weight: 750; }
.detail-list dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.audit-log-table { margin-top: 16px; }

.drop-zone {
  position: relative;
  padding: 22px;
  color: #356158;
  background: #f4faf8;
  border: 2px dashed #9bbdb4;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
}
.drop-zone:hover { border-color: var(--accent); background: var(--accent-soft); }
.drop-zone.dragging { border-color: var(--accent); background: #dff3ee; box-shadow: 0 0 0 4px rgba(13,118,103,.12); }
.drop-zone input { margin: 12px auto 0; max-width: 520px; }
.drop-status { display: block; margin-top: 7px; color: var(--accent); }
.upload-progress { display: none; margin-top: 14px; }
.upload-progress.active { display: block; }
.upload-progress-track { height: 12px; overflow: hidden; background: #dfe6e3; border-radius: 999px; }
.upload-progress-bar { width: 0; height: 100%; background: var(--accent); border-radius: inherit; transition: width .12s linear; }
.upload-progress-text { display: block; margin-top: 6px; color: var(--accent); font-size: 13px; }
.upload-progress.failed .upload-progress-bar { background: #a83a42; }
.upload-progress.failed .upload-progress-text { color: #8a2e35; }
button:disabled, input[type="submit"]:disabled { cursor: wait; opacity: .65; }
.small-zone { padding: 12px; font-size: 13px; }
.media-gallery { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.media-gallery figure { margin: 0; overflow: hidden; background: #f3f6f5; border: 1px solid var(--line); border-radius: 11px; }
.media-gallery img, .media-gallery video { display: block; width: 100%; height: 180px; object-fit: cover; background: #16201d; }
.media-gallery figcaption { padding: 8px 10px; overflow-wrap: anywhere; font-size: 12px; }
.compact-gallery { grid-template-columns: repeat(2,minmax(100px,1fr)); }
.compact-gallery img, .compact-gallery video { height: 110px; }
.reference-item { padding: 11px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.reference-item:first-child { border-top: 0; }
.reference-item > span { display: block; color: var(--muted); font-size: 12px; }
.reference-item p { margin-bottom: 0; }
.history-add-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.workflow-card { overflow-x: auto; }
.workflow { display: flex; align-items: center; min-width: 820px; padding: 12px 0 6px; }
.workflow > i { flex: 1; min-width: 22px; height: 3px; background: #dbe4e0; }
.flow-node { min-width: 112px; padding: 13px 10px; text-align: center; background: #f4f7f6; border: 2px solid var(--line); border-radius: 13px; }
.flow-node span { display: grid; place-items: center; width: 27px; height: 27px; margin: 0 auto 7px; color: #fff; background: #8b9893; border-radius: 50%; font-size: 12px; font-weight: 800; }
.flow-node strong, .flow-node small { display: block; }
.flow-node small { margin-top: 3px; color: var(--muted); }
.flow-node.done, .flow-node.approved { border-color: #80b9a2; background: #edf8f3; }
.flow-node.done span, .flow-node.approved span { background: var(--accent); }
.flow-node.current, .flow-node.pending { border-color: #d3a44e; background: #fff8e6; box-shadow: 0 0 0 4px rgba(211,164,78,.12); }
.flow-node.current span, .flow-node.pending span { background: #a86c12; }
.flow-node.changes_requested { border-color: #d98f94; background: var(--danger-soft); }
.flow-node.changes_requested span { background: var(--danger); }
.mini-row.wide { grid-template-columns: 70px minmax(180px,1fr) 150px 2fr; }
.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(100px,1fr)); gap: 11px; }
.ad-card { border-top: 4px solid #9c6b2e; }
.ad-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; padding: 13px 0; border-top: 1px solid var(--line); }
.ad-item p, .ad-item small { grid-column: 1 / -1; margin: 0; color: var(--muted); }
.month-jump { display: flex; gap: 8px; align-items: center; }
.month-jump input { width: auto; margin: 0; }
.calendar-summary { display: grid; gap: 12px; margin-bottom: 12px; }
.calendar-summary-main { grid-template-columns: repeat(3,1fr); }
.calendar-summary-platforms { grid-template-columns: repeat(4,1fr); margin-bottom: 20px; }
.calendar-summary div { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; background: var(--card); border: 1px solid var(--line); border-radius: 11px; }
.calendar-summary span { color: var(--muted); }
.calendar-summary strong { font-size: 22px; }
.calendar-entry-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.calendar-entry-forms details { align-self: start; }
.calendar-legend { display: flex; gap: 8px; flex-wrap: wrap; margin: -7px 0 14px; }
.legend-chip, .platform-label { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border: 1px solid transparent; border-radius: 999px; font-size: 12px; font-weight: 750; }
.legend-chip i { width: 10px; height: 10px; border-radius: 3px; background: currentColor; }
.legend-chip.platform-facebook, .platform-label.platform-facebook { color: #1559ae; background: #e1efff; border-color: #a9cffd; }
.legend-chip.platform-instagram, .platform-label.platform-instagram { color: #a42a70; background: #fbe6f2; border-color: #efb6d5; }
.legend-chip.platform-youtube, .platform-label.platform-youtube { color: #bd1711; background: #fee7e5; border-color: #f6b9b4; }
.legend-chip.platform-linkedin, .platform-label.platform-linkedin { color: #075b94; background: #e1f2ff; border-color: #acd7f3; }
.legend-chip.planned { color: #616a66; background: #ecefee; border-color: #cbd2cf; }
.legend-chip.activity { color: #8a5b11; background: #fff0ca; border-color: #e9c774; }
.calendar-card { padding: 0; overflow: hidden; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(145px,1fr)); min-width: 1015px; }
.calendar-head div { padding: 10px; color: var(--muted); background: #edf2f0; text-align: center; font-weight: 750; }
.calendar-head .weekend { color: #905234; background: #f8f1eb; }
.calendar-day { min-height: 145px; padding: 9px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.outside { color: #9ba5a1; background: #f7f8f8; }
.calendar-day time { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 750; }
.calendar-item { position: relative; margin-bottom: 6px; padding: 7px 22px 7px 8px; border-left: 4px solid; border-radius: 6px; font-size: 12px; }
.calendar-item span, .calendar-item a { display: block; }
.calendar-item span { color: var(--muted); font-size: 10px; }
.calendar-item a { color: var(--text); font-weight: 700; }
.calendar-item.platform-facebook { background: #e1efff; border-color: #1877f2; }
.calendar-item.platform-instagram { background: #fbe6f2; border-color: #c13584; }
.calendar-item.platform-youtube { background: #fee7e5; border-color: #e62117; }
.calendar-item.platform-linkedin { background: #e1f2ff; border-color: #0a66c2; }
.calendar-item.planned { color: #4f5955; background: #ecefee; border-color: #8d9793; }
.calendar-item.planned a { color: #424a47; }
.calendar-platform-dot { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; vertical-align: 1px; }
.calendar-platform-dot.platform-facebook { background: #1877f2; }
.calendar-platform-dot.platform-instagram { background: #c13584; }
.calendar-platform-dot.platform-youtube { background: #e62117; }
.calendar-platform-dot.platform-linkedin { background: #0a66c2; }
.calendar-item .calendar-external { position: absolute; top: 6px; right: 7px; color: var(--accent); }
.unit-pill { display: inline-flex !important; align-items: center; width: fit-content; margin: 5px 0; padding: 2px 9px; color: #85560d !important; background: #ffedbd; border: 1px solid #e8c368; border-radius: 999px; font-size: 10px !important; font-weight: 800; line-height: 1.45; white-space: nowrap; }
.calendar-activity { display: block; margin-bottom: 6px; padding: 6px 7px; color: #6c4b13; background: #fff4d9; border: 1px solid #e9cd87; border-radius: 7px; font-size: 11px; }
.calendar-activity strong { display: block; color: #5e4318; }
.mobile-calendar { display: none; }
.mini-calendar { padding: 0; overflow: hidden; }
.mini-calendar-head, .mini-calendar-body { display: grid; grid-template-columns: repeat(7,1fr); }
.mini-calendar-head span { padding: 8px 0; color: var(--muted); background: #edf2f0; text-align: center; font-weight: 750; }
.mini-day { position: relative; min-height: 58px; padding: 6px 3px; color: var(--text); border-top: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; }
.mini-day:nth-child(7n) { border-right: 0; }
.mini-day.outside { color: #a2aaa7; background: #f7f8f8; }
.mini-day.selected { background: #e1f4ef; box-shadow: inset 0 0 0 2px #70b7a8; }
.mini-day strong { display: block; }
.mini-day small { position: absolute; top: 3px; right: 4px; min-width: 17px; padding: 1px 4px; background: #e0e5e3; border-radius: 999px; font-size: 9px; }
.mini-dots { display: flex; justify-content: center; gap: 2px; min-height: 10px; margin-top: 5px; }
.mini-dots .calendar-platform-dot { width: 6px; height: 6px; margin: 0; }
.activity-dot { width: 7px; height: 7px; background: #e3a51b; border-radius: 50%; }
.selected-day-heading { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 10px; }
.selected-day-heading h2 { margin: 0; }
.selected-day-heading strong { color: var(--accent); }
.agenda-activity { display: flex; align-items: center; gap: 11px; padding: 13px; color: #5e4318; background: #fff4d9; border-color: #e9cd87; }
.agenda-activity small, .agenda-activity strong { display: block; }
.agenda-activity .unit-pill { margin: 0; }
.agenda-item { margin-bottom: 10px; padding: 14px 15px; background: var(--card); border: 1px solid var(--line); border-left: 5px solid #8d9793; border-radius: 12px; }
.agenda-item.platform-facebook { background: #e1efff; border-left-color: #1877f2; }
.agenda-item.platform-instagram { background: #fbe6f2; border-left-color: #c13584; }
.agenda-item.platform-youtube { background: #fee7e5; border-left-color: #e62117; }
.agenda-item.platform-linkedin { background: #e1f2ff; border-left-color: #0a66c2; }
.agenda-item.planned { background: #ecefee; }
.agenda-item > a { display: block; color: var(--text); font-weight: 800; }
.agenda-item > small { display: block; color: var(--muted); font-size: 12px; }
.agenda-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.agenda-meta .unit-pill { flex: 0 0 auto; margin: 0; }
.api-status-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.api-platform { min-width: 0; padding: 12px; color: #725516; background: #fff8e6; border: 1px solid #efd59a; border-radius: 10px; }
.api-platform.ready { color: #176647; background: #edf8f3; border-color: #afd7c5; }
.api-platform strong, .api-platform span, .api-platform small { display: block; overflow-wrap: anywhere; }
.api-platform span { margin-top: 3px; font-size: 13px; font-weight: 700; }
.api-platform small { margin-top: 8px; color: var(--muted); }
.api-sync-form { max-width: 480px; margin-top: 14px; }
.knowledge-copy { border-top: 4px solid var(--accent); }
.chart-card canvas { display: block; width: 100%; max-width: 100%; }
.chart-empty { padding: 70px 0; color: var(--muted); text-align: center; }
.settings-list { display: grid; grid-template-columns: 120px 1fr; gap: 7px 12px; padding: 14px 0; }
.settings-list dt { color: var(--muted); font-weight: 700; }
.settings-list dd { margin: 0; overflow-wrap: anywhere; }
.badge.sent { color: #176647; background: #ddf3e8; }
.badge.failed { color: #8a2e35; background: #f8dddd; }
.badge.skipped { color: #795912; background: #fff1ce; }

.flash { margin-bottom: 14px; padding: 12px 14px; background: #e5f3eb; border-radius: 9px; }
.flash.danger { color: #752f2f; background: #f8dddd; }
.flash.warning { color: #795912; background: #fff1ce; }
.login-card {
  max-width: 430px;
  margin: 75px auto;
  padding: 32px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .grid2, .review-layout, .stats, .filter-grid, .filter-grid-five, .detail-list, .history-add-forms { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2,1fr); }
  .site-header, .topbar, .section-heading { align-items: flex-start; flex-direction: column; }
  nav { gap: 10px 14px; }
  .inline-form { min-width: 0; width: 100%; }
  .platform-stats { grid-template-columns: repeat(2,1fr); }
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .media-gallery { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .api-status-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .calendar-entry-forms { grid-template-columns: 1fr; }
  .calendar-grid { grid-template-columns: repeat(7,minmax(100px,1fr)); min-width: 700px; }
  .calendar-day { min-height: 125px; padding: 6px; }
  .calendar-item { padding-right: 8px; }
  .calendar-item .calendar-external { position: static; }
}

@media (max-width: 720px) {
  .site-header { min-height: 58px; align-items: center; flex-direction: row; flex-wrap: wrap; }
  .brand { max-width: calc(100% - 58px); }
  .nav-toggle { display: inline-block; margin-left: auto; }
  .site-header nav { display: none; flex: 0 0 100%; align-items: stretch; padding: 8px 0 4px; border-top: 1px solid var(--line); }
  .site-header nav.open { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .site-header nav a, .site-header nav .user-chip { padding: 7px 9px; }
  .calendar-topbar { gap: 8px; }
  .calendar-nav { width: 100%; display: grid; grid-template-columns: auto 1fr auto; flex-wrap: nowrap; }
  .calendar-nav .button { padding: 10px 12px; }
  .calendar-nav .button span { display: none; }
  .calendar-nav .month-jump { min-width: 0; }
  .calendar-nav .month-jump input { min-width: 0; width: 100%; }
  .calendar-nav .month-jump button { padding: 10px 12px; }
  .calendar-summary-main { grid-template-columns: repeat(3,1fr); }
  .calendar-summary-platforms { grid-template-columns: repeat(2,1fr); }
  .calendar-summary div { display: block; padding: 10px; }
  .calendar-summary span { display: block; font-size: 11px; }
  .calendar-summary strong { display: block; margin-top: 2px; font-size: 20px; }
  .calendar-legend { flex-wrap: nowrap; margin-right: -12px; padding-right: 12px; overflow-x: auto; scrollbar-width: none; }
  .calendar-legend::-webkit-scrollbar { display: none; }
  .legend-chip { flex: 0 0 auto; }
  .calendar-desktop { display: none; }
  .mobile-calendar { display: block; }
}

@media (max-width: 560px) {
  main { padding: 0 12px 36px; }
  .site-header { padding: 12px 16px; }
  .card { padding: 17px; border-radius: 13px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .mini-row { grid-template-columns: 42px 65px 1fr; }
  .mini-row span:last-child { grid-column: 1 / -1; }
  .mini-row.wide { grid-template-columns: 1fr; }
  .media-gallery { grid-template-columns: 1fr; }
  .api-status-grid { grid-template-columns: 1fr; }
}
