/*
 * Functional PWA pages, refined presentation.
 *
 * This file intentionally keeps every canonical form, action and data target.
 * It replaces the oversized photographic composition with compact, readable
 * cream/white surfaces.  Controls use the system UI font so Japanese text and
 * numeric input remain predictable on iOS, Android and Windows.
 */

:root {
  --v153-paper: #fbf8f3;
  --v153-surface: #fffdf9;
  --v153-surface-soft: #f5f1ea;
  --v153-navy: #0d315c;
  --v153-ink: #1e3d5a;
  --v153-muted: #52677d;
  --v153-border: #ddd8cf;
  --v153-control-border: #7d8c9c;
  --v153-coral: #f06447;
  --v153-coral-deep: #b9492f;
  --v153-coral-soft: #fff0e9;
  --v153-blue-soft: #eef3f7;
  --v153-green: #14543d;
  --v153-shadow: 0 5px 18px rgb(37 52 58 / 7%);
  --v153-font: var(--hd-sans);
}

body[data-pwa-fixed-page="corrections"] .app-header,
body[data-pwa-fixed-page="punch"] .app-header,
body[data-pwa-fixed-page="attendance-history"] .app-header,
body[data-pwa-fixed-page="notifications"] .app-header,
body[data-pwa-fixed-page="history-other"] .app-header {
  display: none;
}

body[data-pwa-fixed-page="corrections"] #tab-corrections,
body[data-pwa-fixed-page="punch"] #tab-punch,
body[data-pwa-fixed-page="attendance-history"] #tab-history,
body[data-pwa-fixed-page="notifications"] #tab-history,
body[data-pwa-fixed-page="history-other"] #tab-history,
body[data-pwa-fixed-page="corrections"] #tab-corrections button,
body[data-pwa-fixed-page="corrections"] #tab-corrections input,
body[data-pwa-fixed-page="corrections"] #tab-corrections select,
body[data-pwa-fixed-page="corrections"] #tab-corrections textarea,
body[data-pwa-fixed-page="punch"] #tab-punch button,
body[data-pwa-fixed-page="punch"] #tab-punch input,
body[data-pwa-fixed-page="punch"] #tab-punch select,
body[data-pwa-fixed-page="attendance-history"] #tab-history button,
body[data-pwa-fixed-page="attendance-history"] #tab-history input,
body[data-pwa-fixed-page="attendance-history"] #tab-history select,
body[data-pwa-fixed-page="attendance-history"] #tab-history textarea,
body[data-pwa-fixed-page="notifications"] #tab-history button {
  font-family: var(--v153-font);
}

.app-view .v153-source-heading { display: none; }

.app-view .v153-fixed-head {
  padding: calc(7px + env(safe-area-inset-top)) 0 8px;
  color: var(--v153-navy);
}

.app-view .v153-brand-line {
  display: flex;
  align-items: center;
  min-height: 46px;
}

.app-view .v153-brand-line .brand-mark {
  width: 38px;
  height: 38px;
  margin-right: 9px;
  border: 1px solid rgb(13 49 92 / 15%);
  border-radius: 50%;
  background: #fff url('/icons/icon-192.png') center / cover no-repeat;
}

.app-view .v153-brand-line > span:nth-child(2) { display: grid; line-height: 1.15; }
.app-view .v153-brand-line b { color: var(--v153-navy); font-size: 16px; letter-spacing: .08em; }
.app-view .v153-brand-line small { margin-top: 2px; color: var(--v153-muted); font-size: 9px; font-weight: 800; letter-spacing: .14em; }

.app-view .v153-head-bell {
  position: relative;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 1px solid var(--v153-border);
  border-radius: 50%;
  background: var(--v153-surface);
}

.app-view .v153-head-bell::before {
  display: block;
  width: 16px;
  height: 18px;
  margin: auto;
  border: 2px solid var(--v153-navy);
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  content: "";
}

.app-view .v153-head-bell i {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--v153-coral);
}

.app-view .v153-title-line {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 52px;
  margin-top: 3px;
}

.app-view .v153-title-line h1 {
  margin: 0;
  color: var(--v153-navy);
  font-size: clamp(23px, 6.5vw, 30px);
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.2;
}

