:root {
  color-scheme: light;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #171e1b;
  background: #f4f6f3;
  --muted: #55645b;
  --line: #e3e9e3;
  --green: #156246;
  --green-hover: #104e39;
  --wash: #edf5ef;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid #23815d; outline-offset: 3px; }
button, h1, h2, p, dd, dl { margin: 0; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }

.masthead { background: #fff; border-bottom: 1px solid var(--line); }
.masthead-inner, .workspace { width: min(100% - 72px, 1416px); margin-inline: auto; }
.masthead-inner { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 1.2rem; font-weight: 750; letter-spacing: -.045em; }
.brand-studio { color: #57665c; font-weight: 500; }
.brand-mark { position: relative; display: grid; place-items: center; width: 34px; height: 34px; background: #156246; border-radius: 10px; }
.brand-mark::before, .brand-mark span { position: absolute; content: ''; width: 11px; height: 11px; border: 1.5px solid #e9ffef; transform: rotate(-16deg); border-radius: 2px; }
.brand-mark::before { translate: -3px 3px; }
.brand-mark span { translate: 3px -3px; background: #c3efca; }

.workspace { padding: 37px 0 40px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px 24px; margin-bottom: 27px; }
.page-heading h1 { font-weight: 750; font-size: clamp(1.9rem, 3.3vw, 2.75rem); letter-spacing: -.064em; line-height: 1.12; }
.page-heading p { margin-top: 8px; color: var(--muted); font-size: 1rem; line-height: 1.55; }
.page-heading .button { min-height: 44px; padding-inline: 16px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 9px; padding: 0 12px; min-height: 40px; font-size: .875rem; font-weight: 650; white-space: nowrap; transition: background .15s, border-color .15s; }
.primary { background: var(--green); color: #fff; box-shadow: 0 1px 2px #10261d18; }
.primary:hover { background: var(--green-hover); }
.ghost { color: #33443a; background: #fff; border-color: var(--line); }
.ghost:hover { background: var(--wash); border-color: #cbded0; }

.workspace-grid { display: grid; grid-template-columns: minmax(345px, .44fr) minmax(0, 1fr); align-items: stretch; gap: 22px; }
.card { min-width: 0; border: 1px solid #dfe6df; border-radius: 17px; background: #fff; box-shadow: 0 2px 4px #20312207; }
.card-heading { display: flex; align-items: center; min-height: 78px; padding: 15px 19px; gap: 12px; border-bottom: 1px solid var(--line); }
.card-heading h2 { font-size: 1.13rem; line-height: 1.3; letter-spacing: -.025em; }
.card-heading p { color: var(--muted); font-size: .875rem; line-height: 1.35; margin-top: 3px; }
.section-icon { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #deebe1; border-radius: 10px; color: var(--green); background: var(--wash); flex: none; }
.section-icon .icon { width: 20px; height: 20px; }
.data-card { display: flex; flex-direction: column; }
.field-list { display: flex; flex: 1; flex-direction: column; padding: 3px 18px 0; }
.field { display: flex; flex: 1; flex-direction: column; justify-content: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: 0; }
.field dt { color: #536258; font-size: .875rem; font-weight: 650; line-height: 1.25; }
.field dd { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.field-value { font-size: 1rem; font-weight: 640; line-height: 1.42; min-width: 0; overflow-wrap: anywhere; white-space: pre-line; }
.field-actions { display: flex; gap: 5px; flex: none; }
.field-actions .button { min-width: 34px; min-height: 32px; padding: 0 6px; gap: 4px; font-size: .875rem; border-color: transparent; }
.field-actions .icon { width: 15px; height: 15px; }
.field-actions .copy-button { color: var(--green); }
.field-note { display: flex; gap: 9px; margin: 13px 18px 18px; padding: 12px; border: 1px solid #e1ebe2; border-radius: 10px; background: #f5f8f4; color: #4e6154; font-size: .875rem; line-height: 1.45; }
.field-note .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--green); }

.preview-heading { justify-content: space-between; }
.heading-group, .preview-controls { display: flex; align-items: center; gap: 12px; }
.heading-group { min-width: 0; }
.heading-group > div { min-width: 0; }
.style-select { display: block; appearance: none; width: 100%; min-height: 25px; margin-top: 2px; padding: 1px 22px 1px 0; border: 0; border-radius: 3px; text-overflow: ellipsis; color: var(--green); font-size: .875rem; font-weight: 630; cursor: pointer; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%23156246' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 4px center; }
.theme-button { min-height: 36px; }
.devices { display: flex; padding: 3px; border-radius: 9px; background: #f0f3ef; border: 1px solid #e7ede6; }
.device { display: grid; place-items: center; width: 35px; height: 28px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #58665c; }
.device:hover { color: var(--green); }
.device[aria-pressed='true'] { background: #fff; border-color: #e2e8e2; color: var(--green); box-shadow: 0 1px 2px #25362a12; }
.viewport { padding: 16px; background: #f4f6f3; }
.browser-frame { width: 100%; margin-inline: auto; overflow: hidden; border: 1px solid #dce6dd; border-radius: 11px; background: #fff; box-shadow: 0 3px 9px #1937210a; transition: width .24s ease; }
.viewport[data-device='mobile'] .browser-frame { width: min(100%, 375px); }
.browser-bar { display: grid; grid-template-columns: 50px minmax(0, 1fr) 50px; align-items: center; gap: 4px; height: 36px; padding-inline: 12px; background: #fff; border-bottom: 1px solid #e6ece6; }
.browser-dots { display: flex; gap: 4px; }
.browser-dots i { width: 7px; height: 7px; border-radius: 50%; background: #c9d6cb; }
.browser-dots i:nth-child(2) { background: #d9e2da; }
.browser-dots i:nth-child(3) { background: #e5ebe5; }
.browser-address { display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; color: #56665b; font-size: .76rem; }
.browser-address .icon { width: 13px; height: 13px; }
.browser-address span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
iframe { display: block; border: 0; width: 100%; height: clamp(430px, 53vh, 620px); background: #fff; }
.export-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px; border-top: 1px solid var(--line); padding: 13px 16px; }
.export-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.regenerate { border-color: transparent; color: var(--green); }

dialog { width: min(450px, 100% - 32px); padding: 20px; border-radius: 17px; border: 1px solid var(--line); color: #171e1b; box-shadow: 0 12px 55px #0c241d36; }
dialog::backdrop { background: #0f211d72; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 19px; }
.dialog-heading h2 { font-size: 1.25rem; letter-spacing: -.03em; }
.icon-button { width: 36px; min-height: 36px; padding: 0; }
dialog label { display: block; color: #43584b; font-size: .9rem; font-weight: 650; margin-bottom: 7px; }
textarea { width: 100%; padding: 10px; border: 1px solid #cbd9ce; border-radius: 9px; color: inherit; line-height: 1.45; resize: vertical; }
.edit-hint { margin-top: 8px; color: var(--muted); font-size: .875rem; line-height: 1.4; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.toast { position: fixed; z-index: 1; right: 21px; bottom: 21px; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 42px); padding: 10px 14px; border-radius: 10px; color: #fff; background: #1e4938; box-shadow: 0 4px 22px #172f2239; font-size: .9rem; font-weight: 600; opacity: 0; transform: translateY(6px); transition: opacity .17s, transform .17s; pointer-events: none; }
.toast[data-visible] { opacity: 1; transform: translateY(0); }
.toast[data-error] { background: #87362b; }
.no-script { position: fixed; inset: auto 1rem 1rem; padding: 1rem; border-radius: 10px; color: #fff; background: #87362b; }

@media (max-width: 1100px) {
  .field-actions .button span { display: none; }
  .field-actions .button { min-width: 34px; }
}

@media (max-width: 850px) {
  .masthead-inner, .workspace { width: min(100% - 40px, 710px); }
  .workspace-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .field-actions .button span { display: inline; }
  .field { padding-block: 12px; }
}

@media (max-width: 520px) {
  .masthead-inner, .workspace { width: calc(100% - 26px); }
  .masthead-inner { min-height: 58px; }
  .workspace { padding-top: 24px; }
  .page-heading { flex-wrap: wrap; margin-bottom: 19px; }
  .page-heading p { margin-top: 7px; }
  .card-heading { padding-inline: 12px; min-height: 68px; }
  .field-list { padding-inline: 14px; }
  .field-note { margin-inline: 14px; }
  .heading-group, .preview-controls { gap: 6px; }
  .preview-heading .section-icon, .theme-button span { display: none; }
  .theme-button { padding-inline: 7px; }
  .viewport { padding: 8px; }
  .export-bar { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
