:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #0f766e;
  --primary-button: var(--success-bg);
  --primary-button-dark: #bbf7d0;
  --primary-dark: #115e59;
  --secondary: #e2e8f0;
  --secondary-text: #0f172a;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --danger-dark: #991b1b;
  --success: #15803d;
  --success-bg: #dcfce7;
  --border: #cbd5e1;
  --glass-highlight: rgba(255, 255, 255, 0.56);
  --soft-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  --button-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), inset 0 -3px 8px rgba(15, 23, 42, 0.08);
  --paper-glass-button: linear-gradient(180deg, #ffffff 0%, #fbfdff 28%, #f4f8fc 52%, #e9f0f7 76%, #dde7f1 100%);
  --paper-glass-button-pressed: linear-gradient(180deg, #eef4fa 0%, #e2ebf4 100%);
}


* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  overscroll-behavior-y: none;
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 700px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
}

.app-header {
  padding: calc(16px + env(safe-area-inset-top)) 16px 16px;
  background: #0f766e;
  color: white;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.app-header h1 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.2;
}

main {
  padding: 16px;
  touch-action: manipulation;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.wizard-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.step-label {
  display: block;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 8px;
}

.wizard-top-row .step-label {
  margin-bottom: 0;
  text-align: right;
}
.wizard-top-row .step-label {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

h2 {
  margin: 0 0 16px;
  font-size: 1.35rem;
}

.help-text {
  color: var(--muted);
  margin-top: -6px;
  margin-bottom: 16px;
  white-space: pre-line;
}

.backup-card {
  position: relative;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--soft-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  touch-action: manipulation;
}

.backup-card h2,
.backup-card h3 {
  margin: 0 0 6px;
}

.backup-card p {
  margin: 0 0 12px;
  white-space: pre-line;
}

.backup-ok {
  background: var(--success-bg);
  border-color: #86efac;
}

.backup-needed {
  background: var(--danger-bg);
  border-color: #fca5a5;
}

#backupCard.backup-needed #backupTitle {
  min-height: 56px;
  display: flex;
  align-items: center;
  padding-right: 128px;
}

#backupCard.backup-needed #backupText {
  margin-top: 4px;
}

#backupNowButton {
  position: absolute;
  top: 16px;
  right: 32px;
  min-width: 112px;
  padding-left: 12px;
  padding-right: 12px;
}

.home-actions,
.stacked-buttons {
  display: grid;
  gap: 12px;
}

.stacked-buttons .choice-button {
  margin-bottom: 0;
}

.entry-type-button {
  text-align: center;
}

.button,
.choice-button,
.filter-button {
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-size: 1.05rem;
  font-weight: 700;
  min-height: 56px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--button-shadow);
  transition: transform 0.08s ease, background 0.08s ease;
  user-select: none;
  -webkit-user-select: none;
  isolation: isolate;
}

.button::before,
.choice-button::before,
.filter-button::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.40) 34%, rgba(255, 255, 255, 0.10) 64%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  z-index: 0;
}

.button:active,
.choice-button:active,
.filter-button:active,
.small-button:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58), inset 0 3px 10px rgba(15, 23, 42, 0.08);
}

.button.primary {
  background: var(--primary-button);
  color: #064e3b;
  border: 1px solid #86efac;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), inset 0 -3px 7px rgba(21, 128, 61, 0.10);
}

.button.primary::before {
  background: none;
}

.button.primary:active {
  background: var(--primary-button-dark);
}

.button.secondary {
  background: var(--paper-glass-button);
  color: #0f172a;
  border: 1px solid #9fb0c3;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), inset 0 0 0 1px rgba(255, 255, 255, 0.42), inset 0 -4px 9px rgba(30, 41, 59, 0.09);
}

.button.secondary::before,
.choice-button::before,
.filter-button::before,
.small-button::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.46) 30%, rgba(255, 255, 255, 0.12) 58%, rgba(255, 255, 255, 0) 100%);
}

.button.secondary::after,
.choice-button::after,
.filter-button::after,
.small-button::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: calc(14px - 2px);
  border: 1px solid rgba(255, 255, 255, 0.50);
  border-bottom-color: rgba(148, 163, 184, 0.18);
  pointer-events: none;
  z-index: 0;
}

