:root {
    color-scheme: light;
    --ink: #17211b;
    --muted: #627067;
    --paper: #f3f1e9;
    --card: #fffef9;
    --line: #d8ddd6;
    --green: #175c42;
    --green-dark: #0d422f;
    --lime: #d7ff58;
    --danger: #a82c2c;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); line-height: 1.5; }
button, input, select, textarea { font: inherit; }
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 54px 0 80px; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 32px; margin-bottom: 38px; }
.eyebrow { color: var(--green); text-transform: uppercase; font-size: .78rem; font-weight: 800; letter-spacing: .14em; }
h1 { margin: 8px 0 12px; font-size: clamp(2.4rem, 6vw, 5.4rem); line-height: .95; letter-spacing: -.055em; }
.intro { margin: 0; color: var(--muted); font-size: 1.08rem; }
.back { flex: none; color: var(--ink); text-underline-offset: 4px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.tool-card { display: flex; min-height: 230px; padding: 28px; flex-direction: column; color: var(--ink); border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 0 8px 28px rgb(20 46 32 / 5%); text-decoration: none; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.tool-card:hover { transform: translateY(-3px); border-color: #aebdb2; box-shadow: 0 14px 34px rgb(20 46 32 / 10%); }
.tool-number { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: auto; border-radius: 50%; color: var(--green-dark); background: var(--lime); font-size: .75rem; font-weight: 800; }
.tool-card h2 { margin: 28px 0 9px; font-size: 1.45rem; }
.tool-card p { margin: 0; color: var(--muted); }
.card { margin-top: 18px; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 0 8px 28px rgb(20 46 32 / 5%); }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.section-heading > div { display: flex; align-items: center; gap: 12px; }
.section-heading span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--green-dark); background: var(--lime); font-size: .75rem; font-weight: 800; }
h2 { margin: 0; font-size: 1.25rem; }
.section-heading p { margin: 0; color: var(--muted); font-size: .9rem; }
.settings-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: .82rem; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 46px; padding: 10px 12px; color: var(--ink); border: 1px solid #c9d0c9; border-radius: 9px; background: white; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgb(23 92 66 / 24%); outline-offset: 2px; border-color: var(--green); }
.column-head, .column-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(210px, 1.55fr) minmax(150px, 1fr) minmax(125px, .75fr) 44px; gap: 12px; align-items: end; }
.name-field { grid-column: 1; }
.type-field { grid-column: 2; }
.constant-field { display: none; grid-column: 3; }
.has-constant .constant-field { display: grid; }
.dirty-field { grid-column: 4; }
.column-row .remove { grid-column: 5; }
.column-head { padding: 0 0 8px; color: var(--muted); font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.column-row { padding: 12px 0; border-top: 1px solid #e7e9e4; }
.mobile-label { display: none; }
.remove { width: 44px; height: 46px; border: 1px solid #e4caca; border-radius: 9px; color: var(--danger); background: #fff8f8; font-size: 1.5rem; cursor: pointer; }
.remove:disabled { opacity: .3; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0 34px; }
.button { min-height: 44px; padding: 10px 18px; border-radius: 9px; border: 1px solid transparent; font-weight: 800; cursor: pointer; }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.primary { color: white; background: var(--green); }
.primary:hover { background: var(--green-dark); }
.secondary { color: var(--green-dark); border-color: #b9c7be; background: white; }
.ghost { color: var(--muted); background: transparent; }
.notice { padding: 18px 22px; border-radius: 12px; }
.notice ul { margin-bottom: 0; }
.error { color: #731e1e; border: 1px solid #e2baba; background: #fff1f1; }
.preview textarea { min-height: 360px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .82rem; line-height: 1.55; }
.formatter-textarea { min-height: 500px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9rem; line-height: 1.55; tab-size: 6; }
.formatter-options { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.formatter-options > strong { font-size: .9rem; }
.radio-choice { display: flex; align-items: center; gap: 8px; color: var(--ink); cursor: pointer; }
.radio-choice input { width: 18px; min-height: 18px; height: 18px; margin: 0; accent-color: var(--green); }
.copy-status { min-height: 1.5em; margin-bottom: 0; color: var(--green); }
.form-status { min-height: 1.5em; margin: -24px 0 28px; color: var(--green); font-size: .9rem; }
[hidden] { display: none !important; }
@media (max-width: 800px) {
    .shell { width: min(100% - 20px, 1180px); padding-top: 28px; }
    .hero { display: block; }
    .back { display: inline-block; margin-top: 18px; }
    .settings-grid { grid-template-columns: 1fr 1fr; }
    .column-head { display: none; }
    .column-row { grid-template-columns: 1fr 1fr 44px; align-items: end; }
    .type-field { grid-column: 1 / -1; grid-row: 1; }
    .name-field { grid-column: 1; grid-row: 2; }
    .dirty-field { grid-column: 2; grid-row: 2; }
    .constant-field { grid-column: 1 / -1; grid-row: 3; }
    .column-row .remove { grid-column: 3; grid-row: 2; }
    .mobile-label { display: block; }
}
@media (max-width: 520px) {
    .card { padding: 19px; border-radius: 13px; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .settings-grid { grid-template-columns: 1fr; }
    .column-row { grid-template-columns: 1fr 44px; }
    .type-field { grid-column: 1 / -1; grid-row: 1; }
    .name-field { grid-column: 1 / -1; grid-row: 2; }
    .dirty-field { grid-column: 1; grid-row: 3; }
    .column-row .remove { grid-column: 2; grid-row: 3; }
    .has-constant .constant-field { grid-column: 1 / -1; grid-row: 3; }
    .has-constant .dirty-field { grid-row: 4; }
    .has-constant .remove { grid-row: 4; }
    .actions .button { width: 100%; }
    .tool-card { min-height: 210px; padding: 22px; }
}