.app-view .v153-title-line p {
  margin: 3px 0 0;
  color: var(--v153-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.app-view .v153-back {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0 0 3px;
  border: 1px solid var(--v153-border);
  border-radius: 50%;
  background: var(--v153-surface);
  color: var(--v153-navy);
  font-family: var(--v153-font);
  font-size: 30px;
  line-height: 1;
  place-items: center;
}

.app-view #tab-history .v153-history-copy small,
.app-view .v153-notification-copy > small {
  color: var(--v153-coral-deep);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .13em;
}

.app-view #tab-corrections .apply-card { margin-top: 12px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.app-view #tab-corrections .v153-original-summary { display: none; }
.app-view #tab-corrections .empty-state { border: 1px dashed #cfd7df; background: #fffefa; color: #596f86; -webkit-text-fill-color: #596f86; }
.app-view .v153-requested-at { display: block; margin: 6px 0 0; color: #596f86; -webkit-text-fill-color: #596f86; font-size: 11px; }
.app-view .v153-row-arrow { position: absolute; top: 50%; right: 14px; color: var(--v153-navy); font-family: var(--v153-font); font-size: 25px; transform: translateY(-50%); }

/* Attendance history: the photo is a compact accent, never a page-sized hero. */
.app-view #tab-history .v153-attendance-photo {
  position: relative;
  min-height: 98px;
  margin: 7px 0 0;
  overflow: hidden;
  border: 1px solid var(--v153-border);
  border-radius: 18px;
  background: #d8d8d0 var(--pwa-photo-url) right center / 45% auto no-repeat;
  box-shadow: var(--v153-shadow);
}

.app-view #tab-history .v153-attendance-photo::after { position: absolute; inset: 0; background: linear-gradient(90deg, #fffdf9 0%, #fffdf9 54%, rgb(255 253 249 / 68%) 72%, transparent 100%); content: ""; }
.app-view #tab-history .v153-history-compat { display: none; }
.app-view #tab-history .v153-history-copy { position: relative; z-index: 1; display: grid; align-content: center; width: 67%; min-height: 96px; padding: 13px 15px; }
.app-view #tab-history .v153-history-copy h2 { margin: 2px 0 0; color: var(--v153-navy); font-size: 18px; }
.app-view #tab-history .v153-history-copy p { margin: 3px 0 0; color: var(--v153-muted); font-size: 10px; line-height: 1.45; }

.app-view #tab-history #v153-history-photo {
  position: absolute;
  z-index: 2;
  right: 8px;
  bottom: 8px;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid rgb(255 255 255 / 88%);
  border-radius: 10px;
  background: rgb(255 255 255 / 94%);
  color: var(--v153-navy);
  font-size: 10px;
}

.app-view #tab-history .v153-photo-message {
  position: absolute;
  z-index: 2;
  right: 8px;
  bottom: 4px;
  max-width: 42%;
  overflow: hidden;
  padding: 3px 6px;
  border-radius: 7px;
  background: #0d315c;
  color: #fff;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-view #tab-history .v153-history-types {
  display: flex;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0 0 2px;
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  scrollbar-width: none;
}

.app-view #tab-history .v153-history-types::-webkit-scrollbar { display: none; }
.app-view #tab-history .v153-history-types button { flex: 0 0 auto; min-width: 72px; min-height: 44px; padding: 8px 13px; border: 1px solid var(--v153-border); border-radius: 999px; background: var(--v153-surface); color: var(--v153-muted); font-size: 12px; box-shadow: none; }
.app-view #tab-history .v153-history-types button[aria-selected="true"] { border-color: var(--v153-navy); background: var(--v153-navy); color: #fff; }

.app-view .v153-history-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 10px 0; }
.app-view .v153-history-tools button { display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--v153-border); border-radius: 12px; background: var(--v153-surface); color: var(--v153-navy); font-size: 12px; box-shadow: none; }
.app-view .v153-history-tools i { margin-left: auto; font-style: normal; }