.small-button::after {
  border-radius: 7px;
}

.button.danger-button {
  background: #fee2e2;
  color: #7f1d1d;
  border: 1px solid #fca5a5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), inset 0 -3px 7px rgba(127, 29, 29, 0.08);
}

.button.danger-button::before {
  background: none;
}

.choice-button {
  display: block;
  width: 100%;
  margin-bottom: 12px;
  background: var(--paper-glass-button);
  color: #0f172a;
  border: 1px solid #aebdcb;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.98), inset 0 0 0 1px rgba(255, 255, 255, 0.42), inset 0 -4px 10px rgba(30, 41, 59, 0.08), inset 0 12px 18px rgba(255, 255, 255, 0.22);
}

.keep-current-button {
  background: linear-gradient(180deg, #128178 0%, #0f766e 58%, #0d6f68 100%);
  color: #ffffff;
  border-color: #075a54;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58), inset 0 -3px 7px rgba(0, 48, 43, 0.18);
}

.keep-current-button::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.52) 0%, rgba(255, 255, 255, 0.18) 38%, rgba(255, 255, 255, 0) 72%);
}

.choice-button.centered-choice {
  text-align: center;
}

.choice-button:active {
  background: var(--paper-glass-button-pressed);
}

.choice-button.danger {
  background: var(--danger-bg);
  border-color: #fca5a5;
  color: #991b1b;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.action-row.single-action {
  grid-template-columns: 1fr;
}

.wizard-action-button {
  display: block;
  width: 100%;
  text-align: center;
}

.action-row .wizard-action-button {
  margin-bottom: 0;
  min-width: 0;
}

.date-confirm-button {
  width: 100%;
  text-align: center;
  margin-top: 4px;
}

.date-quick-label {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  margin: 2px 0 8px;
}

.hidden {
  display: none !important;
}

.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
}

.filter-button {
  padding: 10px 14px;
  min-height: 42px;
  white-space: nowrap;
  background: var(--paper-glass-button);
  border: 1px solid #aebdcb;
  color: #0f172a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), inset 0 0 0 1px rgba(255, 255, 255, 0.38), inset 0 -3px 8px rgba(30, 41, 59, 0.08);
}

.filter-button.active {
  background: #0f766e;
  color: white;
  border-color: #08756d;
}

.search-input,
.text-input,
.number-input,
.textarea-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  font-size: 1rem;
  margin-bottom: 12px;
  background: white;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.date-input {
  display: block;
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
  background: white;
  color: var(--text);
  text-align: center;
  -webkit-appearance: none;
  appearance: none;
}

.textarea-input {
  min-height: 130px;
  resize: vertical;
}

.entry-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.entry-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 44%, #edf2f7 100%);
  border: 1px solid #aebdcb;
  border-radius: 14px;
  padding: 8px 10px;
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.68);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.entry-card-text {
  min-width: 0;
}

