/* Customer A/S page. Foundations mirror dist/design-system.css;
   compact page-title roles mirror dist/account/account.css. */
:root {
  --orange: #ff6720;
  --black: #171412;
  --ink: #2d2926;
  --muted: #57524d;
  --line: #dedbd5;
  --bg: #f8f7f4;
  --surface: #f1efea;
  --ds-accent-wash: #fff1e8;
  --ds-space-half: 2px;
  --ds-space-1: 4px;
  --ds-space-2: 8px;
  --ds-space-3: 12px;
  --ds-space-4: 16px;
  --ds-space-5: 20px;
  --ds-space-6: 24px;
  --ds-space-8: 32px;
  --ds-body-size: 16px;
  --ds-caption-size: 12px;
  --ds-label-size: 14px;
  --ds-action-size: 14px;
  --ds-card-title-size: 20px;
  --ds-feature-title-size: 32px;
  --ds-card-padding: 32px;
  --ds-page-gutter: 48px;
  --ds-leading-body: 1.5;
  --ds-leading-heading: 1.3;
  --ds-tracking-body: -.02em;
  --ds-tracking-heading: -.03em;
  --ds-radius-sm: 8px;
  --ds-radius-md: 12px;
  --ds-radius-lg: 16px;
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: 16px;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: var(--ds-body-size); font-weight: 400; line-height: var(--ds-leading-body); letter-spacing: var(--ds-tracking-body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a { touch-action: manipulation; }
[hidden] { display: none !important; }
header, main, footer { max-width: 1120px; margin: auto; padding: var(--ds-space-6) var(--ds-page-gutter); }
header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
header a { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--ds-action-size); }
.review-bar { display: flex; gap: var(--ds-space-2) var(--ds-space-4); flex-wrap: wrap; align-items: center; padding: var(--ds-space-3) var(--ds-page-gutter); background: var(--surface); color: var(--muted); font-size: var(--ds-caption-size); }
.review-bar span { margin-right: auto; }
.review-bar button, .review-bar select { border: 1px solid var(--line); border-radius: var(--ds-radius-sm); padding: var(--ds-space-2); background: var(--bg); min-height: 44px; max-width: 100%; }
.review-bar label { white-space: nowrap; }
.back { font-size: var(--ds-action-size); color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; }
.page-head { margin: var(--ds-space-4) 0 var(--ds-space-6); }
.eyebrow { font-size: var(--ds-caption-size); font-weight: 400; letter-spacing: .12em; color: var(--muted); margin: 0 0 var(--ds-space-2); }
h1, h2, h3 { color: var(--black); letter-spacing: var(--ds-tracking-heading); }
h1 { font-size: var(--ds-feature-title-size); line-height: var(--ds-leading-heading); margin: 0; font-weight: 600; }
h2 { font-size: var(--ds-card-title-size); line-height: var(--ds-leading-heading); margin: 0 0 var(--ds-space-4); font-weight: 600; }
h3 { font-size: var(--ds-body-size); line-height: var(--ds-leading-body); font-weight: 500; margin: 0 0 var(--ds-space-2); }
p { margin: 0 0 var(--ds-space-3); overflow-wrap: anywhere; }
.case-overview { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: var(--ds-space-8); align-items: start; }
.schedule-panel, .case-details, .receipt-panel { min-width: 0; }
.case-details { border-left: 1px solid var(--line); padding-left: var(--ds-space-8); }
.change-note { border-top: 1px solid var(--line); padding-top: var(--ds-space-4); margin-top: var(--ds-space-6); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--ds-radius-md); padding: var(--ds-card-padding); margin-bottom: var(--ds-space-6); min-width: 0; }
.muted { color: var(--muted); font-size: var(--ds-label-size); font-weight: 400; }
.tag { display: inline-flex; align-items: center; flex: none; font-size: var(--ds-caption-size); font-weight: 400; line-height: 18px; padding: var(--ds-space-1) var(--ds-space-2); border-radius: 9999px; color: var(--orange); background: var(--ds-accent-wash); white-space: nowrap; }
.actions { display: flex; gap: var(--ds-space-2); flex-wrap: wrap; margin-top: var(--ds-space-4); }
.button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--orange); border-radius: var(--ds-radius-sm); background: var(--orange); color: #fff; min-height: 44px; padding: var(--ds-space-3) var(--ds-space-4); font-size: var(--ds-action-size); font-weight: 400; line-height: 20px; cursor: pointer; }
.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.text-button { background: none; border: 0; padding: var(--ds-space-3) 0; min-height: 44px; color: var(--muted); font-size: var(--ds-action-size); cursor: pointer; text-decoration: underline; text-underline-offset: var(--ds-space-1); }
.button:disabled { opacity: .55; cursor: wait; }
.time-block { padding: var(--ds-space-4); background: var(--bg); border-radius: var(--ds-radius-sm); margin: 0 0 var(--ds-space-4); }
.time-block small { min-width: 0; font-size: var(--ds-caption-size); font-weight: 400; color: var(--muted); line-height: 18px; }
.time-block .appointment-time { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--ds-space-2); margin: var(--ds-space-2) 0 0; color: var(--ink); font-size: var(--ds-body-size); font-weight: 500; line-height: var(--ds-leading-body); font-variant-numeric: tabular-nums; }
.appointment-time span { white-space: nowrap; }
.fields { margin: 0; }
.fields div { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: var(--ds-space-3); margin-bottom: var(--ds-space-4); }
dt { font-size: var(--ds-label-size); color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; font-size: var(--ds-body-size); font-weight: 400; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--ds-space-6) 0; }
.notice { background: var(--ds-accent-wash); border-radius: var(--ds-radius-sm); padding: var(--ds-space-3) var(--ds-space-4); margin-bottom: var(--ds-space-6); font-size: var(--ds-label-size); }
.photo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ds-space-3); margin-top: var(--ds-space-4); }
figure { margin: 0; }
figure svg { display: block; width: 100%; aspect-ratio: 1.25; border-radius: var(--ds-radius-sm); background: var(--surface); }
figcaption { font-size: var(--ds-caption-size); color: var(--muted); margin-top: var(--ds-space-2); }
.customer-information { margin-top: var(--ds-space-6); padding-top: var(--ds-space-6); border-top: 1px solid var(--line); }
.customer-information h2 { margin-bottom: var(--ds-space-4); }
.connection { max-width: 640px; }
label { display: block; font-size: var(--ds-label-size); margin: var(--ds-space-3) 0 var(--ds-space-2); }
input, textarea { width: 100%; max-width: 100%; border: 1px solid #c9c4bb; border-radius: var(--ds-radius-sm); padding: var(--ds-space-3); font-size: 16px; font-weight: 400; color: var(--ink); background: white; }
textarea { resize: vertical; }
dialog { border: 0; border-radius: var(--ds-radius-lg); padding: var(--ds-space-6); width: min(520px, calc(100vw - 32px)); max-height: 85vh; overflow: auto; color: var(--ink); }
dialog::backdrop { background: rgb(23 20 18 / 40%); }
.dialog-head { display: flex; gap: var(--ds-space-4); justify-content: space-between; align-items: center; margin-bottom: var(--ds-space-4); }
.dialog-head button { border: 0; background: transparent; font-size: 24px; min-width: 44px; min-height: 44px; cursor: pointer; }
.dialog-head h2 { margin: 0; }
#form-error { color: #b44316; font-size: var(--ds-label-size); }
footer { font-size: var(--ds-caption-size); color: var(--muted); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: var(--ds-space-1); }
@media (min-width: 768px) and (max-width: 1023px) {
  :root { --ds-feature-title-size: 28px; --ds-page-gutter: 32px; }
}
@media (max-width: 767px) {
  :root { --ds-page-gutter: 16px; --ds-body-size: 14px; --ds-card-title-size: 18px; --ds-feature-title-size: 24px; --ds-card-padding: 24px; --ds-label-size: 12px; --ds-leading-heading: 1.333333; }
  header, main, footer { padding-block: var(--ds-space-4); }
  .review-bar span { flex-basis: 100%; }
  .review-bar label { margin: 0; }
  .review-bar select { flex: 1; min-width: 0; }
  .case-overview { grid-template-columns: 1fr; gap: 0; }
  .case-details { border-left: 0; border-top: 1px solid var(--line); padding: var(--ds-space-6) 0 0; margin-top: var(--ds-space-6); }
  .time-block { padding: var(--ds-space-3); }
  .fields div { grid-template-columns: 64px minmax(0, 1fr); }
  .actions .button { flex: 1; }
  .photo-pair { gap: var(--ds-space-2); }
  .connection { max-width: 100%; }
}
@media (max-width: 359px) {
  .actions { flex-direction: column; }
  .actions .button { width: 100%; flex: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: show .15s ease-out; }
  @keyframes show { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
}

.case-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-4); margin-bottom: var(--ds-space-4); }
.case-card-head h2 { margin: 0; }
.card-actions { justify-content: flex-end; margin-top: var(--ds-space-6); }
.customer-notice { margin-top: var(--ds-space-4); }
.customer-notice h3 { font-size: var(--ds-label-size); font-weight: 500; margin-bottom: var(--ds-space-2); }
.customer-notice p { margin: 0; color: var(--muted); font-size: var(--ds-body-size); font-weight: 400; }

