/* Review refinements: one scrolling app surface, readable type, direct actions. */
.phone {
  padding: 20px 16px 0;
  font-size: 14px;
  line-height: 1.5;
}
.phone .companion-scroll {
  padding: 3px 4px 20px;
  scrollbar-width: none;
  overscroll-behavior-y: contain;
}
.phone .companion-scroll::-webkit-scrollbar { display: none; }
.phone .companion-scroll > .appbrand { margin-top: 8px; }
.phone .app-title { gap: 12px; align-items: center; margin: 24px 0; }
.phone .app-title p { font-size: 13px; }
.phone .app-title p:empty { display: none; }
.phone #new-rule {
  flex: none;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--gold);
  border-radius: 9px;
  background: transparent;
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
}
.phone .bottomnav {
  position: relative;
  z-index: 1;
  margin: 0 -16px;
  padding: 10px 12px 15px;
  background: var(--deep);
  border-top: 1px solid var(--rule);
  box-shadow: 0 -8px 18px -15px #0009;
}
.phone .bottomnav button { min-height: 54px; font-size: 12px; gap: 6px; }
.phone .bottomnav button[aria-current="page"] { background: var(--navy); }
.phone .bottomnav .symbol { width: 20px; height: 20px; }
.phone .phone-live { padding: 8px 0; margin: 0; font-size: 12px; }
.phone .phone-live:empty { padding: 0; }