.entry-card h3 {
  margin: 0 0 2px;
  font-size: 0.98rem;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-card p {
  margin: 1px 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-actions {
  display: flex;
  gap: 4px;
  margin-top: 0;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
}

.small-button {
  border: none;
  border-radius: 9px;
  padding: 6px 7px;
  min-height: 32px;
  font-weight: 800;
  font-size: 0.78rem;
  background: var(--paper-glass-button);
  color: #0f172a;
  border: 1px solid #9fb0c3;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), inset 0 0 0 1px rgba(255, 255, 255, 0.34), inset 0 -2px 6px rgba(15, 23, 42, 0.07);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.small-button.delete {
  background: var(--danger-bg);
  color: #991b1b;
}

.summary-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 46%, #edf2f7 100%);
  border: 1px solid #b4c2d1;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--soft-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.summary-card h3 {
  margin: 0 0 8px;
}

.summary-card p {
  margin: 4px 0;
}

.warning-text {
  margin-top: 18px;
  padding: 12px;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 600;
}

.review-list {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 46%, #edf2f7 100%);
  border: 1px solid #b4c2d1;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 16px;
  box-shadow: var(--soft-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.review-list p {
  margin: 8px 0;
}

.delete-message {
  padding: 12px;
  border-radius: 12px;
  background: var(--danger-bg);
  color: #991b1b;
  font-weight: 700;
  margin-bottom: 12px;
}

.current-entry-summary {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 46%, #edf2f7 100%);
  border: 1px solid #b4c2d1;
  border-radius: 14px;
  margin: 0 0 12px;
  overflow: hidden;
  box-shadow: var(--button-shadow);
}

.current-entry-summary summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 16px;
  min-height: 56px;
}

.current-entry-summary summary::-webkit-details-marker {
  display: none;
}

.current-entry-summary-label {
  color: var(--primary);
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
}

.current-entry-summary-chevron {
  color: var(--primary);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  transition: transform 0.15s ease;
}

.current-entry-summary[open] .current-entry-summary-chevron {
  transform: rotate(180deg);
}

.current-entry-summary-body {
  border-top: 1px solid var(--border);
  background: #f8fafc;
  display: grid;
  gap: 6px;
  padding: 8px 14px 12px;
}

.current-entry-summary-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.42fr) 1fr;
  gap: 10px;
  align-items: start;
  font-size: 0.95rem;
}

.current-entry-summary-row span {
  color: var(--muted);
}

.current-entry-summary-row strong {
  color: var(--text);
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
}

.current-entry-summary-body p {
  margin: 4px 0;
  color: var(--muted);
}


.current-entry-summary-row .summary-change-original {
  color: var(--danger-dark);
  font-weight: 800;
}

.current-entry-summary-row .summary-change-arrow {
  color: var(--text);
  font-weight: 800;
}

.current-entry-summary-row .summary-change-new {
  color: var(--text);
  font-weight: 800;
}


/* V26: fix large page outline caused by small-button pseudo-elements and standardise green buttons. */
#app,
main,
.screen,
.app-header {
  outline: none;
}

button:focus,
button:focus-visible,
input:focus,
input:focus-visible,
textarea:focus,
textarea:focus-visible {
  outline: none;
}

.button.primary,
.keep-current-button,
.filter-button.active {
  background: var(--primary-button);
  color: #064e3b;
  border: 1px solid #86efac;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), inset 0 -3px 7px rgba(21, 128, 61, 0.10);
}

.button.primary::before,
.keep-current-button::before,
.filter-button.active::before {
  background: none;
}

.button.primary:active,
.keep-current-button:active,
.filter-button.active:active {
  background: var(--primary-button-dark);
}



.placement-choice-button {
  display: grid;
  gap: 3px;
}