.live-page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:var(--ds-space-4); flex-wrap:wrap; }
.pagination { display:flex; justify-content:space-between; gap:var(--ds-space-4); }
.schedule-empty { margin:var(--ds-space-2) 0 0; }
.intake-photos { margin-top:var(--ds-space-6); }
.photos { display:grid; grid-template-columns:repeat(auto-fill,minmax(104px,1fr)); gap:var(--ds-space-3); }
.photos img { display:block; width:100%; aspect-ratio:1; object-fit:contain; border:1px solid var(--line); border-radius:var(--ds-radius-sm); color:var(--muted); font-size:var(--ds-caption-size); }
.photo-error { padding:var(--ds-space-2); }
.visit-result + .visit-result { margin-top:var(--ds-space-6); padding-top:var(--ds-space-6); border-top:1px solid var(--line); }
@media(max-width:767px) { .live-page-head{align-items:flex-start;} .photos{grid-template-columns:repeat(auto-fill,minmax(88px,1fr));} }

/* Receipt cards put the status beside the receipt date, above date and time. */
.list-heading { margin-bottom: var(--ds-space-4); }
.case-list { display: grid; gap: var(--ds-space-4); }
.case-list .case { display: block; margin: 0; transition: border-color .15s; }
.case-summary { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ds-space-3); margin: 0; }
.case-summary > div { min-width: 0; }
.case-summary dt { font-size: var(--ds-caption-size); font-weight: 400; margin-bottom: var(--ds-space-2); }
.case-summary dd { font-size: var(--ds-label-size); font-weight: 500; line-height: 1.5; font-variant-numeric: tabular-nums; }
.case-summary .case-status { color: var(--orange); }
.case-created-at { margin: 0 0 var(--ds-space-4); color: var(--muted); font-size: var(--ds-caption-size); font-weight: 400; }
@media (hover:hover) { .case-list .case:hover { border-color: var(--orange); } }
@media (max-width:767px) {
 .case-list .case { padding: var(--ds-space-4); }
 .case-summary { gap: var(--ds-space-2); }
}
@media (prefers-reduced-motion:reduce) { .case-list .case { transition: none; } }

