:root {
  --ink: #14241e;
  --muted: #64736d;
  --line: #dbe4df;
  --paper: #ffffff;
  --canvas: #f2f6f3;
  --forest: #153f32;
  --green: #238564;
  --lime: #a8d44a;
  --gold: #d9a22e;
  --blue: #2781b9;
  --orange: #df7541;
  --cyan: #2d9b9a;
  --slate: #697a8b;
  --shadow: 0 16px 42px rgba(24, 57, 44, 0.08);
  font-family: "Yu Gothic UI", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, select, input { font: inherit; }
button, select { color: inherit; }

.topbar {
  min-height: 76px;
  padding: 14px clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  background: var(--forest);
  border-bottom: 3px solid var(--lime);
}

.brand-logo {
  display: block;
  width: clamp(110px, 24vw, 144px);
  height: auto;
  padding: 3px 5px;
  border-radius: 8px;
  background: var(--paper);
}
.demo-badge { padding: 8px 12px; border: 1px solid #4d6e61; border-radius: 999px; color: #dce9e4; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; }
.demo-badge span { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(168, 212, 74, 0.12); }

.dashboard { width: min(1500px, 100%); margin: 0 auto; padding: 34px clamp(18px, 3.4vw, 54px) 52px; }
.dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 7px; color: var(--green); font-size: 0.72rem; font-weight: 900; letter-spacing: 0.16em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(1.75rem, 3.2vw, 2.8rem); line-height: 1.15; letter-spacing: -0.04em; }
h2 { margin-bottom: 0; font-size: 1.17rem; letter-spacing: -0.02em; }
.heading-copy { margin-bottom: 0; color: var(--muted); font-size: 0.95rem; }
.dashboard-controls { display: flex; align-items: end; gap: 14px; }
.dashboard-controls label > span, .time-control > span { display: block; margin: 0 0 6px; color: var(--muted); font-size: 0.74rem; font-weight: 800; }
select { min-width: 180px; height: 44px; padding: 0 38px 0 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-weight: 700; }
.time-control > div { display: flex; align-items: center; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); overflow: hidden; }
.play-button { height: 100%; padding: 0 12px; border: 0; border-right: 1px solid var(--line); background: #f9fbfa; cursor: pointer; font-size: 0.82rem; font-weight: 800; }
.play-button:hover { background: #edf5f0; }
.play-button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid rgba(35, 133, 100, 0.28); outline-offset: 2px; }
.play-icon { margin-right: 4px; color: var(--green); }
#current-time { min-width: 74px; padding: 0 12px; font-variant-numeric: tabular-nums; font-weight: 900; }
.ai-open-button { height: 44px; padding: 0 13px; display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 10px; color: white; background: linear-gradient(135deg, var(--forest), #207b5d); box-shadow: 0 8px 20px rgba(21, 63, 50, .18); cursor: pointer; font-size: .8rem; font-weight: 900; white-space: nowrap; }
.ai-open-button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.ai-open-button:focus-visible { outline: 3px solid rgba(35, 133, 100, .28); outline-offset: 2px; }
.ai-open-icon { display: block; flex: none; border-radius: 5px; }
.ai-brand-logo { display: block; flex: none; border-radius: 7px; }
.ai-open-button small { padding: 2px 5px; border-radius: 5px; color: #244535; background: var(--lime); font-size: .52rem; letter-spacing: .06em; }

.view-tabs { display: inline-flex; gap: 4px; margin-bottom: 18px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #e7eee9; }
.view-tab { min-width: 128px; min-height: 40px; padding: 8px 16px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: .86rem; font-weight: 900; }
.view-tab.active { color: white; background: var(--forest); box-shadow: 0 5px 14px rgba(21, 63, 50, .16); }
.view-tab:focus-visible { outline: 3px solid rgba(35, 133, 100, .28); outline-offset: 2px; }
.premium-tab span { color: var(--gold); font-size: .68rem; }
.premium-tab.active span { color: #e8c76f; }
.view-panel[hidden] { display: none; }

.status-banner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; min-height: 66px; margin-bottom: 18px; padding: 13px 18px; border: 1px solid #cee5d9; border-radius: 14px; background: #eaf7f0; }
.status-banner.warning { border-color: #ecd9a8; background: #fff8e4; }
.status-banner.danger { border-color: #efc2b5; background: #fff0ec; }
.status-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(35,133,100,.12); }
.warning .status-dot { background: var(--gold); box-shadow: 0 0 0 5px rgba(217,162,46,.13); }
.danger .status-dot { background: #c44b32; box-shadow: 0 0 0 5px rgba(196,75,50,.12); }
.status-banner strong { font-size: 0.92rem; }
.status-banner p { margin: 2px 0 0; color: var(--muted); font-size: 0.82rem; }
.updated-at { color: var(--muted); font-size: 0.76rem; font-variant-numeric: tabular-nums; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.metric-card, .panel { border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); }
.metric-card { position: relative; min-height: 142px; padding: 17px; border-radius: 14px; overflow: hidden; }
.metric-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent); }
.metric-heading { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 0.78rem; font-weight: 800; }
.metric-icon { min-width: 31px; height: 27px; padding: 0 7px; display: grid; place-items: center; border-radius: 8px; color: var(--accent); background: color-mix(in srgb, var(--accent) 11%, white); font-size: 0.67rem; }
.metric-card p { display: flex; align-items: baseline; gap: 5px; margin: 19px 0 4px; }
.metric-card p strong { font-size: clamp(1.65rem, 2.3vw, 2.25rem); line-height: 1; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.metric-card p span { color: var(--muted); font-size: 0.72rem; font-weight: 800; }
.metric-card small { color: var(--muted); font-size: 0.7rem; }
.accent-green { --accent: var(--green); } .accent-gold { --accent: var(--gold); } .accent-blue { --accent: var(--blue); }
.accent-orange { --accent: var(--orange); } .accent-cyan { --accent: var(--cyan); } .accent-slate { --accent: var(--slate); }

.content-grid { display: grid; grid-template-columns: 1.55fr .85fr; gap: 12px; }
.panel { border-radius: 16px; padding: 20px; }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 17px; }
.chart-legend { display: flex; gap: 13px; color: var(--muted); font-size: 0.72rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 9px; height: 9px; border-radius: 50%; }
.legend-temperature { background: var(--orange); } .legend-humidity { background: var(--cyan); }
.legend-feed { background: var(--gold); } .legend-water { background: var(--blue); } .legend-co2 { background: var(--slate); }
.chart { min-height: 238px; }
.chart svg { display: block; width: 100%; height: 238px; overflow: visible; }
.chart-grid { stroke: #e9efeb; stroke-width: 1; }
.chart-label { fill: #78867f; font-size: 11px; }
.chart-line { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { opacity: .08; }
.chart-marker { stroke: white; stroke-width: 2; }

.wind-content { display: grid; grid-template-columns: minmax(130px, .8fr) 1fr; align-items: center; gap: 14px; min-height: 238px; }
.compass { position: relative; width: 142px; height: 142px; margin: auto; border: 1px solid var(--line); border-radius: 50%; background: radial-gradient(circle, #fff 0 46%, #eef4f0 47% 48%, #fff 49%); }
.compass::before, .compass::after { content: ""; position: absolute; background: var(--line); }
.compass::before { width: 1px; height: 100%; left: 50%; } .compass::after { width: 100%; height: 1px; top: 50%; }
.compass > span { position: absolute; z-index: 2; color: var(--muted); background: white; font-size: .66rem; font-weight: 900; }
.north { top: 5px; left: 50%; transform: translateX(-50%); } .south { bottom: 5px; left: 50%; transform: translateX(-50%); }
.east { right: 7px; top: 50%; transform: translateY(-50%); } .west { left: 7px; top: 50%; transform: translateY(-50%); }
.wind-arrow { position: absolute; z-index: 3; inset: 25px; display: grid; place-items: center; color: var(--green); font-size: 3.7rem; line-height: 1; transform-origin: center; transition: transform .35s ease; filter: drop-shadow(0 4px 5px rgba(35,133,100,.2)); }
.wind-data { margin: 0; }
.wind-data div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.wind-data div:last-child { border-bottom: 0; }
.wind-data dt { margin-bottom: 4px; color: var(--muted); font-size: .72rem; font-weight: 800; }
.wind-data dd { margin: 0; font-size: .86rem; font-weight: 800; }
.wind-data dd strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; }

.alert-count { padding: 5px 9px; border-radius: 999px; color: #80621e; background: #fff1c9; font-size: .72rem; font-weight: 900; }
.alert-list { min-height: 238px; margin: 0; padding: 0; list-style: none; }
.alert-list li { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.alert-list li:last-child { border-bottom: 0; }
.alert-list .alert-symbol { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: #9b6a0e; background: #fff2ce; font-weight: 900; }
.alert-list .normal-symbol { color: var(--green); background: #e5f5ed; }
.alert-list strong { display: block; margin-bottom: 3px; font-size: .82rem; }
.alert-list p { margin: 0; color: var(--muted); font-size: .74rem; line-height: 1.5; }

.timeline-panel { margin-top: 12px; padding: 20px 24px 16px; }
.timeline-heading { display: flex; justify-content: space-between; align-items: end; gap: 18px; }
.timeline-heading > p { margin: 0; color: var(--muted); font-size: .76rem; }
#time-slider { width: 100%; margin: 22px 0 7px; accent-color: var(--green); cursor: pointer; }
.time-ticks { display: flex; justify-content: space-between; color: var(--muted); font-size: .68rem; font-variant-numeric: tabular-nums; }
.demo-notice { margin: 18px 0 0; color: var(--muted); text-align: center; font-size: .72rem; }

.summary-toolbar { display: grid; grid-template-columns: auto auto 1fr; align-items: end; gap: 22px; margin-bottom: 12px; }
.period-presets { display: flex; gap: 5px; }
.period-button, .apply-button { min-height: 40px; padding: 8px 15px; border: 1px solid var(--line); border-radius: 9px; background: #f7faf8; cursor: pointer; font-size: .82rem; font-weight: 900; }
.period-button.active { border-color: var(--green); color: white; background: var(--green); }
.apply-button { border-color: var(--forest); color: white; background: var(--forest); }
.period-button:hover, .apply-button:hover { filter: brightness(.96); }
.period-button:focus-visible, .apply-button:focus-visible, .custom-period input:focus-visible, .table-scroll:focus-visible { outline: 3px solid rgba(35, 133, 100, .28); outline-offset: 2px; }
.custom-period { display: flex; justify-content: flex-end; align-items: end; gap: 8px; }
.custom-period label span { display: block; margin-bottom: 5px; color: var(--muted); font-size: .72rem; font-weight: 800; }
.custom-period input { min-height: 40px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; font-size: .82rem; }
.custom-period input[aria-invalid="true"] { border-color: #c44b32; }
.date-separator { padding-bottom: 10px; color: var(--muted); }
.period-error { grid-column: 1 / -1; margin: -6px 0 0; padding: 9px 11px; border-radius: 8px; color: #8f2f21; background: #fff0ec; font-size: .78rem; font-weight: 800; }

.summary-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.summary-metric { min-height: 116px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); }
.summary-metric > span { color: var(--muted); font-size: .74rem; font-weight: 800; }
.summary-metric p { margin: 15px 0 5px; color: var(--ink); font-size: .72rem; font-weight: 800; }
.summary-metric p strong { margin-right: 3px; font-size: clamp(1.45rem, 2vw, 1.95rem); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.summary-metric small { color: var(--muted); font-size: .68rem; }
.summary-chart-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }
.summary-chart-grid .chart-legend { flex-wrap: wrap; justify-content: flex-end; }
.daily-table-panel { padding-bottom: 12px; }
.row-count { padding: 5px 9px; border-radius: 999px; color: var(--green); background: #e5f5ed; font-size: .72rem; font-weight: 900; }
.table-scroll { max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; min-width: 1010px; border-collapse: separate; border-spacing: 0; font-size: .76rem; font-variant-numeric: tabular-nums; }
th, td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 2; color: var(--muted); background: #f2f6f3; font-size: .68rem; letter-spacing: .02em; }
th:first-child, td:first-child { position: sticky; left: 0; z-index: 1; text-align: left; background: white; box-shadow: 1px 0 0 var(--line); }
th:first-child { z-index: 3; background: #f2f6f3; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f7faf8; }
.condition { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; color: var(--green); background: #e5f5ed; font-weight: 900; }
.condition.warning { color: #8b6415; background: #fff1c9; }
.condition::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.movement-hero { margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: white; background: linear-gradient(120deg, #12392d, #1e6d53); border-color: #1e6d53; overflow: hidden; }
.movement-title-row { display: flex; align-items: center; gap: 10px; }
.movement-hero .eyebrow { color: #b8ddce; }
.movement-hero h2 { margin-bottom: 7px; font-size: 1.45rem; }
.movement-hero p { margin-bottom: 0; color: #d5e6df; font-size: .8rem; }
.premium-badge { margin-bottom: 7px; padding: 4px 8px; border-radius: 999px; color: #38500e; background: var(--lime); font-size: .57rem; font-weight: 1000; letter-spacing: .05em; }
.movement-demo-status { flex: 0 0 auto; padding: 8px 11px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; color: #e3eee9; background: rgba(255,255,255,.08); font-size: .65rem; font-weight: 900; }
.movement-demo-status span { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(168,212,74,.12); }
.movement-notice { margin-bottom: 14px; padding: 12px 15px; border: 1px solid #b8ddca; border-radius: 12px; color: #20543f; background: #e9f7ef; font-size: .76rem; font-weight: 800; }
.movement-section-heading { margin: 21px 0 11px; display: flex; align-items: end; justify-content: space-between; gap: 15px; }
.movement-section-heading small { color: var(--muted); font-size: .66rem; }
.movement-barn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.movement-barn-card { position: relative; min-height: 128px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: var(--shadow); overflow: hidden; }
.movement-barn-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--green); }
.movement-barn-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .75rem; font-weight: 900; }
.movement-barn-card header span { padding: 4px 7px; border-radius: 999px; color: var(--green); background: #e7f4ed; font-size: .57rem; }
.movement-barn-card p { margin: 19px 0 5px; display: flex; align-items: baseline; gap: 5px; }
.movement-barn-card strong { font-size: 2.15rem; line-height: 1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.movement-barn-card p span { color: var(--muted); font-size: .72rem; font-weight: 800; }
.movement-barn-card small { color: var(--muted); font-size: .66rem; }
.movement-action-panel { margin-bottom: 14px; }
.movement-action-panel .panel-heading > p { margin: 0; color: var(--muted); font-size: .7rem; }
.movement-action-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.movement-action { min-height: 112px; padding: 14px; display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; align-items: center; gap: 3px 10px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: #fbfdfc; cursor: pointer; text-align: left; }
.movement-action > span { grid-row: 1 / 3; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--movement-color); background: color-mix(in srgb, var(--movement-color) 12%, white); font-size: 1.2rem; font-weight: 1000; }
.movement-action strong { align-self: end; font-size: .86rem; }
.movement-action small { align-self: start; color: var(--muted); font-size: .61rem; line-height: 1.45; }
.movement-action:hover { border-color: var(--movement-color); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(24,57,44,.08); }
.movement-action:focus-visible { outline: 3px solid color-mix(in srgb, var(--movement-color) 28%, transparent); outline-offset: 2px; }
.movement-action.inbound { --movement-color: var(--green); }
.movement-action.transfer { --movement-color: var(--blue); }
.movement-action.death { --movement-color: var(--slate); }
.movement-action.shipment { --movement-color: var(--orange); }
.movement-history { padding-bottom: 12px; }
.movement-table { min-width: 850px; }
.movement-type { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 999px; color: var(--movement-color); background: color-mix(in srgb, var(--movement-color) 11%, white); font-weight: 900; }
.movement-type::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.movement-type.inbound { --movement-color: var(--green); }
.movement-type.transfer { --movement-color: var(--blue); }
.movement-type.death { --movement-color: var(--slate); }
.movement-type.shipment { --movement-color: var(--orange); }
.movement-registered { color: var(--green); font-weight: 900; }

body.movement-modal-open { overflow: hidden; }
.movement-backdrop[hidden], .movement-modal[hidden] { display: none; }
.movement-backdrop { position: fixed; z-index: 100; inset: 0; opacity: 0; background: rgba(10,28,22,.5); backdrop-filter: blur(2px); transition: opacity .22s ease; }
.movement-backdrop.open { opacity: 1; }
.movement-modal { position: fixed; z-index: 110; top: 50%; left: 50%; width: min(520px, calc(100% - 28px)); max-height: min(88dvh, 780px); display: grid; grid-template-rows: auto minmax(0, 1fr); border-radius: 18px; background: #f5f8f6; box-shadow: 0 26px 80px rgba(8,28,20,.3); opacity: 0; transform: translate(-50%, -47%) scale(.98); transition: opacity .22s ease, transform .22s ease; overflow: hidden; }
.movement-modal.open { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.movement-modal-header { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: white; background: var(--forest); border-bottom: 3px solid var(--lime); }
.movement-modal-header p { margin: 0 0 2px; color: #bcd1c9; font-size: .6rem; font-weight: 900; letter-spacing: .12em; }
.movement-modal-header h2 { font-size: 1.08rem; }
.movement-modal-header button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 10px; color: white; background: rgba(255,255,255,.08); cursor: pointer; font-size: 1.4rem; }
.movement-form { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.movement-form [hidden] { display: none; }
.movement-form-body { padding: 17px 18px; display: grid; gap: 12px; overflow-y: auto; }
.movement-form-note { padding: 10px 11px; display: flex; gap: 9px; border: 1px solid #d6e4dd; border-radius: 10px; background: #edf5f1; }
.movement-form-note span { flex: 0 0 auto; width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--green); font-size: .62rem; font-weight: 900; }
.movement-form-note p { margin: 0; color: #52675e; font-size: .65rem; line-height: 1.55; }
.movement-form label > span:first-child { display: block; margin-bottom: 5px; color: #50635b; font-size: .7rem; font-weight: 900; }
.movement-form label small { color: #8c9993; font-weight: 700; }
.movement-form input, .movement-form select, .movement-form textarea { width: 100%; min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; font-size: .78rem; }
.movement-form input, .movement-form select { height: 42px; }
.movement-form textarea { resize: vertical; }
.movement-form input:focus-visible, .movement-form select:focus-visible, .movement-form textarea:focus-visible { outline: 3px solid rgba(35,133,100,.22); outline-offset: 2px; }
.movement-number-input { position: relative; display: block; }
.movement-number-input input { padding-right: 42px; font-size: 1rem; font-weight: 900; }
.movement-number-input b { position: absolute; right: 13px; top: 50%; color: var(--muted); font-size: .72rem; transform: translateY(-50%); }
.movement-preview { padding: 13px; border: 1px solid #c9e0d5; border-radius: 11px; background: #eef8f3; }
.movement-preview > strong { display: block; margin-bottom: 9px; color: var(--green); font-size: .69rem; }
.movement-preview-row { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 9px; padding: 5px 0; font-size: .72rem; }
.movement-preview-row span { color: var(--muted); }
.movement-preview-row b { font-variant-numeric: tabular-nums; }
.movement-preview-arrow { color: var(--green) !important; font-weight: 1000; }
.movement-form-error { margin: 0; padding: 9px 11px; border-radius: 8px; color: #8f2f21; background: #fff0ec; font-size: .7rem; font-weight: 800; }
.movement-form-footer { padding: 13px 18px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); background: white; }
.movement-form-footer button { min-height: 41px; padding: 8px 15px; border-radius: 9px; cursor: pointer; font-size: .74rem; font-weight: 900; }
.movement-cancel-button { border: 1px solid var(--line); color: var(--muted); background: white; }
.movement-submit-button { border: 0; color: white; background: var(--forest); }
.movement-submit-button:hover { background: #1c5b47; }

body.ai-panel-open, body:has(dialog.ai-panel[open]) { overflow: hidden; }
.ai-panel[hidden], .ai-backdrop[hidden], dialog.ai-panel:not([open]) { display: none; }
.ai-backdrop { position: fixed; z-index: 80; inset: 0; opacity: 0; background: rgba(10, 28, 22, .44); backdrop-filter: blur(2px); transition: opacity .24s ease; }
.ai-backdrop.open { opacity: 1; }
.ai-panel { --ai-panel-offset: translateX(102%); position: fixed; z-index: 90; inset: 0 0 0 auto; width: min(470px, 100%); height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; color: var(--ink); background: #f4f8f5; box-shadow: -20px 0 60px rgba(10, 31, 23, .24); transform: var(--ai-panel-offset); transition: transform .28s ease; }
.ai-panel.open, dialog.ai-panel[open] { transform: none; }
dialog.ai-panel::backdrop { background: rgba(10, 28, 22, .44); backdrop-filter: blur(2px); }
@starting-style {
  dialog.ai-panel[open] { transform: var(--ai-panel-offset); }
}
.ai-panel-header { min-height: 78px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: white; background: linear-gradient(135deg, #102f26, #1d674f); border-bottom: 3px solid var(--lime); }
.ai-panel-brand { display: flex; align-items: center; gap: 11px; }
.ai-panel-brand h2 { font-size: 1.15rem; }
.ai-close-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 10px; color: white; background: rgba(255,255,255,.08); cursor: pointer; font-size: 1.5rem; line-height: 1; }
.ai-close-button:hover { background: rgba(255,255,255,.15); }
.ai-close-button:focus-visible { outline: 3px solid rgba(216, 242, 139, .45); outline-offset: 2px; }
.ai-panel-scroll { min-height: 0; padding: 18px; overflow-y: auto; }
.ai-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .68rem; font-weight: 900; }
.ai-demo-label { padding: 4px 7px; border-radius: 999px; color: #426053; background: #e2ece7; font-size: .58rem; letter-spacing: .06em; }
.ai-context-chips { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 7px; }
.ai-context-chips span { padding: 7px 10px; border: 1px solid #cfe0d8; border-radius: 999px; color: #275442; background: white; font-size: .7rem; font-weight: 900; }
.ai-welcome { margin: 16px 0; padding: 14px; display: flex; gap: 11px; border: 1px solid #cfe4d9; border-radius: 14px; background: linear-gradient(135deg, #eaf7f0, #f7fbf8); }
.ai-welcome-icon { flex: 0 0 auto; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: white; background: var(--green); }
.ai-welcome h3 { margin: 1px 0 5px; font-size: .86rem; }
.ai-welcome p { margin: 0; color: var(--muted); font-size: .71rem; line-height: 1.65; }
.ai-quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ai-action-button { min-height: 42px; padding: 9px 11px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 10px; color: #435a51; background: white; cursor: pointer; font-size: .72rem; font-weight: 900; text-align: left; }
.ai-action-button span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; color: var(--green); background: #e8f5ee; font-size: .72rem; }
.ai-action-button:hover { border-color: #a9cbbc; background: #fbfdfc; }
.ai-action-button.active { border-color: var(--green); color: var(--forest); background: #eef8f3; box-shadow: inset 0 0 0 1px var(--green); }
.ai-action-button:focus-visible { outline: 3px solid rgba(35, 133, 100, .24); outline-offset: 2px; }
.ai-response { margin-top: 14px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: 0 12px 32px rgba(24, 57, 44, .07); }
.ai-answer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-answer-tag { display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-size: .62rem; font-weight: 1000; letter-spacing: .08em; }
.ai-answer-tag::before { content: "✦"; }
.ai-confidence { padding: 4px 7px; border-radius: 999px; color: #53665e; background: #edf2ef; font-size: .58rem; font-weight: 900; }
.ai-response h3 { margin: 13px 0 7px; font-size: 1rem; line-height: 1.45; }
.ai-response > p { margin-bottom: 0; color: var(--muted); font-size: .74rem; line-height: 1.75; }
.ai-evidence-grid { margin: 14px 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.ai-evidence { padding: 10px; border-radius: 10px; background: #f3f7f4; }
.ai-evidence span { display: block; color: var(--muted); font-size: .59rem; font-weight: 800; }
.ai-evidence strong { display: block; margin-top: 4px; font-size: .9rem; font-variant-numeric: tabular-nums; }
.ai-insight { margin-top: 12px; padding: 12px; border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0; background: #fff8e8; }
.ai-insight strong { display: block; margin-bottom: 4px; color: #755b1d; font-size: .68rem; }
.ai-insight p { margin: 0; color: #6e654e; font-size: .7rem; line-height: 1.65; }
.ai-check-list { margin: 13px 0 0; padding: 0; display: grid; gap: 7px; list-style: none; }
.ai-check-list li { position: relative; padding-left: 22px; color: #42544c; font-size: .71rem; line-height: 1.55; }
.ai-check-list li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--green); font-size: .56rem; font-weight: 1000; }
.ai-source { margin-top: 14px !important; padding-top: 11px; border-top: 1px solid var(--line); font-size: .61rem !important; }
.ai-question-form { padding: 14px 18px 16px; border-top: 1px solid var(--line); background: white; box-shadow: 0 -8px 24px rgba(24, 57, 44, .05); }
.ai-question-form label { display: block; margin-bottom: 7px; color: var(--muted); font-size: .67rem; font-weight: 900; }
.ai-question-form > div { display: flex; gap: 7px; }
.ai-question-form input { min-width: 0; flex: 1; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8faf9; font-size: .75rem; }
.ai-question-form button { padding: 0 15px; border: 0; border-radius: 10px; color: white; background: var(--forest); cursor: pointer; font-size: .72rem; font-weight: 900; }
.ai-question-form button:hover { background: #1d5c48; }
.ai-question-form input:focus-visible, .ai-question-form button:focus-visible { outline: 3px solid rgba(35, 133, 100, .24); outline-offset: 2px; }
.ai-question-form > p { margin: 8px 0 0; color: #85918c; font-size: .57rem; line-height: 1.5; }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-metric-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-toolbar { grid-template-columns: auto 1fr; }
  .custom-period { grid-column: 1 / -1; justify-content: flex-start; }
  .movement-action-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .topbar { min-height: 66px; padding: 11px 18px; }
  .demo-badge { padding: 7px 9px; font-size: .65rem; }
  .dashboard { padding-top: 24px; }
  .dashboard-heading { align-items: stretch; flex-direction: column; }
  .dashboard-controls { align-items: stretch; }
  .dashboard-controls label { flex: 1; }
  select { width: 100%; min-width: 0; }
  .ai-open-button { align-self: end; }
  .status-banner { grid-template-columns: auto 1fr; }
  .updated-at { grid-column: 2; }
  .content-grid { grid-template-columns: 1fr; }
  .timeline-heading { align-items: start; flex-direction: column; }
  .summary-chart-grid { grid-template-columns: 1fr; }
  .movement-barn-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-card { min-height: 130px; padding: 14px; }
  .metric-card p { margin-top: 15px; }
  .metric-card p strong { font-size: 1.7rem; }
  .dashboard-controls { flex-direction: column; }
  .ai-open-button { width: 100%; justify-content: center; }
  .time-control > div { width: 100%; }
  #current-time { flex: 1; text-align: center; }
  .panel { padding: 17px; }
  .panel-heading { flex-direction: column; }
  .wind-content { grid-template-columns: 1fr 1fr; }
  .view-tabs { display: flex; width: 100%; }
  .view-tab { flex: 1; min-width: 0; }
  .summary-toolbar { grid-template-columns: 1fr; align-items: stretch; }
  .custom-period { grid-column: auto; display: grid; grid-template-columns: 1fr auto 1fr; }
  .custom-period label { min-width: 0; }
  .custom-period input { width: 100%; min-width: 0; }
  .custom-period .apply-button { grid-column: 1 / -1; }
  .summary-metric-grid { grid-template-columns: repeat(2, 1fr); }
  .movement-hero { align-items: start; flex-direction: column; }
  .movement-action-grid { grid-template-columns: 1fr 1fr; }
  .movement-action { min-height: 96px; padding: 11px; }
  .movement-modal { top: auto; bottom: 0; left: 0; width: 100%; max-height: 92dvh; border-radius: 20px 20px 0 0; transform: translateY(102%); }
  .movement-modal.open { transform: translateY(0); }
  .movement-modal-header { border-radius: 20px 20px 0 0; }
  .ai-panel { --ai-panel-offset: translateY(102%); inset: auto 0 0; width: 100%; height: min(88dvh, 760px); border-radius: 20px 20px 0 0; }
  .ai-panel-header { min-height: 68px; border-radius: 20px 20px 0 0; }
  .ai-panel-scroll { padding: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wind-arrow { transition: none; }
  .ai-backdrop, .ai-panel { transition: none; }
  .movement-backdrop, .movement-modal { transition: none; }
}