.placement-choice-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.placement-choice-dates {
  display: block;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.visibility-option-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.visibility-option-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.visibility-option-text strong,
.visibility-option-text small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visibility-option-text small {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.placement-list {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.placement-card {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  text-align: left;
  color: var(--text);
  font: inherit;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 46%, #edf2f7 100%);
  border: 1px solid #b4c2d1;
  border-radius: 14px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.placement-card:active {
  transform: translateY(1px);
}

.placement-card.placement-hidden {
  background: #fff1f2;
  border-color: #fecdd3;
}

.placement-card-text {
  min-width: 0;
}

.placement-card h3 {
  margin: 0 0 3px;
  font-size: 1rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.placement-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-pill {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-shown {
  background: var(--success-bg);
  color: #166534;
  border: 1px solid #86efac;
}

.status-hidden {
  background: var(--danger-bg);
  color: var(--danger-dark);
  border: 1px solid #fca5a5;
}

.visibility-option {
  display: block;
}

.visibility-option.shown-option {
  border-color: #86efac;
}

.visibility-option.hidden-option {
  background: #fff1f2;
  border-color: #fecdd3;
  color: var(--danger-dark);
}

.field-label {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  margin: 4px 0 6px;
}

.compact-date-input {
  text-align: left;
}

.status-pill {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}

.status-pill:active {
  transform: translateY(1px);
}

.placement-top-action {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 10px;
}

.placement-cancel-link {
  cursor: pointer;
}

.delete-placement-list,
.delete-confirm-list {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.delete-select-button {
  margin-bottom: 0;
}

.delete-select-button.selected {
  background: var(--danger-bg);
  border-color: #fca5a5;
  color: #0f172a;
}

.disabled-action-button,
.button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.button:disabled:active {
  transform: none;
}

.delete-confirm-item {
  background: var(--danger-bg);
  border: 1px solid #fca5a5;
  border-radius: 14px;
  padding: 12px;
  color: #0f172a;
}

.delete-confirm-item h3 {
  margin: 0 0 3px;
  font-size: 1rem;
  line-height: 1.2;
}

.delete-confirm-item p {
  margin: 0;
  color: var(--danger-dark);
  font-size: 0.9rem;
}


.full-width-action {
  width: 100%;
  margin-top: 2px;
}

.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.app-dialog {
  width: min(100%, 420px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.app-dialog h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 1.12rem;
  line-height: 1.2;
}

.app-dialog p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.35;
}

.dialog-placement-name {
  background: var(--paper-glass-button);
  border: 1px solid #aebdcb;
  border-radius: 14px;
  color: #0f172a;
  line-height: 1.3;
  margin-bottom: 14px;
  padding: 12px;
  overflow-wrap: anywhere;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.96), inset 0 -4px 9px rgba(30, 41, 59, 0.07);
}

.dialog-placement-name h4 {
  margin: 0 0 3px;
  font-size: 1rem;
  line-height: 1.2;
}

.dialog-placement-name p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.dialog-action-row {
  margin-bottom: 0;
}

/* V38: keep button text solid and align green/red borders with secondary buttons. */
.button-label,
.button > *,
.choice-button > *,
.filter-button > *,
.small-button > * {
  position: relative;
  z-index: 1;
  color: inherit;
  text-shadow: none;
  -webkit-text-fill-color: currentColor;
}

.button,
.choice-button,
.filter-button,
.small-button {
  text-shadow: none;
}

.button.primary,
.keep-current-button,
.filter-button.active,
.button.danger-button,
.choice-button.danger,
.delete-select-button.selected,
.delete-confirm-item {
  border-color: #9fb0c3;
}

/* V45 procedure management, version label and app-native dialogs */
#homeScreen {
  position: relative;
  min-height: calc(100dvh - 120px);
}

.app-version-label {
  position: fixed;
  left: calc(10px + env(safe-area-inset-left));
  bottom: calc(6px + env(safe-area-inset-bottom));
  margin: 0;
  color: rgba(100, 116, 139, 0.72);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  pointer-events: none;
  z-index: 5;
}

.procedure-foundation-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.procedure-foundation-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.procedure-foundation-card p {
  margin: 6px 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.procedure-foundation-card strong {
  color: var(--text);
}

.management-list {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.management-card {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  text-align: left;
  color: var(--text);
  font: inherit;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 46%, #edf2f7 100%);
  border: 1px solid #b4c2d1;
  border-radius: 14px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.management-card:active {
  transform: translateY(1px);
}

.management-card.management-hidden {
  background: #fff1f2;
  border-color: #fecdd3;
}

.management-card-text {
  min-width: 0;
}

.management-card h3 {
  margin: 0 0 3px;
  font-size: 1rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.management-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkbox-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  background: var(--paper-glass-button);
  border: 1px solid #aebdcb;
  border-radius: 14px;
  padding: 13px 14px;
  margin-bottom: 12px;
  color: var(--text);
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), inset 0 -4px 9px rgba(30, 41, 59, 0.07);
}

.checkbox-row input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--primary);
}

.disabled-choice {
  opacity: 0.58;
}

.app-dialog-message {
  white-space: pre-line;
}

/* V46 home shortcut, procedure delete controls and procedure-page search rule support */
.screen {
  position: relative;
}

.home-shortcut-button {
  appearance: none;
  -webkit-appearance: none;
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 100;
  transform: translateX(-50%);
  width: 64px;
  height: 42px;
  border: 1px solid #9fb0c3;
  border-radius: 999px;
  background: var(--paper-glass-button);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.96), inset 0 -4px 9px rgba(30, 41, 59, 0.07);
}

.home-shortcut-button svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.home-shortcut-button:active {
  transform: translate(-50%, 1px);
}


.dialog-stacked-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.dialog-stacked-actions .button {
  width: 100%;
}

.procedure-delete-button {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #9fb0c3;
  border-radius: 999px;
  background: #fee2e2;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1;
  padding: 8px 10px;
  min-width: 70px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), inset 0 -2px 5px rgba(127, 29, 29, 0.06);
}

.procedure-delete-button:active {
  transform: translateY(1px);
}


/* V47 bulk procedure selection */
.procedure-selection-card {
  cursor: default;
}

.procedure-selection-card:active {
  transform: none;
}

.procedure-already-added {
  opacity: 0.72;
}

.procedure-select-pill {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #9fb0c3;
  border-radius: 999px;
  background: var(--paper-glass-button);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1;
  padding: 8px 10px;
  min-width: 70px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), inset 0 -4px 9px rgba(30, 41, 59, 0.07);
}

.procedure-selected-pill {
  background: var(--success-bg);
  color: var(--text);
}

.procedure-already-added-pill {
  background: #eef2f7;
  color: var(--muted);
  min-width: 112px;
  cursor: not-allowed;
}

.procedure-select-pill:active:not(:disabled) {
  transform: translateY(1px);
}


/* V48 floating home shortcut and add/remove procedures */
.screen:not(#homeScreen) {
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

.procedure-top-actions {
  margin: 10px 0 14px;
}

.procedure-top-actions .button + .button {
  margin-top: 12px;
}

.procedure-change-add {
  background: #eefcf7;
}

.procedure-change-remove {
  background: #fff1f2;
}

.procedure-add-pill,
.procedure-selected-pill,
.procedure-remove-pill,
.procedure-remove-selected-pill {
  color: var(--text);
}

.procedure-selected-pill {
  background: #dcfce7;
}

.procedure-remove-pill {
  background: #fff7ed;
}

.procedure-remove-selected-pill {
  background: #fee2e2;
}

/* V50: flatter secondary buttons and clean floating navigation controls */
.wizard-top-row {
  justify-content: flex-end;
}

.wizard-top-row .step-label {
  align-items: flex-end;
  text-align: right;
}

.button.secondary,
.choice-button,
.filter-button,
.small-button {
  background: #ffffff;
  color: var(--text);
  text-shadow: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), inset 0 -3px 8px rgba(15, 23, 42, 0.07);
}

.button.secondary::before,
.choice-button::before,
.filter-button::before,
.small-button::before,
.button.secondary::after,
.choice-button::after,
.filter-button::after,
.small-button::after {
  display: none;
}

.home-shortcut-button,
.floating-back-button,
.floating-cancel-button {
  appearance: none;
  -webkit-appearance: none;
  position: fixed;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 100;
  width: 64px;
  height: 42px;
  border: 1px solid #9fb0c3;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), inset 0 -3px 8px rgba(15, 23, 42, 0.07);
}

.home-shortcut-button {
  left: 50%;
  transform: translateX(-50%);
  color: var(--primary);
}

.floating-back-button {
  left: 32px;
  color: #c2410c;
  background: #ffedd5;
  border-color: #9fb0c3;
}

.floating-cancel-button {
  right: 32px;
  color: #991b1b;
  background: #fff1f2;
  border-color: #9fb0c3;
}

.home-shortcut-button svg,
.floating-back-button svg,
.floating-cancel-button svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.floating-back-button svg {
  width: 25px;
  height: 25px;
  stroke-width: 2.55;
}

.floating-cancel-button svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.8;
}

.home-shortcut-button:active {
  transform: translate(-50%, 1px);
}

.floating-back-button:active,
.floating-cancel-button:active {
  transform: translateY(1px);
}

.procedure-top-actions {
  display: grid;
  gap: 12px;
  margin: 10px 0 14px;
}

.procedure-top-actions .button + .button {
  margin-top: 0;
}


/* V51: floating navigation and edit-save polish */
.edit-save-shortcut {
  margin-top: 12px;
}