/* Standalone A/S registration follows the existing spacing and type scale. */
.as-registration { max-width: 720px; }
.registration-policy { margin-block: var(--ds-space-6); }
.registration-check { display: flex; align-items: flex-start; gap: var(--ds-space-3); margin: 0; min-height: 44px; cursor: pointer; }
.registration-check input { flex: 0 0 20px; width: 20px; height: 20px; margin: 0; padding: 0; accent-color: var(--orange); }
.registration-check span { min-width: 0; }
.registration-status { margin: var(--ds-space-4) 0 0; color: var(--muted); font-size: var(--ds-label-size); }
.as-registration .text-button:disabled { opacity: .55; cursor: wait; }

/* Case-scoped ownership request UI: same A/S tokens, no case/photo links. */
.ownership-form{margin-top:var(--ds-space-6)}
.ownership-help{font-size:var(--ds-caption-size);margin-top:var(--ds-space-2)}
.ownership-status{font-size:var(--ds-label-size);color:var(--muted);margin:var(--ds-space-3) 0 0;white-space:pre-wrap}
.ownership-list-head,.ownership-request-head{display:flex;align-items:center;justify-content:space-between;gap:var(--ds-space-3)}
.ownership-list-head h2,.ownership-request-head h3{margin:0}
.ownership-list-head{margin-bottom:var(--ds-space-4)}
#ownership-filter{min-height:44px;padding:var(--ds-space-2) var(--ds-space-3);border:1px solid var(--line);border-radius:var(--ds-radius-sm);color:var(--ink);background:#fff;max-width:100%;font-size:var(--ds-label-size)}
.ownership-request{padding:var(--ds-space-6) 0;border-bottom:1px solid var(--line)}
.ownership-request-head{margin-bottom:var(--ds-space-3)}
.ownership-request .fields{margin-top:var(--ds-space-4)}
.ownership-request .fields dd{font-size:var(--ds-label-size);white-space:pre-wrap;overflow-wrap:anywhere}
.ownership-code{font-weight:500;letter-spacing:.06em;font-variant-numeric:tabular-nums}
.ownership-check{display:flex;gap:var(--ds-space-3);align-items:center;min-height:44px;font-size:var(--ds-label-size);margin:var(--ds-space-6) 0 var(--ds-space-4)}
.ownership-check input{width:18px;height:18px;flex:none;padding:0;margin:0;accent-color:var(--orange)}
.ownership-privacy{background:var(--bg);padding:var(--ds-space-4);border-radius:var(--ds-radius-sm)}
.ownership-cancel-actions{justify-content:flex-end}
.ownership-request-head h3{min-width:0;overflow-wrap:anywhere}
@media(max-width:767px){.ownership-request{padding:var(--ds-space-4) 0}}