.app-view #tab-history .history-content { margin-top: 10px; }
.app-view #tab-history .history-content .empty-state,
.app-view .v153-notification-list .empty-state { border: 1px dashed #cfd7df; background: #fffefa; color: #415a73; }

.app-view #tab-history .v153-attendance-card {
  position: relative;
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr);
  gap: 10px;
  min-height: 126px;
  padding: 13px 13px 35px;
  border: 1.5px solid #cfd7df;
  border-radius: 15px;
  background: #fffefa;
  color: var(--v153-navy);
  -webkit-text-fill-color: var(--v153-navy);
  box-shadow: var(--v153-shadow);
}

.app-view #tab-history .v153-attendance-card .timeline-date { min-height: 50px; padding-block: 6px; border-radius: 11px; background: var(--v153-surface-soft); }
.app-view #tab-history .v153-attendance-card > :nth-child(2) { grid-column: 2; min-width: 0; }
.app-view #tab-history .v153-attendance-card h3 { color: var(--v153-navy); -webkit-text-fill-color: var(--v153-navy); font-size: 15px; }
.app-view #tab-history .v153-attendance-card .timeline-times { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.app-view #tab-history .v153-attendance-card .timeline-times span { min-height: 39px; padding: 9px; border-left: 2px solid #4387dc; background: #f8fafb; color: var(--v153-navy); -webkit-text-fill-color: var(--v153-navy); font-size: 15px; font-variant-numeric: tabular-nums; }
.app-view #tab-history .v153-attendance-card .timeline-times span + span { border-left-color: var(--v153-coral); }
.app-view #tab-history .v153-attendance-card .timeline-note { width: 100%; margin-top: 8px; padding: 9px 10px; border: 1px solid #d3dce5; border-radius: 9px; background: #eef3f7; color: #173b62; -webkit-text-fill-color: #173b62; font-size: 12px; line-height: 1.55; writing-mode: horizontal-tb; overflow-wrap: anywhere; }
.app-view #tab-history .v153-attendance-card .timeline-note strong { color: var(--v153-navy); -webkit-text-fill-color: var(--v153-navy); }
.app-view #tab-history .v153-attendance-card .timeline-meta { color: #52677d; -webkit-text-fill-color: #52677d; font-size: 10px; }

