body { font-variant-numeric: tabular-nums; }
textarea { font: inherit; color: inherit; }
a { color: inherit; }
a:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.studio { max-width: 1120px; margin: 0 auto; padding: 28px 24px 40px; }
.studio-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.studio-header h1 { margin: 0; font-size: clamp(24px, 4vw, 38px); font-weight: 800; letter-spacing: -.055em; line-height: 1.1; }
.studio-header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.studio-layout { display: grid; grid-template-columns: 204px minmax(0, 1fr); align-items: start; gap: 24px; }
.studio-sidebar { display: grid; gap: 5px; position: sticky; top: 20px; }
.studio-sidebar nav { display: grid; gap: 4px; padding: 7px; border: 1px solid var(--border); border-radius: 16px; background: var(--paper); }
.studio-sidebar nav button, .studio-link, .text-button { display: flex; min-height: 44px; align-items: center; gap: 9px; border: 1px solid transparent; border-radius: 10px; padding: 7px 10px; background: transparent; text-align: left; font-size: 14px; font-weight: 670; }
.studio-sidebar nav button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }
.studio-sidebar nav button[aria-pressed="false"]:hover, .studio-link:hover, .text-button:hover { background: var(--selected); }
.studio-link { text-decoration: none; }
.studio-sidebar svg, .studio-link svg { flex: 0 0 auto; width: 18px; height: 18px; }
.text-button { color: var(--muted); }

.stage { min-width: 0; overflow: clip; border: 1px solid var(--border); border-radius: 24px; background: var(--screen); box-shadow: var(--shadow); }
.preview-header { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--separator); background: var(--screen); }
.preview-mark { display: grid; place-items: center; flex: 0 0 auto; width: 47px; height: 47px; border-radius: 14px; background: var(--accent); color: var(--accent-text); }
.preview-mark svg { width: 26px; height: 26px; }
.preview-header strong { display: block; font-size: 21px; font-weight: 820; letter-spacing: -.035em; line-height: 1.1; }
.preview-header div > span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.screen-body { display: grid; gap: 15px; min-width: 0; padding: 18px 22px 22px; }
.screen-title h2, .home-hero h2 { margin: 0; letter-spacing: -.065em; font-size: clamp(26px, 4.5vw, 39px); line-height: .99; font-weight: 830; }
.screen-title h2:focus, .home-hero h2:focus { outline: none; }
.screen-title p { margin: 7px 0 0; color: var(--muted); font-size: 14px; line-height: 1.4; }
.screen-body h3 { margin: 0; font-size: clamp(17px, 3vw, 23px); line-height: 1.15; font-weight: 795; letter-spacing: -.032em; overflow-wrap: anywhere; }