/* Follow-up actions remain within the existing A/S type and spacing tokens. */
.as-page-actions{display:flex;align-items:center;gap:var(--ds-space-2);flex-wrap:wrap}
.as-update-status{color:var(--muted);font-size:var(--ds-label-size);margin-bottom:var(--ds-space-4)}
.as-update-status:empty{display:none}
.change-summary{margin-top:var(--ds-space-4)}
.schedule-change-dialog form{margin-top:var(--ds-space-4)}
.schedule-change-dialog [data-change-status]{white-space:pre-wrap}
.schedule-change-dialog .actions{justify-content:flex-end}
.schedule-change-dialog :is(input,textarea):focus-visible{outline:0;border-color:var(--orange);box-shadow:inset 0 0 0 1px var(--orange)}

.schedule-help { margin-top:var(--ds-space-4); padding:var(--ds-space-4); background:var(--surface); border-radius:var(--ds-radius-sm); color:var(--muted); font-size:var(--ds-label-size); }
.schedule-help p { margin:0; }

.case-receipt-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:var(--ds-space-4)}
.case-receipt-row .case-created-at{margin:0;min-width:0}
.case-receipt-row .tag{margin-left:auto}
.as-page-back{gap:var(--ds-space-2);margin-bottom:var(--ds-space-2)}

/* Keep the new receipt action aligned with the page title on every screen. */
.live-page-head{align-items:center;flex-wrap:nowrap}
.live-page-head>div:first-child{min-width:0}
.live-page-head .as-page-actions{margin-left:auto;flex:0 0 auto}
.live-page-head .as-page-actions>.button{white-space:nowrap;min-height:44px}
@media(max-width:767px){.live-page-head{gap:12px;align-items:center}.live-page-head .as-page-actions>.button{padding:10px 16px}}
