/* Common actions stay in reach; infrequent fields are disclosed on demand. */
.entry-column { display: grid; gap: 16px; min-width: 0; }
.entry-column > .form-card { order: 0; }
.entry-column > .settings-panel { order: 1; }
.profile-switcher { width: 200px; margin-left: auto; min-width: 0; }
.profile-switcher label { font-size: 11px; color: #617581; margin-bottom: 5px; }
.profile-switcher select { min-height: 44px; font-size: 14px; }
button, summary { touch-action: manipulation; }
.toast { pointer-events: none; }
.quick-date { display: flex; align-items: center; gap: 20px; margin: 22px 0 18px; }
.quick-date label { margin: 0; white-space: nowrap; }
.quick-date input { flex: 1; min-width: 0; }
.settings-panel, .history-panel { min-width: 0; }
.settings-panel > summary, .history-panel > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 64px; padding: 16px 22px; list-style: none;
}
.summary-copy { min-width: 0; display: grid; gap: 2px; }
.summary-copy strong, .history-heading > strong { font-size: 13px; font-weight: 600; }
.summary-copy small { font-size: 11px; color: #617581; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-plus { flex: none; color: var(--accent); font-size: 17px; transition: transform .15s; }
.settings-panel[open] > summary, .history-panel[open] > summary { margin-bottom: 0; border-bottom: 1px solid var(--line); }
.settings-panel[open] > summary .summary-copy, .history-panel[open] > summary .history-heading { transform: none; }
.settings-body { padding: 22px; }
.settings-body .range-settings { margin-top: 0; }
.settings-body .field:last-child { margin-bottom: 0; }
.device-fields > .field-hint { margin: -9px 0 16px; }
.history-panel { margin-top: 20px; }
.history-panel > summary { min-height: 58px; }
.history-body { padding: 0 20px 20px; }
.history-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.history-toolbar .history-caption { margin: 0; }
.action-summary { display: none; }
.period, .mode-switch button, .icon-button, .text-button, .secondary, .primary { min-height: 44px; }
.icon-button { min-width: 44px; }
.mode-switch button { min-width: 52px; font-size: 12px; }
.range-settings > summary { min-height: 44px; align-items: center; }
.history-panel .history-list { border-radius: 10px; }
.field input, .field textarea, .field select { scroll-margin-block: 80px 130px; }

@media (max-width: 640px), (max-width: 950px) and (max-height: 500px) {
  html { scroll-padding-bottom: 120px; }
  #workspace .header-inner { padding: max(10px, env(safe-area-inset-top)) 16px 10px; }
  .header-actions { gap: 12px; }
  .icon-button { width: 44px; height: 44px; }
  .container { padding: 16px 16px calc(118px + env(safe-area-inset-bottom)); }
  .page-heading { align-items: center; margin-bottom: 14px; }
  .page-heading .eyebrow, .page-heading p, .heading-dot { display: none; }
  .page-heading h1 { font-size: 21px; letter-spacing: 0; margin: 0; line-height: 1.4; }
  .page-heading .heading-copy { display: none; }
  .profile-switcher { flex: 1; max-width: 200px; width: auto; margin: 0; }
  .profile-switcher label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .profile-switcher select { font-size: 16px; padding: 9px 10px; background: #fff; height: 44px; }
  .environment { margin: 0; font-size: 10px; padding: 5px 8px; }
  .notice { margin-bottom: 12px; padding: 8px 12px; font-size: 12px; border-radius: 8px; }
  .checkin-grid { display: block; animation: none; }
  .entry-column { gap: 12px; }
  .form-card { padding: 18px; border-radius: 14px; }
  .form-card > .section-title { margin-bottom: 14px; }
  .form-card .section-title h2 { font-size: 14px; }
  .form-card .section-title > span { font-size: 11px; color: #617581; }
  .period-field legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .period-options { gap: 10px; }
  .period { min-height: 56px; padding: 12px; justify-content: center; gap: 8px; }
  .period > svg { width: 21px; height: 21px; }
  .period strong { font-size: 14px; }
  .period small, .radio-dot { display: none; }
  .quick-date { margin: 16px 0 12px; gap: 12px; }
  .quick-date label { font-size: 13px; }
  .quick-date input { min-height: 44px; height: 44px; padding: 9px 10px; background: #fff; }
  .time-label-row { margin-bottom: 10px; min-height: 44px; }
  .time-label-row label { font-size: 13px; }
  .time-label-row .unit { display: none; }
  .mode-switch { padding: 2px; }
  .mode-switch button { min-height: 44px; min-width: 52px; padding: 5px 12px; }
  .time-input-row { gap: 10px; }
  .time-input-row input { min-height: 54px; height: 54px; font-size: 25px; letter-spacing: 0; padding: 10px 12px; background: #f6faf9; border-color: #c9ded6; color: #21594f; }
  .time-input-row .secondary { min-height: 54px; font-size: 12px; gap: 6px; padding: 10px; }
  #range-description { font-size: 11px; color: #617581; line-height: 1.5; margin-top: 10px; }
  .seconds-control { gap: 8px; }
  .seconds-control input { min-height: 44px; font-size: 16px; }
  .seconds-control > span { font-size: 11px; color: #617581; }
  .settings-panel > summary { padding: 12px 16px; min-height: 64px; }
  .summary-copy strong, .history-heading > strong { font-size: 13px; }
  .summary-copy small { font-size: 11px; }
  .settings-body { padding: 16px; }
  .settings-body input, .settings-body select, .settings-body textarea { font-size: 16px; }
  .settings-body .field-row { gap: 12px; }
  .settings-body .section-divider { margin: 18px 0; }
  .preview-column { display: contents; }
  .time-card { display: none; }
  .submit-card {
    position: fixed; z-index: 5; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: 90px minmax(0,1fr); align-items: center; gap: 0 14px;
    padding: 12px max(16px, env(safe-area-inset-left)) calc(10px + env(safe-area-inset-bottom));
    border: 0; border-top: 1px solid #dde7e9; border-radius: 0; background: #fff;
    box-shadow: 0 -6px 24px #172e4008;
  }
  .submit-card .preview-line, .submit-card .submit-note { display: none; }
  .action-summary { display: grid; align-content: center; gap: 2px; min-width: 0; }
  .action-summary > span { font-size: 11px; color: #617581; }
  .action-summary > strong { font: 18px/1.4 var(--number); letter-spacing: -.3px; color: #21594f; }
  .submit-card .primary { min-height: 50px; padding: 12px 15px; font-size: 14px; }
  .submit-card .submit-footnote { display: none; }
  .history-panel { margin-top: 12px; border-radius: 14px; }
  .history-panel > summary { min-height: 52px; padding: 12px 16px; }
  .history-body { padding: 0 12px 12px; }
  .history-toolbar { gap: 6px; }
  .history-caption { font-size: 11px; }
  .history-row { padding: 12px; }
  .footer { padding: 16px 0 0; font-size: 9px; }
  .toast { top: max(12px, env(safe-area-inset-top)); bottom: auto; padding: 11px 15px; }
  .dialog-content { padding: 22px; }
  .dialog-content .eyebrow { display: none; }
  .dialog-content h2 { font-size: 20px; margin-top: 0; }
  .dialog-content dl { gap: 12px; margin: 20px 0; }
  .dialog-actions { position: sticky; bottom: -22px; background: white; padding: 12px 0 0; margin-top: 10px; }
  .dialog-actions > button { min-height: 48px; }
  .login-wrap { margin-top: 16px; }
  .login-story { padding: 20px 24px; }
  .login-heading { margin: 22px 0 8px; }
  .login-heading h1 { font-size: 29px; }
  .login-heading p, .login-stamp { display: none; }
  .login-panel { padding: 26px 24px; }
  .login-panel .primary { min-height: 48px; }
}

@media (max-width: 359px) {
  .container { padding-left: 12px; padding-right: 12px; }
  .form-card { padding: 14px; }
  .environment { max-width: 145px; font-size: 9px; }
  .period { padding: 10px 7px; }
  .period strong { font-size: 13px; }
  .time-input-row { gap: 8px; }
  .time-input-row input { font-size: 21px; padding-left: 9px; padding-right: 6px; }
  .time-input-row .secondary { font-size: 11px; padding: 10px 8px; }
  .submit-card { grid-template-columns: 82px minmax(0,1fr); gap: 0 10px; padding-left: 12px; padding-right: 12px; }
}

@media (max-width: 640px) and (max-height: 650px), (max-width: 950px) and (max-height: 500px) {
  .container { padding-top: 12px; }
  .page-heading { margin-bottom: 10px; }
  .notice { padding: 6px 10px; margin-bottom: 10px; }
  .form-card > .section-title { display: none; }
  .quick-date { margin-top: 12px; margin-bottom: 10px; }
  .form-card { padding-top: 14px; padding-bottom: 14px; }
}

@media (min-width: 641px) and (max-width: 950px) and (max-height: 500px) {
  #workspace .header-inner { padding-top: 6px; padding-bottom: 6px; }
  .page-heading { display: flex; margin-bottom: 8px; }
  .form-card { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px 18px; align-items: center; }
  .period-field { grid-column: 1; grid-row: 1; }
  .quick-date { grid-column: 2; grid-row: 1; margin: 0; }
  .time-label-row { grid-column: 1; grid-row: 2; margin: 0; }
  .time-input-row { grid-column: 2; grid-row: 2; }
  #range-description { grid-column: 2; grid-row: 3; margin: 0; }
  .seconds-control { grid-column: 1; grid-row: 3; margin: 0; }
  .seconds-control > span { display: none; }
}
