/* Scoped to the read-only history; existing management styles stay intact. */
.ah-page, .ah-detail { color:var(--v2-ink, #1f2b23); font-family:"Segoe UI", "Noto Sans TC", system-ui, sans-serif; box-sizing:border-box; }
.ah-page *, .ah-detail * { box-sizing:border-box; }
/* Keep the page below the existing top bar (30) and primary navigation (70). */
.ah-page { position:fixed; z-index:25; top:calc(var(--v2-topbar-height, 72px) + 16px); left:calc(var(--v2-sidebar-width, 0px) + 16px); right:16px; bottom:16px; overflow-y:auto; overflow-x:hidden; background:#f5f7f4; border:1px solid var(--v2-border, #dfe5df); border-radius:14px; }
body.antler-history-open #info-panel, body.antler-history-open #sensor-dashboard, body.antler-history-open #deer-antler-growth-page, body.antler-history-open #controls-hint, body.antler-history-open #deer-form-zone-preview { visibility:hidden; }
/* Projected 3D labels can keep their desktop coordinates after a narrow resize. */
body.antler-history-open #zone-labels, body.antler-history-open #zone-context-labels, body.antler-history-open #left-sidebar { display:none; }
.ah-page button, .ah-detail button, .ah-page select { font:inherit; color:inherit; border:1px solid #d5dfd1; border-radius:8px; background:#fff; padding:9px 14px; min-height:44px; cursor:pointer; }
.ah-page button:disabled, .ah-detail button:disabled { opacity:.4; cursor:default; }
.ah-page :focus-visible, .ah-detail :focus-visible { outline:3px solid #608e45; outline-offset:3px; }
.ah-workspace-nav { position:sticky; top:0; z-index:3; display:flex; flex-wrap:wrap; gap:8px; padding:10px 24px; border-bottom:1px solid #dfe5df; background:#fff; }
.ah-workspace-nav button { font-size:14px; font-weight:600; padding:8px 16px; }
.ah-workspace-nav button[aria-current="page"] { background:#eef4ea; border-color:#b6c9a9; color:var(--v2-primary-dark, #2f4c25); }
.ah-page-header { padding:18px 24px; display:grid; grid-template-columns:minmax(0, 1fr); gap:24px; align-items:start; background:#fff; border-bottom:1px solid #dfe5df; }
.ah-page-header.ah-has-summary { grid-template-columns:minmax(280px, .9fr) minmax(0, 1.3fr); }
.ah-header-main { min-width:0; }
.ah-header-kicker { display:flex; align-items:center; gap:10px; margin:6px 0 12px; }
.ah-page-header .ah-header-kicker p { margin:0; }
.ah-page-header button { padding-left:0; min-height:32px; border:0; color:var(--v2-primary, #466836); }
.ah-eyebrow { color:var(--v2-primary, #466836); font-size:12px; font-weight:700; letter-spacing:.08em; margin:16px 0 8px; }
.ah-page h2, .ah-detail h2 { margin:0 0 10px; font-size:26px; }
.ah-page h3, .ah-detail h3 { margin:0 0 12px; font-size:17px; }
.ah-page h3 span { font-size:13px; font-weight:500; color:#71806d; margin-left:8px; }
.ah-page p { margin:8px 0; line-height:1.6; }
.ah-page-header p, .ah-help, .ah-unassigned > p { color:#667361; font-size:13px; }
.ah-page-header p span { display:inline-block; }
.ah-readonly { background:#eef4ea; color:#466836; border-radius:20px; padding:6px 12px; font-size:12px; align-self:flex-start; white-space:nowrap; }
.ah-content { padding:24px 30px 36px; min-width:0; }
.ah-selector { display:flex; flex-direction:column; align-items:stretch; gap:6px; font-size:12px; font-weight:600; max-width:360px; margin-top:12px; }
.ah-selector select { max-width:100%; min-width:0; width:100%; font-size:13px; }
.ah-summary, .ah-events, .ah-unassigned { border:1px solid #dfe5df; border-radius:12px; padding:22px; background:#fff; margin-bottom:22px; min-width:0; }
.ah-summary dl { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:20px; margin:18px 0; }
.ah-summary dt, .ah-detail dt { font-size:12px; color:#74806e; margin-bottom:6px; font-weight:400; }
.ah-summary dd, .ah-detail dd { margin:0; font-size:14px; font-weight:600; overflow-wrap:anywhere; }
.ah-page-header > .ah-summary { margin:0; padding:14px 16px; background:#f8faf6; }
.ah-page-header > .ah-summary h3 { font-size:18px; margin:0; }
.ah-page-header > .ah-summary dl { gap:14px 12px; margin:12px 0; }
.ah-page-header > .ah-summary dt { font-size:14px; line-height:1.5; margin-bottom:4px; }
.ah-page-header > .ah-summary dd { font-size:16px; line-height:1.5; }
.ah-timeline-head { display:flex; justify-content:space-between; gap:12px; align-items:center; }
.ah-timeline-head p { color:#667361; font-size:13px; }
.ah-browse { display:flex; gap:8px; }
.ah-track { overflow-x:auto; overflow-y:hidden; overscroll-behavior-x:contain; touch-action:pan-x pan-y; padding:12px 8px 24px; scrollbar-width:auto; min-width:0; max-width:100%; }
.ah-timeline { display:flex; width:max-content; min-width:100%; align-items:stretch; }
.ah-time-group { flex:0 0 224px; width:224px; position:relative; padding:0 14px; }
.ah-node-row { height:76px; position:relative; display:flex; justify-content:center; align-items:center; }
.ah-node-row::before { content:""; height:2px; background:#b6c9a9; position:absolute; left:-14px; right:-14px; top:37px; }
.ah-time-group:first-child .ah-node-row::before { left:50%; }
.ah-time-group:last-child .ah-node-row::before { right:50%; }
.ah-time-group:only-child .ah-node-row::before { display:none; }
.ah-node { width:13px; height:13px; border-radius:50%; background:#8fa280; box-shadow:0 0 0 5px #f1f5ee; z-index:1; }
.ah-node-stage { width:70px; height:70px; display:flex; align-items:center; justify-content:center; background:#466836; color:#fff; font-size:15px; font-weight:700; padding:7px; text-align:center; box-shadow:0 0 0 5px #eef4ea; }
.ah-time-label { text-align:center; height:53px; font-size:12px; color:#667361; padding-top:9px; }
.ah-time-label time, .ah-time-label span { display:block; }
.ah-time-label span { font-size:11px; margin-top:4px; }
.ah-connector { width:1px; height:20px; background:#b6c9a9; margin:0 auto; }
.ah-group-cards { display:flex; flex-direction:column; gap:12px; }
.ah-event-card { display:block; padding:0 !important; width:100%; text-align:left; overflow:hidden; border-radius:10px !important; transition:border-color .15s; }
.ah-event-card:hover { border-color:#66834e; box-shadow:0 4px 12px #2f4c2514; }
.ah-image-frame { position:relative; background:#eff2ec; overflow:hidden; min-height:100px; }
.ah-event-card .ah-image-frame { height:126px; }
.ah-image-frame img { display:block; width:100%; height:100%; object-fit:cover; }
.ah-image-message { display:none; font-size:12px; line-height:1.7; color:#6c775f; padding:14px; }
.ah-image-frame.is-image-loading .ah-image-message, .ah-image-frame.is-image-error .ah-image-message { display:block; }
.ah-image-frame.is-image-loading img, .ah-image-frame.is-image-error img { display:none; }
.ah-image-frame.is-image-error .ah-image-message { color:#a74734; }
.ah-no-photo { height:126px; background:#f0f3ec; display:flex; flex-direction:column; gap:6px; justify-content:center; align-items:center; font-size:15px; color:#6c795f; }
.ah-no-photo span { font-size:12px; }
.ah-card-info { display:flex; flex-direction:column; gap:7px; padding:13px; }
.ah-card-info time, .ah-card-info > span { font-size:12px; color:#6c775f; }
.ah-card-info strong { font-size:14px; }
.ah-notice { padding:14px 16px; background:#f4f6f0; border-radius:8px; color:#637155; font-size:13px; }
.ah-error { color:#a13f32; background:#fff4ef; }
.ah-error button { margin:8px; }
.ah-undated { margin-top:24px; }
.ah-card-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap:16px; }
.ah-detail { width:min(1120px, calc(100vw - 48px)); max-height:calc(100dvh - 48px); margin:auto; padding:0; border:1px solid #d5dfd1; border-radius:16px; background:#fff; overflow:auto; }
.ah-detail::backdrop { background:#182314b3; }
.ah-detail > header { position:sticky; top:0; z-index:2; background:#fff; padding:18px 24px; display:flex; gap:16px; justify-content:space-between; border-bottom:1px solid #dfe5df; }
.ah-detail header .ah-eyebrow { margin-top:0; }
.ah-detail header p { margin-bottom:0; color:#6c775f; }
.ah-detail header button { align-self:flex-start; font-size:24px; }
.ah-detail-body { display:grid; grid-template-columns:minmax(0, 1.15fr) minmax(0, 1fr); gap:26px; padding:24px; }
.ah-gallery { min-width:0; }
.ah-gallery > .ah-image-frame { height:360px; display:flex; align-items:center; justify-content:center; border-radius:10px; }
.ah-gallery > .ah-image-frame img { object-fit:contain; }
.ah-gallery > .ah-no-photo { height:240px; border-radius:10px; padding:20px; text-align:center; }
.ah-photo-controls { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:12px 0; font-size:13px; }
.ah-filmstrip { display:flex; gap:8px; overflow-x:auto; padding:5px 0 12px; }
.ah-filmstrip button { padding:3px; flex:0 0 68px; }
.ah-filmstrip button[aria-pressed="true"] { border:2px solid #466836; }
.ah-filmstrip .ah-image-frame { height:56px; min-height:56px; }
.ah-filmstrip .ah-image-message { font-size:9px; padding:2px; }
.ah-detail-info { min-width:0; }
.ah-detail dl { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:18px 16px; margin:0 0 24px; }
.ah-notes { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.8; background:#f6f8f3; padding:16px; border-radius:8px; }
@media (max-width:1100px) { .ah-page { left:12px; right:12px; } }
@media (max-width:860px) {
  .ah-page-header.ah-has-summary { grid-template-columns:minmax(0, 1fr); gap:16px; }
  .ah-selector { max-width:none; }
}
@media (max-width:640px) {
  .ah-workspace-nav { gap:6px; padding:10px 16px; }
  .ah-workspace-nav button { flex:1; padding:8px 10px; }
  /* A backdrop filter would anchor the fixed mobile zone menu to this 64px bar. */
  body.v2-integrated.antler-history-open #top-bar { backdrop-filter:none; }
  .ah-page { top:calc(var(--v2-topbar-height, 72px) + 8px); left:8px; right:8px; bottom:8px; }
  .ah-page-header, .ah-content { padding:16px; }
  .ah-page-header { gap:16px; }
  .ah-page h2 { font-size:21px; }
  .ah-readonly { padding:5px 8px; font-size:10px; }
  .ah-summary, .ah-events, .ah-unassigned { padding:14px; }
  .ah-summary dl { grid-template-columns:repeat(2, minmax(0, 1fr)); gap:16px 12px; }
  .ah-selector { flex-direction:column; align-items:stretch; gap:8px; }
  .ah-selector select { min-width:0; width:100%; }
  .ah-timeline-head { align-items:flex-start; }
  .ah-browse button { padding:6px 10px; }
  .ah-detail { width:calc(100vw - 16px); max-height:calc(100dvh - 16px); border-radius:10px; }
  .ah-detail > header { padding:16px; }
  .ah-detail-body { display:flex; flex-direction:column; padding:16px; gap:22px; }
  .ah-gallery > .ah-image-frame { height:260px; }
  .ah-detail h2 { font-size:22px; }
}
@media (prefers-reduced-motion:reduce) { .ah-event-card { transition:none; } }