/* Photo/site selector: all canonical select and punch actions remain active. */
.app-view .v153-site-head { display: flex; align-items: center; justify-content: space-between; min-height: calc(54px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
.app-view .v153-site-head h1 { margin: 0; color: var(--v153-navy); font-size: 24px; letter-spacing: .01em; }
.app-view .v153-site-head button { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--v153-coral-deep); font-size: 14px; font-weight: 800; }

.app-view .v153-site-search { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; min-height: 50px; margin: 7px 0 11px; padding: 0 13px; border: 1px solid var(--v153-control-border); border-radius: 14px; background: var(--v153-surface); color: var(--v153-muted); box-shadow: none; }
.app-view .v153-site-search input { width: 100%; min-height: 48px; border: 0; outline: 0; background: transparent; color: var(--v153-navy); font-size: 16px; }
.app-view .v153-site-search:focus-within { border-color: #2367a6; outline: 3px solid rgb(35 103 166 / 18%); outline-offset: 1px; }
.app-view #tab-punch .v153-native-site-picker { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
.app-view #tab-punch .pwa-site-choice-list { display: grid; gap: 8px; margin: 0; overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.app-view #tab-punch .pwa-site-choice-row { position: relative; min-width: 0; min-height: 82px; }
.app-view #tab-punch .pwa-site-choice-row + .pwa-site-choice-row { border-top: 0; }
.app-view #tab-punch .pwa-site-choice { display: grid; grid-template-columns: 62px minmax(0, 1fr) 34px; align-items: center; gap: 11px; width: 100%; min-height: 82px; padding: 9px 10px; border: 1px solid var(--v153-border); border-radius: 14px; background: var(--v153-surface); color: var(--v153-navy); text-align: left; box-shadow: var(--v153-shadow); }
.app-view #tab-punch .pwa-site-choice[aria-selected="true"] { border-color: #f28b70; background: #fffaf5; box-shadow: 0 0 0 2px rgb(240 95 65 / 8%); }
.app-view #tab-punch .pwa-site-choice-image { display: block; width: 62px; height: 62px; overflow: hidden; border: 1px solid #d7dde1; border-radius: 11px; background: #e8e2d8 var(--pwa-photo-url, linear-gradient(135deg, #e8e2d8, #f9f5ee)) center / cover no-repeat; }
.app-view #tab-punch .pwa-site-choice > span:nth-child(2) { min-width: 0; padding-right: 2px; }
.app-view #tab-punch .pwa-site-choice b,
.app-view #tab-punch .pwa-site-choice small { display: block; }
.app-view #tab-punch .pwa-site-choice b { color: var(--v153-navy); -webkit-text-fill-color: var(--v153-navy); font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.app-view #tab-punch .pwa-site-choice small { margin-top: 4px; overflow: hidden; color: #52677d; -webkit-text-fill-color: #52677d; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; white-space: normal; }
.app-view #tab-punch .pwa-site-choice > i { display: grid; justify-self: end; width: 30px; height: 30px; border-radius: 50%; color: var(--v153-navy); -webkit-text-fill-color: var(--v153-navy); font-family: var(--v153-font); font-size: 21px; font-style: normal; place-items: center; }
.app-view #tab-punch .pwa-site-choice:not([aria-selected="true"]) > i::before { content: "›"; }
.app-view #tab-punch .pwa-site-choice[aria-selected="true"] > i { background: var(--v153-coral); color: #fff; -webkit-text-fill-color: #fff; font-size: 16px; }
.app-view #tab-punch .pwa-site-photo-edit { position: absolute; z-index: 3; top: 28px; left: 19px; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border: 1px solid rgb(255 255 255 / 90%); border-radius: 50%; background: rgb(13 49 92 / 88%); color: #fff; -webkit-text-fill-color: #fff; font-size: 10px; font-weight: 800; box-shadow: 0 3px 10px rgb(13 49 92 / 24%); }
.app-view #tab-punch .pwa-site-photo-edit:focus-visible { outline: 3px solid #2367a6; outline-offset: 2px; }
.app-view #tab-punch .pwa-site-photo-message { display: block; min-height: 0; margin: 3px 10px 0 82px; color: #415a73; -webkit-text-fill-color: #415a73; font-size: 10px; line-height: 1.4; }
.app-view #tab-punch .pwa-site-photo-message:empty { display: none; }
.app-view #tab-punch .v153-site-add { width: 100%; min-height: 50px; margin: 12px 0; border: 1px solid #f28b70; border-radius: 14px; background: var(--v153-coral-soft); color: var(--v153-coral-deep); font-size: 14px; font-weight: 800; }
.app-view #tab-punch .punch-correction-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-top: 12px; padding: 13px 14px; border: 1px solid var(--v153-border); border-radius: 14px; background: var(--v153-surface); color: var(--v153-navy); box-shadow: var(--v153-shadow); }
.app-view #tab-punch .punch-correction-entry b { display: block; color: var(--v153-navy); -webkit-text-fill-color: var(--v153-navy); font-size: 14px; }
.app-view #tab-punch .punch-correction-entry p { margin: 3px 0 0; color: #52677d; -webkit-text-fill-color: #52677d; font-size: 11px; line-height: 1.45; }
.app-view #tab-punch .punch-correction-entry button { min-width: 112px; min-height: 44px; padding: 8px 11px; border: 1px solid #c7d6e3; border-radius: 11px; background: #edf5fb; color: #0b4f82; -webkit-text-fill-color: #0b4f82; font-size: 12px; font-weight: 800; }
@media (max-width: 360px) {
  .app-view #tab-punch .punch-correction-entry { grid-template-columns: 1fr; }
  .app-view #tab-punch .punch-correction-entry button { width: 100%; }
}
.app-view #tab-punch .location-card,
.app-view #tab-punch .punch-actions,
.app-view #tab-punch .help-card,
.app-view #tab-punch #main-msg { margin-top: 11px; }

/* Work report and correction forms never inherit native iOS dark paint. */
.app-view .work-sheet-card { border: 0; background: #fffdf9; color: var(--v153-navy); -webkit-text-fill-color: var(--v153-navy); color-scheme: light; box-shadow: 0 20px 70px rgb(0 0 0 / 30%); }
.app-view .work-sheet-card h2,
.app-view .work-sheet-card .field > span { color: var(--v153-navy); -webkit-text-fill-color: var(--v153-navy); }
.app-view .work-sheet-card .work-help,
.app-view .work-sheet-card .work-counter { color: var(--v153-muted); -webkit-text-fill-color: var(--v153-muted); }
.app-view .work-sheet-card .msg,
.app-view #tab-corrections .msg,
.app-view #tab-history .msg { color: #a13d37; -webkit-text-fill-color: #a13d37; }
.app-view .work-sheet-card .msg.ok,
.app-view #tab-corrections .msg.ok,
.app-view #tab-history .msg.ok { color: var(--v153-green); -webkit-text-fill-color: var(--v153-green); }

body .app-view .work-sheet-card .work-field textarea { min-height: 156px; border: 1.5px solid var(--v153-control-border) !important; background: #fffefa !important; color: var(--v153-navy) !important; -webkit-text-fill-color: var(--v153-navy) !important; caret-color: var(--v153-navy); color-scheme: light !important; opacity: 1; box-shadow: inset 0 1px 3px rgb(13 49 92 / 7%); }
body .app-view .work-sheet-card .work-field textarea:focus { border-color: var(--v153-coral) !important; outline: 3px solid rgb(240 95 65 / 14%); }
body .app-view .work-sheet-card .work-field textarea::placeholder { color: #607286 !important; -webkit-text-fill-color: #607286 !important; opacity: 1 !important; }
.app-view .work-sheet-card .work-preview { border: 1px solid var(--v153-border); background: var(--v153-surface-soft); color: #173b62; -webkit-text-fill-color: #173b62; }
.app-view .work-sheet-card .sheet-actions { margin-top: 12px; padding: 12px 0 max(4px, env(safe-area-inset-bottom)); border-top: 1px solid #ece6dc; background: #fffdf9 !important; }
.app-view .work-sheet-card .sheet-actions .btn-secondary { border: 1px solid var(--v153-border); background: #fffdf9; color: var(--v153-navy); -webkit-text-fill-color: var(--v153-navy); box-shadow: none; }
.app-view .work-sheet-card .sheet-actions .btn-primary,
.app-view .work-sheet-card .sheet-actions .btn-out { border: 0; background: linear-gradient(135deg, #ff6c4d, #f45f43); color: #fff; -webkit-text-fill-color: #fff; box-shadow: 0 7px 18px rgb(244 95 67 / 20%); }

.app-view #tab-history .apply-card,
.app-view #tab-history .history-content > .list-card { border-color: #cfd7df; background: #fffefa; color: var(--v153-navy); }
.app-view #tab-history .apply-card summary,
.app-view #tab-history .history-content > .list-card h3 { color: var(--v153-navy); -webkit-text-fill-color: var(--v153-navy); }
.app-view #tab-history .history-content > .list-card p { color: #596f86; -webkit-text-fill-color: #596f86; }

/* Notifications use the same density as history, without a decorative slab. */
.app-view .v153-notification-only[hidden],
.app-view .v153-history-tools[hidden],
.app-view #pwa-history-hero[hidden] { display: none; }

.app-view .v153-notification-only { margin-top: 10px; }
.app-view #v153-notification-intro { display: grid; grid-template-columns: minmax(0, 1fr) 58px; align-items: center; gap: 10px; min-height: 88px; padding: 15px 16px; border: 1px solid var(--v153-border); border-radius: 16px; background: var(--v153-surface); box-shadow: var(--v153-shadow); }
.app-view .v153-notification-copy h2 { margin: 2px 0 0; color: var(--v153-navy); font-size: 19px; line-height: 1.35; }
.app-view .v153-notification-copy p { margin: 3px 0 0; color: #52677d; -webkit-text-fill-color: #52677d; font-size: 11px; line-height: 1.45; }
.app-view .v153-envelope { position: relative; width: 54px; height: 39px; border: 2px solid #9fc5ef; border-radius: 8px; background: #fff; }
.app-view .v153-envelope::before,
.app-view .v153-envelope::after { position: absolute; top: 9px; width: 32px; height: 2px; background: #4588dc; content: ""; }
.app-view .v153-envelope::before { left: 0; transform: rotate(33deg); }
.app-view .v153-envelope::after { right: 0; transform: rotate(-33deg); }

.app-view #v153-notification-controls > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.app-view #v153-notification-controls h2 { margin: 0; color: var(--v153-navy); font-size: 17px; }
.app-view #v153-read-all { min-height: 44px; border: 0; background: transparent; color: var(--v153-coral-deep); font-size: 12px; font-weight: 800; }
.app-view .v153-notification-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 3px; padding: 4px; border: 1px solid var(--v153-border); border-radius: 14px; background: var(--v153-surface-soft); }
.app-view .v153-notification-tabs button { min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: #52677d; -webkit-text-fill-color: #52677d; font-size: 13px; font-weight: 800; }
.app-view .v153-notification-tabs button[aria-selected="true"] { background: #fff; color: var(--v153-navy); -webkit-text-fill-color: var(--v153-navy); box-shadow: 0 2px 7px rgb(33 49 57 / 7%); }
.app-view .v153-push-enable { width: auto; min-height: 44px; margin-bottom: 8px; border-color: var(--v153-border); background: var(--v153-surface); color: var(--v153-navy); }
.app-view .v153-notification-list { display: grid; gap: 8px; }
.app-view .v153-notification-card { position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr) 14px; align-items: start; gap: 10px; min-height: 104px; padding: 13px 12px; border: 1px solid var(--v153-border); border-radius: 15px; background: #fff; box-shadow: var(--v153-shadow); }
.app-view .v153-notification-card.is-read { background: #fffefa; }
.app-view .v153-notification-icon { display: grid; width: 40px; height: 40px; border-radius: 12px; background: var(--v153-coral); color: #fff; font-size: 13px; font-weight: 850; place-items: center; }
.app-view .v153-notification-card:nth-child(4n+2) .v153-notification-icon { background: #4388dc; }
.app-view .v153-notification-card:nth-child(4n+3) .v153-notification-icon { background: #8798ac; }
.app-view .v153-notification-card:nth-child(4n+4) .v153-notification-icon { background: #58ac84; }
.app-view .v153-notification-card > div > div { display: flex; align-items: start; justify-content: space-between; gap: 7px; }
.app-view .v153-notification-card h3 { margin: 0; color: var(--v153-navy); -webkit-text-fill-color: var(--v153-navy); font-size: 14px; line-height: 1.4; }
.app-view .v153-notification-card time { flex: 0 0 auto; color: #52677d; -webkit-text-fill-color: #52677d; font-size: 9px; }
.app-view .v153-notification-card p { margin: 4px 0 7px; color: #52677d; -webkit-text-fill-color: #52677d; font-size: 11px; line-height: 1.5; }
.app-view .v153-notification-detail { display: block; padding-top: 6px; border-top: 1px solid #ebe6de; color: #1763bd; -webkit-text-fill-color: #1763bd; font-size: 10px; }
.app-view .v153-notification-card > b { align-self: end; color: var(--v153-navy); font-family: var(--v153-font); font-size: 19px; }
.app-view .v153-unread-dot { position: absolute; top: 53px; right: 11px; width: 7px; height: 7px; border-radius: 50%; background: var(--v153-coral); }

/* Secondary pages: real hidden state, compact menu, opaque safe-area page. */
html.pwa-secondary-open,
body.pwa-secondary-open { overflow: hidden; overscroll-behavior: none; }

.pwa-secondary-layer,
.pwa-secondary-layer button,
.pwa-secondary-layer input,
.pwa-secondary-layer select,
.pwa-secondary-layer textarea { font-family: var(--v153-font); }

.pwa-secondary-layer {
  background: var(--v153-paper);
  color: var(--v153-ink);
  color-scheme: light;
}

.pwa-secondary-layer[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.pwa-secondary-header {
  min-height: calc(64px + env(safe-area-inset-top));
  padding: calc(7px + env(safe-area-inset-top)) 14px 7px;
  border-bottom: 1px solid var(--v153-border);
  background: #fbf8f3;
}

.pwa-secondary-back { width: 44px; height: 44px; border-color: var(--v153-border); border-radius: 14px; background: var(--v153-surface); color: var(--v153-navy); font-size: 27px; }
.pwa-secondary-header small { color: var(--v153-coral-deep); font-size: 8px; letter-spacing: .1em; }
.pwa-secondary-header h1 { color: var(--v153-navy); font-size: 18px; }
.pwa-secondary-content { width: min(100%, 560px); min-height: calc(100dvh - 64px - env(safe-area-inset-top)); padding: 12px 14px calc(24px + env(safe-area-inset-bottom)); }

.pwa-menu-hero,
.pwa-profile-card,
.pwa-version-hero,
.pwa-punch-detail-hero,
.pwa-contact-card { border-color: var(--v153-border); border-radius: 18px; background: var(--v153-surface); box-shadow: var(--v153-shadow); }

.pwa-menu-hero { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; padding: 13px; }
.pwa-menu-avatar { width: 48px; height: 48px; border-radius: 14px; background: var(--v153-coral); font-size: 18px; }
.pwa-menu-hero small { color: var(--v153-muted); font-size: 10px; }
.pwa-menu-hero h2 { margin-top: 1px; color: var(--v153-navy); font-size: 17px; }
.pwa-menu-hero button { min-height: 44px; color: var(--v153-coral-deep); font-size: 12px; }

.pwa-menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.pwa-menu-card { grid-template-columns: 34px minmax(0, 1fr) 12px; min-height: 68px; padding: 9px; border-color: var(--v153-border); border-radius: 14px; background: var(--v153-surface); color: var(--v153-ink); box-shadow: none; }
.pwa-menu-card > span { width: 34px; height: 34px; border-radius: 10px; background: var(--v153-coral-soft); color: var(--v153-coral-deep); font-size: 12px; }
.pwa-menu-card b { color: var(--v153-navy); font-size: 13px; }
.pwa-menu-card small { color: var(--v153-muted); font-size: 9px; }
.pwa-menu-card i { color: #9b8f82; font-size: 18px; }

.pwa-menu-list { margin-top: 9px; border-color: var(--v153-border); border-radius: 15px; background: var(--v153-surface); box-shadow: none; }
.pwa-menu-list > button { min-height: 50px; padding: 9px 13px; border-bottom-color: #eee9df; color: var(--v153-navy); }
.pwa-menu-list > button.is-danger { color: #a94b42; }
.pwa-menu-list small { color: var(--v153-muted); }
.pwa-page-intro,
.pwa-page-note { color: var(--v153-muted); }
.pwa-detail-list { border-color: var(--v153-border); border-radius: 15px; background: var(--v153-surface); }
.pwa-detail-list > div { padding: 12px 14px; }
.pwa-detail-list dt { color: var(--v153-muted); }
.pwa-detail-list dd { color: var(--v153-navy); }
.pwa-faq-list details { border-color: var(--v153-border); border-radius: 14px; background: var(--v153-surface); }
.pwa-faq-list summary { min-height: 50px; color: var(--v153-navy); }
.pwa-faq-list p { color: var(--v153-muted); }
.pwa-page-primary { min-height: 50px; }

@media (max-width: 380px) {
  .app-view .v153-title-line p { display: none; }
  .pwa-menu-grid { grid-template-columns: 1fr; }
  .pwa-menu-card { min-height: 60px; }
}

@media (prefers-color-scheme: dark) and (prefers-color-scheme: light) {
  .pwa-secondary-layer,
  body[data-pwa-fixed-page="corrections"] #tab-corrections,
  body[data-pwa-fixed-page="punch"] #tab-punch,
  body[data-pwa-fixed-page="attendance-history"] #tab-history,
  body[data-pwa-fixed-page="notifications"] #tab-history { color-scheme: light; }
}

@media (prefers-reduced-motion: reduce) {
  .app-view #tab-corrections *,
  .app-view #tab-history *,
  .app-view #tab-punch *,
  .pwa-secondary-layer * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
