/* Pagi Hangat uses a cream canvas, coral actions and warm dividing lines. */
body.compact-ui {
  --background: #fffaf5;
  --paper: #fffaf5;
  --coral: #a54431;
  --coral-dark: #873322;
  --coral-soft: #f8e2d7;
  --ink: #362821;
  --sub: #66534a;
  --muted: #6c554b;
  --stroke: #e9d9cd;
  --pagi-page: #fffaf5;
  --pagi-surface: #fffdf9;
  --pagi-band: #f7e1d4;
  color: var(--ink);
  background: var(--pagi-page);
}
.pagi .workspace, body.compact-ui .screen { background: var(--pagi-page); }
body.compact-ui .app-header, body.compact-ui .bottom-nav, body.compact-ui .sheet { background: var(--pagi-surface); border-color: var(--stroke); }
body.compact-ui .sidebar { background: #fbefe6; }
body.compact-ui .login-screen { background: var(--pagi-page); }
body.compact-ui .login-card { border: 1px solid var(--stroke); background: var(--pagi-surface); box-shadow: none; max-width: 408px; }
body.compact-ui .login-brand { background: var(--pagi-band); padding: 15px 17px; border-radius: 12px; margin-bottom: 22px; }
body.compact-ui .page-heading h1, .login-card h1, .journal-person h1 {
  font-family: Georgia, serif;
  letter-spacing: -.026em;
  font-weight: 600;
}
body.compact-ui .home-title {
  background: var(--pagi-band);
  border-radius: 16px;
  padding: 18px 22px;
  margin-bottom: 16px;
}
body.compact-ui .home-title h1 { font-size: 32px; }
.home-title p { margin: 4px 0 0; font-size: 12px; color: var(--sub); }
body.compact-ui .login-choice, body.compact-ui .recorder-actions .action-card, body.compact-ui .mini-stat,
body.compact-ui .soft-panel, body.compact-ui .compact-journal { background: var(--pagi-surface); border-color: var(--stroke); }
body.compact-ui .recorder-actions .action-card { border-radius: 11px; }
body.compact-ui .recorder-actions .action-card:hover, body.compact-ui .compact-journal tr:hover { background-color: #fcf0e7; }
body.compact-ui .compact-journal th { background: #fbede3; color: var(--sub); }
.daily-summary { flex: 0 0 auto; border: 1px solid var(--stroke); background: #f9e7db; border-radius: 12px; padding: 10px 12px 8px; margin-bottom: 10px; }
.daily-summary h2 { margin: 0 0 6px; font-size: 15px; }
.day-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px 10px; }
.day-metrics span, .day-metrics strong { display: block; }
.day-metrics span { color: var(--sub); font-size: 11px; }
.day-metrics strong { font-size: 13px; }
.summary-activities { color: var(--sub); font-size: 11px; margin: 5px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.compact-ui .compact-journal :is(th,td):first-child { width: 148px; }
.clock-range { display: inline-flex; gap: 2px; align-items: baseline; flex-wrap: nowrap; white-space: nowrap; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: #663d2e; }
.clock-range time { white-space: nowrap; }
.clock-duration, .clock-date { display: block; color: var(--sub); font-size: 10px; line-height: 1.35; }
.clock-duration { font-weight: 650; }
body.compact-ui .journal-activity .entry-type { width: 25px; height: 25px; border: 0; border-radius: 7px; }
body.compact-ui .entry-type.type-meal { background: #fae7dd; color: #a1412e; }
body.compact-ui .entry-type.type-drink { background: #e4eff3; color: #285b70; }
body.compact-ui .entry-type.type-activity { background: #e4efe7; color: #35634b; }
body.compact-ui .entry-type.type-sleep { background: #f0e7f3; color: #63436e; }
.proof-mark { color: var(--sub); flex: 0 0 auto; }
.water-card { max-width: 480px; margin: 14px 0 0; }
.water-card .panel-head { margin-bottom: 2px; }
.water-card .panel-head svg { color: #285b70; }
.water-card .water-date { color: var(--sub); font-size: 12px; margin: 0 0 12px; }
#water-form label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 700; }
#water-form > input { max-width: 190px; }
#water-form > .primary, .finish-form > .primary { margin-top: 12px; }
.evidence-field { margin: 12px 0 0; padding: 9px 12px 12px; border: 1px solid var(--stroke); border-radius: 10px; background: var(--pagi-surface); min-width: 0; }
.evidence-field legend { padding: 0 4px; font-weight: 700; font-size: 13px; }
.evidence-field legend span { color: var(--sub); font-weight: 400; }
.evidence-field label { display: block; margin: 3px 0 5px; color: var(--sub); font-size: 12px; }
.evidence-field input { max-width: 100%; font-size: 14px; }
.evidence-field img { max-width: min(200px,100%); max-height: 120px; display: block; border-radius: 8px; object-fit: contain; margin: 0 0 8px; }
.evidence-field .tiny-link { display: block; }
.proof-view { margin: 14px 0; }
.proof-view img { display: block; width: 100%; max-height: 55vh; object-fit: contain; border-radius: 9px; background: #f9eee5; }
@media(max-width:600px) {
  body.compact-ui .home-title { padding: 14px 11px; }
  body.compact-ui .home-title h1 { font-size: 24px; }
  body.compact-ui .compact-journal :is(th,td):first-child { width: 124px; }
  body.compact-ui .compact-journal td:first-child { padding-inline: 6px; }
  .clock-range { font-size: 11px; }
  .day-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .daily-summary { padding: 8px 10px; }
  .day-metrics strong { font-size: 12px; }
  .evidence-field input { font-size: 16px; }
}

.mobile-summary:empty { display: none; }

.login-options[hidden], .pin-stage[hidden], .pin-wait[hidden] { display: none; }
.pin-hint { margin: -8px 0 14px; font-size: 14px; color: var(--sub); }
.pin-slots { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 7px; margin-bottom: 18px; }
.pin-slot { height: 42px; border: 1px solid #c7a79a; border-radius: 8px; background: var(--pagi-surface); display: grid; place-items: center; }
.pin-slot.filled { border-color: var(--coral); background: var(--coral-soft); }
.pin-slot.filled::after { content: ''; background: var(--coral-dark); width: 9px; height: 9px; border-radius: 50%; }
.pin-keypad { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.pin-key { display: grid; place-items: center; min-height: 46px; border: 1px solid #d8bfb3; border-radius: 8px; background: var(--pagi-surface); color: var(--ink); font-size: 19px; font-weight: 650; touch-action: manipulation; }
.pin-key:hover:not(:disabled), .pin-key:focus-visible { background: var(--coral-soft); border-color: var(--coral); }
.pin-key:disabled { opacity: .55; }
.pin-wait { color: var(--sub); margin: -6px 0 12px; font-size: 13px; }
.pin-back { display: block; min-height: 44px; margin-top: 8px; }

/* The time rail links successive journal entries without changing recorded times. */
.time-zone { margin-left: 4px; font-size: 10px; font-weight: 400; }
body.compact-ui .compact-journal td { height: 62px; padding-block: 7px; border-bottom-color: #efe3db; }
body.compact-ui .compact-journal td.journal-time { position: relative; padding-right: 24px; }
.time-content { position: relative; z-index: 1; }
.clock-range { line-height: 1.55; letter-spacing: .01em; }
.clock-duration { font-weight: 400; margin-top: 2px; }
.clock-date { white-space: normal; max-width: 100px; }
.timed-row .journal-time::before { content: ''; position: absolute; right: 12px; top: -1px; bottom: -1px; width: 1px; background: #d9bbac; }
.timed-row .journal-time::after { content: ''; position: absolute; right: 9px; top: 23px; width: 7px; height: 7px; border: 1px solid #a96b51; background: #fffdf9; border-radius: 50%; }
.timed-row.first-visible .journal-time::before { top: 26px; }
.timed-row.last-visible .journal-time::before { bottom: calc(100% - 26px); }
.timed-row.first-visible.last-visible .journal-time::before { display: none; }
.entry-connection { display: block; color: #80695c; font-size: 10px; line-height: 1.35; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.daily-total-row { background: #fcf5ee; }
.monitor-mode .workspace { display: block; height: auto; min-height: 100dvh; overflow: visible; }
.monitor-mode .app-header { flex: 0 0 auto; }
.monitor-mode .screen[data-view=journal] { display: block; width: 100%; overflow: visible; padding-bottom: max(24px,env(safe-area-inset-bottom)); }
.monitor-mode .journal-heading, .monitor-mode .journal-controls { flex: 0 0 auto; }
.monitor-mode .journal-page { display: block; }
.monitor-mode .journal-list { overflow: visible; }
.monitor-mode .journal-pagination { flex: 0 0 auto; }
@media(max-width:600px) {
 body.compact-ui .compact-journal td.journal-time { padding-left: 8px; padding-right: 22px; }
 .clock-duration, .clock-date { font-size: 10px; }
 .entry-connection { font-size: 10px; }
 .monitor-mode .journal-heading { margin-bottom: 6px; }
 .monitor-mode .journal-person { display: flex; flex-wrap: wrap; gap: 3px 10px; }
 .monitor-mode .journal-person h1 { font-size: 20px; }
 .monitor-mode .journal-person .count-label { margin: 0; }
 .monitor-mode .journal-controls { margin-bottom: 8px; gap: 6px; }
 .monitor-mode .screen[data-view=journal] { padding-top: 8px; }
 .monitor-mode .daily-summary { margin-bottom: 8px; }
}

.monitor-mode .journal-controls { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center; }
.monitor-mode .journal-date { min-width: 0; justify-content: flex-start; }
.monitor-mode .journal-date input { min-width: 0; }
.journal-filter-select { display: block; }
.journal-filter-select select { min-height: 44px; width: 132px; padding: 8px 10px; border: 1px solid var(--stroke); border-radius: 6px; background: var(--pagi-surface); color: var(--ink); font: inherit; font-size: 14px; }
@media(max-width:600px) {
 .monitor-mode .journal-controls { margin-bottom: 10px; }
 .monitor-mode .journal-date { gap: 0; }
 .monitor-mode .journal-date .icon-btn { flex: 0 0 44px; width: 44px; }
 .monitor-mode .journal-date input { flex: 1 1 0; width: 0; padding: 8px 2px; font-size: 16px; }
 .journal-filter-select select { width: 104px; font-size: 16px; padding-inline: 6px; }
}

.condition-card { background: var(--pagi-surface); border: 1px solid var(--stroke); border-radius: 12px; padding: 12px; margin: 0 0 12px; }
.condition-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.condition-heading h2 { font-size: 14px; margin: 0; }
.condition-heading svg { color: var(--sub); flex: 0 0 auto; }
.condition-updated { color: var(--sub); font-size: 11px; margin: 5px 0 10px; }
.condition-image { display: block; width: 100%; max-height: 340px; object-fit: contain; background: #f6ede5; border-radius: 8px; }
.condition-loading, .condition-empty { color: var(--sub); font-size: 12px; margin: 10px 0 0; }
.condition-upload { display: inline-flex; align-items: center; min-height: 44px; margin-top: 10px; padding: 8px 14px; border: 1px solid var(--stroke); border-radius: 7px; font-size: 13px; cursor: pointer; }
.condition-card:has(#condition-file:focus-visible) .condition-upload { outline: 2px solid var(--coral); outline-offset: 3px; }
.condition-image[hidden], .condition-loading[hidden], .condition-retry[hidden], #daily-summary-content[hidden] { display: none; }
body.compact-ui .daily-summary { padding: 0 12px; }
.daily-summary h2 { margin: 0; }
.summary-toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; min-height: 48px; gap: 12px; padding: 8px 0; background: transparent; border: 0; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.summary-toggle svg { flex: 0 0 auto; transform: rotate(90deg); }
.summary-toggle[aria-expanded=true] svg { transform: rotate(-90deg); }
#daily-summary-content { padding-bottom: 10px; }
@media(min-width:1101px) { .screen[data-view=home] .condition-card { max-width: 600px; } }
@media(max-width:600px) { .condition-image { max-height: 280px; } }

.current-location { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--stroke); }
.current-location h3 { margin: 0 0 5px; font-size: 13px; }
.location-coordinates { margin: 0 0 4px; font-size: 13px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.location-meta, .location-hint { font-size: 11px; line-height: 1.5; color: var(--sub); margin: 0; }
.location-map { display: inline-flex; gap: 6px; align-items: center; min-height: 44px; color: var(--coral-dark); font-size: 13px; }
.location-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 8px; }
.location-actions .secondary, .location-actions .tiny-link { min-height: 44px; }
.location-hint { margin-top: 6px; }

.location-embed { display: block; width: 100%; height: 240px; margin-top: 10px; border: 1px solid var(--stroke); border-radius: 8px; background: #f6ede5; }
.location-error { color: #a83524; font-size: 12px; line-height: 1.6; margin: 10px 0 0; }
.location-permission-help { margin-top: 6px; font-size: 12px; line-height: 1.6; color: var(--sub); }
.location-permission-help summary { min-height: 44px; display: list-item; padding-block: 12px; cursor: pointer; }
.location-permission-help ol { padding-left: 20px; margin: 0 0 6px; }
.location-permission-help li { margin-bottom: 6px; }
@media(min-width:768px) { .location-embed { height: 280px; } }
