:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --ink: #16261e;
  --green: #1e5d3e;
  --line: #cbd6cf;
  --gold: #e5a431;
}
* { box-sizing: border-box; }
html, body { width: 100%; min-width: 320px; min-height: 100%; margin: 0; overflow: hidden; background: #dfe6e1; }
button, textarea { font: inherit; letter-spacing: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.review-app { width: 100%; height: 100dvh; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; color: var(--ink); }
.review-header { min-height: calc(44px + env(safe-area-inset-top)); display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; padding: calc(8px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); border-bottom: 1px solid #bac8bf; background: #fff; }
.review-header > strong { color: #194d34; font-size: 16px; }
.review-header > div { grid-column: 2; display: flex; align-items: center; gap: 10px; color: #506157; font-size: 11px; }
.review-header b { min-width: 44px; padding: 4px 8px; border-radius: 12px; color: #fff; background: #1e5d3e; text-align: center; }
.review-workspace { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.preview-shell { min-width: 0; min-height: 0; display: grid; justify-content: center; align-content: start; overflow: auto; background: #cfd8d2; overscroll-behavior: contain; }
.frame-sizer { position: relative; flex: none; }
#preview-frame { position: absolute; inset: 0 auto auto 0; border: 0; background: #fff; transform-origin: 0 0; }
.rating-panel { min-height: 124px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 14px max(16px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); border-top: 1px solid #b8c6bd; background: #fff; box-shadow: 0 -8px 24px rgba(26, 47, 36, .1); }
.criterion-copy { min-width: 0; }
.criterion-navigation { display: flex; align-items: center; gap: 9px; }
.criterion-copy span { color: #738279; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.criterion-nav-button { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 1px solid #b9c7be; border-radius: 5px; color: #28513d; background: #fff; cursor: pointer; font-size: 18px; font-weight: 800; line-height: 1; }
.criterion-nav-button:hover { border-color: #6e8f7c; background: #f0f5f2; }
.criterion-nav-button:focus-visible { outline: 3px solid rgba(30, 93, 62, .22); outline-offset: 2px; }
.criterion-nav-button:disabled { cursor: default; opacity: .35; }
.criterion-copy h1 { max-width: 720px; margin: 5px 0 0; color: #173d2b; font-size: 20px; line-height: 1.2; letter-spacing: 0; }
.comment-field { max-width: 720px; display: grid; gap: 4px; margin-top: 9px; }
.comment-field > span { color: #53685c; font-size: 10px; font-weight: 800; text-transform: none; }
.comment-field textarea { width: 100%; min-height: 48px; resize: vertical; padding: 8px 10px; border: 1px solid #b9c7be; border-radius: 6px; color: #172a20; background: #fbfcfb; font-size: 14px; line-height: 1.3; }
.comment-field textarea::placeholder { color: #87958c; }
.comment-field textarea:focus { border-color: #1e5d3e; outline: 3px solid rgba(30, 93, 62, .16); }
.comment-field textarea:disabled { opacity: .65; }
.rating-scale { display: flex; align-items: center; gap: 9px; }
.zero-rating, .stars button { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid #b9c6be; border-radius: 6px; color: #9a6d22; background: #fff; cursor: pointer; }
.zero-rating { color: #8d4a42; font-size: 16px; font-weight: 850; }
.stars { display: flex; gap: 4px; }
.stars button { border-color: transparent; color: #c3cbc6; font-size: 30px; line-height: 1; }
.stars button.is-filled { color: #e5a431; }
.zero-rating.is-selected { border-color: #91493f; color: #fff; background: #91493f; }
.rating-scale button:focus-visible { outline: 3px solid #1c6843; outline-offset: 2px; }
.rating-scale button:disabled { cursor: wait; }
.orientation-gate, .completion, .error-state { min-height: 0; display: grid; place-content: center; justify-items: center; padding: 30px; text-align: center; background: #f3f6f4; }
.orientation-gate p { max-width: 420px; margin: 24px 0 0; color: #244b37; font-size: 20px; font-weight: 800; line-height: 1.35; }
.phone-turn { width: 120px; height: 82px; display: grid; place-items: center; }
.phone-turn span { position: relative; width: 74px; height: 40px; border: 4px solid #1f5b3e; border-radius: 9px; transform: rotate(-8deg); }
.phone-turn span::after { content: ""; position: absolute; inset: 50% 5px auto auto; width: 4px; height: 4px; border-radius: 50%; background: #1f5b3e; transform: translateY(-50%); }
.completion span { color: #4b735f; font-size: 11px; font-weight: 850; text-transform: uppercase; }
.completion h1, .error-state h1 { max-width: 560px; margin: 8px 0 0; color: #173f2c; font-size: 30px; line-height: 1.2; }
.completion p { color: #65766c; }
.edit-ratings { min-height: 46px; margin-top: 12px; padding: 0 20px; border: 1px solid #1e5d3e; border-radius: 5px; color: #fff; background: #1e5d3e; cursor: pointer; font-weight: 800; }
.edit-ratings:hover { background: #174b32; }
.edit-ratings:focus-visible { outline: 3px solid rgba(30, 93, 62, .22); outline-offset: 3px; }
.error-state button { min-height: 46px; margin-top: 18px; padding: 0 20px; border: 0; border-radius: 5px; color: #fff; background: #1e5d3e; font-weight: 800; }

@media (max-width: 760px) and (orientation: portrait) {
  .review-header { grid-template-columns: auto 1fr; }
  .review-header > div { grid-column: 2; justify-self: end; }
  .rating-panel { min-height: 238px; grid-template-columns: 1fr; gap: 10px; }
  .criterion-copy h1 { min-height: 48px; font-size: 17px; }
  .rating-scale { justify-content: space-between; }
  .zero-rating, .stars button { width: 43px; height: 43px; }
  .stars { flex: 1; justify-content: space-between; }
}

@media (max-height: 600px) and (orientation: landscape) {
  .review-workspace { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr) 292px; }
  .preview-shell { grid-column: 1; }
  .rating-panel { grid-column: 2; min-height: 0; grid-template-columns: 1fr; align-content: center; gap: 12px; padding: 16px calc(14px + env(safe-area-inset-right)) 16px 14px; border-top: 0; border-left: 1px solid #b8c6bd; }
  .criterion-copy h1 { min-height: 48px; font-size: 16px; }
  .comment-field { margin-top: 7px; }
  .comment-field textarea { min-height: 72px; max-height: 72px; font-size: 13px; }
  .rating-scale { align-items: stretch; flex-direction: column; }
  .zero-rating { width: 100%; height: 38px; }
  .stars { justify-content: space-between; }
  .stars button { width: 40px; height: 42px; font-size: 27px; }
}