.home-hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(225px, 31vw, 310px);
  overflow: hidden;
  display: grid;
  align-items: center;
  border: 1px solid #879b40;
  border-radius: 21px;
  padding: clamp(17px, 4vw, 32px);
  background: #dbf77b;
  color: #172614;
}
.home-hero h2 { font-size: clamp(39px, 7vw, 72px); }
.home-hero p { max-width: min(55%, 320px); margin: 11px 0 18px; color: #344521; font-size: clamp(13px, 2vw, 17px); font-weight: 550; line-height: 1.32; }
.home-hero img { position: absolute; z-index: -1; width: min(48%, 340px); height: auto; right: 3%; bottom: 4%; }
.home-hero .control { flex-direction: row-reverse; }

.control {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  justify-self: start;
  gap: 7px;
  min-height: 44px;
  max-width: 100%;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  background: var(--paper);
  color: var(--text);
  font-size: 14px;
  font-weight: 720;
  text-wrap: balance;
  line-height: 1.22;
}
.control svg { width: 17px; height: 17px; flex: 0 0 auto; }
.control:hover { background: var(--selected); }
.control--primary { background: var(--green); color: var(--button-text); border-color: transparent; }
.control--primary:hover { background: var(--green-hover); }
.control--hero { background: #173525; color: #fff; border-color: #173525; }
.control--hero:hover { background: #0d291a; }
.control--accent { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.control--accent:hover { background: var(--accent-strong); }
.control--text { border-color: transparent; background: transparent; color: var(--muted); padding-left: 0; }
.control--danger { color: var(--error); border-color: var(--error); }
.control--danger:hover { background: var(--error-bg); }
.control:disabled { opacity: .58; }
.action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.content-group, .list-stack { display: grid; gap: 9px; min-width: 0; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.list-card, .sheet, .quick-card, .balance-card, .chat-preview {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  background: var(--paper);
}
.list-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; width: 100%; min-height: 66px; padding: 10px; text-align: left; }
.list-card--link:hover, .quick-card:hover { background: var(--selected); }
.list-copy { display: grid; gap: 3px; min-width: 0; }
.list-copy strong { font-size: 16px; line-height: 1.18; overflow-wrap: anywhere; }
.list-copy small, .record-list small { color: var(--muted); font-size: 12px; }
.small-icon { display: grid; place-items: center; flex: 0 0 auto; width: 35px; height: 35px; border-radius: 11px; background: var(--selected); color: var(--green); }
.small-icon svg { width: 20px; height: 20px; }
.chevron { display: flex; color: var(--muted); }
.chevron svg { width: 15px; height: 15px; }
.quick-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.quick-card { display: flex; align-items: center; gap: 8px; min-height: 65px; padding: 11px; text-align: left; }
.quick-card strong { flex: 1; min-width: 0; font-size: 14px; line-height: 1.2; }
.quick-card svg { width: 19px; height: 19px; flex: 0 0 auto; color: var(--green); }
.quick-card svg:last-child { width: 13px; height: 13px; }

.screen-nav, .segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; background: var(--paper); }
.screen-nav { position: sticky; bottom: 0; z-index: 2; padding: 6px 9px max(6px, env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.screen-nav button, .segmented button { min-width: 0; min-height: 44px; border: 1px solid transparent; border-radius: 10px; padding: 5px 6px; background: transparent; font-size: 13px; font-weight: 700; line-height: 1.15; }
.screen-nav button { display: grid; place-items: center; gap: 3px; font-size: 11px; }
.screen-nav svg { width: 18px; height: 18px; }
.screen-nav button[aria-current], .segmented button[aria-current], .segmented button[aria-pressed="true"], .segmented .control--accent { background: var(--accent); color: var(--accent-text); }
.screen-nav button:not([aria-current]):hover, .segmented button:not([aria-current], [aria-pressed="true"], .control--accent):hover { background: var(--selected); }
.segmented { padding: 3px; border: 1px solid var(--border); border-radius: 13px; }
.segmented .control { width: 100%; }

.status { display: inline-flex; align-items: center; max-width: 100%; justify-content: center; border-radius: 8px; padding: 5px 7px; color: var(--text); background: var(--header); text-align: center; font-size: 11px; line-height: 1.18; font-weight: 720; }
.status--warning { color: var(--warning); background: var(--warning-bg); }
.status--success { color: var(--success); background: var(--success-bg); }
.status--muted { color: var(--muted); }
.sheet { padding: 14px; }
.sheet > h3 { margin-bottom: 9px; }
.sheet p { margin: 7px 0; }
.sheet p:last-child { margin-bottom: 0; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
.card-top > strong { font-size: 17px; }
.card-top + .pairs { margin-top: 7px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.36; }
.notice, .form-message { padding: 8px 9px; margin: 0; border-radius: 9px; color: var(--text); background: var(--selected); font-size: 13px; line-height: 1.38; overflow-wrap: anywhere; }
.notice--warning { color: var(--warning); background: var(--warning-bg); }
.notice--error, .form-message { color: var(--error); background: var(--error-bg); }
.pairs { display: grid; gap: 0; margin: 0; }
.pairs > div { display: grid; grid-template-columns: minmax(72px, .75fr) minmax(0, 1.25fr); gap: 9px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--separator); }
.pairs > div:last-child { border-bottom: 0; padding-bottom: 0; }
.pairs dt { color: var(--muted); font-size: 13px; }
.pairs dd { margin: 0; text-align: right; font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }

.balance-card { display: flex; justify-content: space-between; align-items: center; gap: 9px; padding: 16px; color: var(--accent-text); background: var(--accent); border-color: transparent; }
.balance-card span:not(.status) { display: block; margin-bottom: 2px; font-size: 14px; }
.balance-card strong, .cash-sheet > strong { font-size: clamp(29px, 5vw, 44px); line-height: 1; letter-spacing: -.06em; font-weight: 830; }
.balance-card svg { width: 37px; height: 37px; }
.balance-facts .pairs > div:first-child { padding-top: 0; }
.empty-card { padding: 16px; border: 1px dashed var(--border); border-radius: var(--card-radius); background: var(--paper); }
.empty-card svg { width: 22px; height: 22px; margin-bottom: 5px; color: var(--green); }
.empty-card h3 { margin: 0; }
.empty-card p { margin: 6px 0; color: var(--muted); font-size: 14px; }
.record-list { display: grid; gap: 0; list-style: none; margin: 0; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--card-radius); background: var(--paper); }
.record-list li { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--separator); font-size: 14px; }
.record-list li:last-child { border: 0; }
.record-list li > strong:last-child { margin-left: auto; text-align: right; }
.record-list small { display: block; margin-top: 2px; }

.work-card { display: grid; gap: 7px; }
.work-card p { margin: 0; font-size: 14px; }
.work-card .control { justify-self: stretch; margin-top: 2px; }
.work-time { display: flex; align-items: center; gap: 8px; }
.work-time svg { width: 22px; height: 22px; flex: 0 0 auto; color: var(--green); }
.payment-note { color: var(--text); font-weight: 670; }
.payment-note--balance { color: var(--success); }
.form-grid, .split-fields { display: grid; gap: 8px; min-width: 0; }
.split-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid label { display: grid; gap: 4px; min-width: 0; font-size: 13px; font-weight: 650; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--border); border-radius: 10px; padding: 7px 8px; background: var(--paper); font-size: 16px; }
.form-grid input[type="file"] { font-size: 13px; }
.form-grid input[type="file"]::file-selector-button { margin-right: 6px; border: 0; border-radius: 6px; padding: 4px; background: var(--selected); color: var(--text); }
.form-grid .day { display: grid; gap: 0; }
.form-grid .day input { min-height: 0; padding: 0; }
details.sheet > summary, .clarify > summary { min-height: 30px; cursor: pointer; border-radius: 6px; font-weight: 700; }
.transfer-edit > summary { display: flex; align-items: center; gap: 7px; justify-content: space-between; flex-wrap: wrap; }
.transfer-edit > summary > span:first-child::before { content: '›'; margin-right: 6px; color: var(--green); }
.transfer-edit[open] > summary > span:first-child::before { content: '⌄'; }
details[open] .form-grid { margin-top: 7px; }
.clarify { margin-top: 10px; }
.file-panel summary > svg { width: 18px; height: 18px; vertical-align: middle; margin-right: 6px; }
.review-amount { background: var(--selected); color: var(--text); }
.confirm-sheet { max-width: calc(100% - 28px); border: 1px solid var(--border); border-radius: 17px; padding: 20px; background: var(--paper); color: var(--text); }
.confirm-sheet::backdrop { background: #13221770; }
.confirm-sheet h3 { margin: 0; }
.confirm-sheet p { color: var(--muted); }

.chat-preview { padding: 14px; background: var(--header); }
.chat-bubble { width: fit-content; max-width: 100%; border: 1px solid var(--border); border-radius: 4px 15px 15px 15px; padding: 11px; background: var(--paper); }
.chat-bubble strong { color: var(--green); }
.chat-bubble p { margin: 5px 0 0; line-height: 1.4; }
.chat-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.kit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.inline-link { width: fit-content; color: var(--green); }
.embed-order { height: clamp(550px, 76dvh, 780px); width: 100%; max-width: 510px; justify-self: center; }
.embed-order .app-header { display: none; }
.studio-feedback:empty { display: none; }
.studio-feedback { position: fixed; z-index: 3; inset: auto 15px max(78px, calc(env(safe-area-inset-bottom) + 62px)) auto; max-width: min(calc(100% - 30px), 340px); margin: 0; padding: 12px 14px; border-radius: 12px; color: var(--button-text); background: var(--green); box-shadow: var(--shadow); font-size: 14px; }

@media (max-width: 760px) {
  .studio { padding: 12px 10px 24px; }
  .studio-header { margin-bottom: 10px; }
  .studio-layout { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .studio-sidebar { position: static; display: flex; flex-wrap: wrap; gap: 3px; }
  .studio-sidebar nav { display: flex; flex: 1 1 100%; flex-wrap: wrap; gap: 2px; padding: 3px; }
  .studio-sidebar nav button, .studio-link, .text-button { padding: 5px 8px; font-size: 12px; }
  .studio-sidebar nav button svg { width: 14px; height: 14px; }
  .preview-header { padding: 10px 12px; }
  .preview-mark { width: 40px; height: 40px; border-radius: 12px; }
  .preview-mark svg { width: 23px; height: 23px; }
  .preview-header strong { font-size: 18px; }
  .screen-body { gap: 11px; padding: 11px; }
  .stage { border-radius: 17px; }
  .studio-feedback { inset-inline-end: 10px; }
}

@media (max-width: 470px) {
  .studio-header .control { max-width: 104px; font-size: 12px; }
  .home-hero { min-height: 227px; }
  .home-hero img { width: 55%; right: -3%; bottom: 9%; }
  .home-hero h2 { font-size: clamp(37px, 10vw, 48px); }
  .home-hero p { max-width: min(53%, 190px); }
  .home-hero .control { font-size: 13px; }
  .list-card { gap: 6px; }
  .list-card .small-icon { width: 29px; height: 29px; }
  .list-card .small-icon svg { width: 17px; height: 17px; }
  .list-copy strong { font-size: 14px; }
  .status { max-width: 105px; }
  .proof-fields { grid-template-columns: minmax(0, 1fr); }
  .kit-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 350px) {
  .studio-header h1 { max-width: 160px; }
  .control--hero { font-size: 12px; }
  .home-hero img { width: 51%; }
  .quick-card { padding: 7px; }
  .quick-card > strong { font-size: 12px; }
  .split-fields { grid-template-columns: minmax(0, 1fr); }
}