.phone .week-summary {
  background: var(--navy);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 17px 16px 4px;
}
.phone .week-summary h4 { font-size: 14px; font-weight: 500; margin-bottom: 11px; }
.phone .summary-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 79px;
  padding: 15px 0;
  border: 0;
  border-top: 1px solid var(--rule);
  background: transparent;
  color: var(--text);
  text-align: left;
}
.phone .summary-count {
  min-width: 26px;
  color: var(--gold);
  font: 500 28px/1.2 'IBM Plex Mono', monospace;
}
.phone .summary-label { flex: 1; min-width: 0; }
.phone .summary-label strong { display: block; font-size: 14px; font-weight: 500; }
.phone .summary-label small { display: block; margin-top: 4px; color: var(--soft); font-size: 12px; }
.phone .summary-arrow { flex: none; color: var(--soft); font-size: 19px; }
.phone .attention-card { display: grid; grid-template-columns: minmax(0, 1fr) 18px; gap: 12px; padding: 15px 13px; }
.phone .attention-card > span { flex: none; }
.phone .attention-card .attention-copy { min-width: 0; }
.phone .attention-card strong { font-size: 14px; }
.phone .attention-card small { font-size: 12px; line-height: 1.5; }
.phone .section-label { margin-top: 22px; }
.phone .section-label h4 { font-size: 14px; }
.phone .section-label button { font-size: 13px; }
.phone .event-row { gap: 10px; padding: 15px 12px; min-height: 76px; }
.phone .event-copy strong { font-size: 14px; line-height: 1.4; }
.phone .event-copy small { font-size: 12px; line-height: 1.5; }
.phone .event-time { font-size: 11px; }
.phone .event-time { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
.phone .nav-chevron {
  display: block;
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.phone .attention-card .nav-chevron { color: var(--gold); }
.phone .event-row .nav-chevron, .phone .summary-row .nav-chevron { color: var(--soft); }
.phone .covered-rules button { gap: 12px; text-align: left; }
.phone .note-flag { font-size: 12px; }
.phone .history-filters button { min-height: 44px; font-size: 13px; padding: 8px 12px; }
.phone .result-count, .phone .detail-time, .phone .detail-kind { font-size: 12px; }
.phone .back-action, .phone .inline-action { min-height: 44px; font-size: 13px; }
.phone .event-detail dl > div { grid-template-columns: 72px 1fr; font-size: 14px; }
.phone .event-detail dd { overflow-wrap: anywhere; }
.phone .contract-expiry { display: block; margin-top: 4px; color: var(--soft); font-size: 12px; }
.phone .chev { display: flex; align-items: center; justify-content: center; }
.phone .recorded-reason { font-size: 14px; line-height: 1.6; }
.phone .recorded-reason > span { font-size: 12px; }
.phone form label { font-size: 14px; }
.phone textarea {
  min-height: 112px;
  resize: none;
  overflow: auto;
  font-size: 16px;
  line-height: 1.5;
  padding: 12px;
}
.phone .cp-primary { min-height: 46px; font-size: 13px; padding: 12px 14px; }
.phone .pattern-label, .phone .pattern-facts span { font-size: 12px; }
.phone .pattern-card h4 { font-size: 21px; }
.phone .pattern-facts { gap: 12px; }
.phone .pattern-facts strong { font-size: 27px; }
.phone .cp-copy { font-size: 14px; line-height: 1.6; }
.phone .pattern-actions button, .phone .covered-rules button { font-size: 13px; }
.phone .covered h4 { font-size: 18px; }
.phone .evidence-head { font-size: 12px; }
.phone .evidence-row { font-size: 12px; }
.phone .evidence-row strong { font-size: 13px; }
.phone .evidence-row small { font-size: 11px; }
.phone .trigger-chip { font-size: 14px; }
.phone .trigger-chip span { font-size: 12px; }
.phone .draft-options legend, .phone .draft-options label { font-size: 14px; }
.phone .draft-options small, .phone .activation-note { font-size: 12px; }
.phone .scheduled-rule > span, .phone .scheduled-state span { font-size: 12px; }
.phone .scheduled-rule p, .phone .scheduled-state { font-size: 14px; }
.phone .scheduled-rule button { font-size: 13px; }
.phone .empty-state p { font-size: 14px; }
.phone .empty-state button { font-size: 13px; }

/* Rule creation uses the same cards and spacing as the existing rule editor. */
.phone .builder-back {
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--soft);
  font-size: 13px;
  text-align: left;
}
.phone .builder-progress {
  display: flex;
  gap: 12px;
  padding: 0;
  margin: 8px 0 18px;
  list-style: none;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.5;
}
.phone .builder-progress li { flex: 1; padding-bottom: 10px; border-bottom: 2px solid var(--rule); white-space: nowrap; }
.phone .builder-progress li[aria-current="step"] { color: var(--gold); border-color: var(--gold); }
.phone .builder-progress strong { color: var(--gold); font-weight: 500; }
.phone .builder-choices { display: grid; gap: 10px; min-width: 0; padding: 0; border: 0; margin: 18px 0; }
.phone #new-rule-form .builder-choice { margin: 0; }
.phone .builder-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 78px;
  padding: 15px 14px;
  margin: 0;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--navy);
  color: var(--text);
  text-align: left;
  font-size: 14px;
  line-height: 1.5;
}
.phone .builder-choice > span { flex: 1; }
.phone .builder-choice strong { display: block; font-size: 14px; font-weight: 600; }
.phone .builder-choice small { display: block; color: var(--soft); margin-top: 5px; font-size: 12px; line-height: 1.5; }
.phone .builder-choice:has(input:checked),
.phone .builder-choice[aria-pressed="true"],
.phone .builder-choice[aria-selected="true"] { border-color: var(--gold); background: var(--raised); }
.phone .builder-choice input[type="radio"],
.phone .builder-choice input[type="checkbox"] { width: 18px; height: 18px; flex: none; accent-color: var(--gold); }
.phone .builder-fields { display: grid; gap: 20px; margin: 20px 0; }
.phone .builder-field { display: grid; gap: 8px; margin: 0; color: var(--text); font-size: 14px; }
.phone #new-rule-form > .builder-field + .builder-field { margin-top: 20px; }
.phone .builder-field > label { margin: 0; }
.phone .builder-field input:not([type="radio"]):not([type="checkbox"]),
.phone .builder-field select,
.phone .builder-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid #6c808b;
  border-radius: 9px;
  background: var(--navy);
  color: var(--text);
  font: 400 16px/1.5 'Plus Jakarta Sans', sans-serif;
  color-scheme: dark;
}
.phone .builder-field input::placeholder { color: #a4b5bf; }
.phone .builder-field small { font-size: 12px; line-height: 1.5; color: var(--soft); }
.phone .builder-field select:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.phone .builder-review {
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 17px 16px;
  background: var(--navy);
  margin: 18px 0;
}
.phone .builder-review h4 { font-size: 18px; line-height: 1.4; margin-bottom: 12px; }
.phone .builder-review p { font-size: 14px; line-height: 1.6; color: var(--soft); }
.phone .builder-review dl { margin: 16px 0 0; }
.phone .builder-review dl > div {
  display: grid;
  grid-template-columns: minmax(70px, .8fr) minmax(0, 1.5fr);
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
  font-size: 14px;
}
.phone .builder-review dt { color: var(--soft); }
.phone .builder-review dd { margin: 0; overflow-wrap: anywhere; }
.phone .builder-context { margin: 18px 0; padding-top: 14px; border-top: 1px solid var(--rule); color: var(--soft); font-size: 12px; line-height: 1.6; }
.phone .builder-context strong { display: block; margin-bottom: 5px; color: var(--gold); font-size: 12px; font-weight: 500; }
.phone .builder-context p { color: var(--text); font-size: 14px; line-height: 1.5; }
.phone .builder-review .builder-context { margin-bottom: 0; font-size: 12px; }
.phone .builder-help { margin: 0 0 18px; color: var(--soft); font-size: 12px; line-height: 1.6; }
.phone .builder-actions { display: grid; gap: 9px; margin-top: 22px; }
.phone .builder-actions button {
  min-height: 46px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gold);
  border-radius: 9px;
  background: var(--gold);
  color: var(--deep);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  margin: 0;
}
.phone .builder-actions .quiet,
.phone .builder-actions button + button {
  background: transparent;
  border-color: var(--rule);
  color: var(--soft);
  font-weight: 500;
}
.phone .builder-error { margin: 12px 0 0; color: #ffb5a7; font-size: 13px; line-height: 1.5; }
.phone .manual-rule { margin-top: 12px; padding: 17px 15px; border: 1px solid var(--rule); border-radius: 14px; background: var(--navy); }
.phone .manual-rule h4 { font-size: 16px; margin: 8px 0; }
.phone .manual-rule > span { color: var(--gold); font-size: 12px; }
.phone .manual-rule p { color: var(--soft); font-size: 14px; line-height: 1.6; }
.phone .manual-rule button { min-height: 44px; padding: 9px 0; color: var(--gold); background: transparent; border: 0; font-size: 13px; }
.phone .cp-primary:disabled { opacity: .45; cursor: default; }

body[data-builder="true"] #rules-panel .before-column { display: none; }
body[data-builder="true"] #rules-panel .pair { grid-template-columns: 1fr; }
body[data-builder="true"] #rules-panel .after-column { display: block; }
body[data-builder="true"] #rules-panel .column-head { max-width: 660px; margin-inline: auto; }
body[data-builder="true"]:has(#rules-panel:not([hidden])) .compare-toggle { display: none; }

@media (max-width: 380px) {
  .phone { padding-inline: 13px; }
  .phone .bottomnav { margin-inline: -13px; padding-inline: 9px; }
  .phone #new-rule { padding-inline: 10px; }
  .phone .app-title { gap: 8px; }
  .phone .event-row { padding-inline: 10px; }
}
