:root {
    --ink: #182620;
    --deep: #102b22;
    --panel-dark: #16392d;
    --accent: #19563f;
    --mint: #e5f1e9;
    --leaf: #b9dc8a;
    --canvas: #f1f4ef;
}

body.workspace, body.access-page { background: var(--canvas); color: var(--ink); }
a { color: var(--accent); }
h2 { letter-spacing: -.025em; }
a.text-link { font-weight: 650; text-underline-offset: .22em; }
select, textarea, input { color: var(--ink); }
select, textarea { font: inherit; min-width: 0; width: 100%; border: 1px solid #a1b3a7; border-radius: .5rem; background: white; padding: .75rem; }
textarea { resize: vertical; }
label > input:not([type=checkbox]), label > select, label > textarea { display: block; width: 100%; margin-top: .35rem; }
input[type=number] { font-variant-numeric: tabular-nums; }
button:disabled { cursor: default; opacity: .46; }
h2 + p, .panel > p { color: #42554a; }
.mono, textarea[name=batch] { font-family: ui-monospace, monospace; }
.solo { margin: 0; }

.standalone-head { display: flex; align-items: end; justify-content: space-between; gap: .8rem; }
.standalone-head .text-link { white-space: nowrap; margin-bottom: .25rem; }
.wordmark { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .65rem; font-size: .94rem; font-weight: 800; letter-spacing: .1em; }
.wordmark-icon { position: relative; display: inline-block; width: 1.9rem; height: 1.9rem; flex: 0 0 1.9rem; border-radius: .52rem; background: var(--leaf); }
.wordmark-icon::after { content: ""; position: absolute; inset: .47rem; border: .13rem solid #16382b; border-radius: 50%; border-top-color: transparent; transform: rotate(-38deg); }

.access { width: min(65rem, 100% - 2rem); min-height: 34rem; margin: max(4vh, 2rem) auto; display: grid; grid-template-columns: minmax(16rem, .9fr) minmax(18rem, 1fr); padding: 0; border: 1px solid var(--line); border-radius: 1rem; overflow: hidden; background: white; }
.access-brand { display: flex; flex-direction: column; justify-content: space-between; align-items: start; gap: 2rem; padding: clamp(1.7rem, 5vw, 3rem); color: #fff; background: radial-gradient(ellipse at 80% 90%, #245545, transparent 54%), var(--deep); }
.access-identity { position: relative; }
.brand-kicker { color: var(--leaf); font-size: .85rem; font-weight: 750; }
.access-identity p { margin: .5rem 0 0; font-size: clamp(2rem, 4.5vw, 3.5rem); font-weight: 760; letter-spacing: -.07em; line-height: 1.02; }
.access-secondary { color: #e0efe4; text-decoration: none; line-height: 1.4; font-size: .88rem; }
.access-secondary:hover { color: var(--leaf); text-decoration: underline; }
.access-main { display: grid; place-items: center; padding: clamp(1.25rem, 6vw, 4rem); }
.access-main section { width: min(100%, 22rem); }
.access-main h1 { font-size: clamp(1.7rem, 3vw, 2.6rem); }
.access-main form { margin: 1.6rem 0 1rem; }
.access-mobile-link { display: none; }
.form-stack { display: grid; gap: .9rem; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 15rem minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1.85rem; padding: 1.4rem 1rem; background: var(--deep); color: #eff6f0; }
.sidebar .wordmark { margin: .1rem .35rem; }
.sidebar nav { display: grid; gap: .2rem; }
.sidebar nav a { color: #d6e6db; border-radius: .5rem; padding: .72rem .7rem; text-decoration: none; font-size: .93rem; font-weight: 560; }
.sidebar nav a:hover, .sidebar nav a[aria-current=page] { background: #24533f; color: white; }
.sidebar nav a[aria-current=page] { box-shadow: inset 3px 0 var(--leaf); }
.sidebar-foot { margin-top: auto; display: grid; gap: 1rem; padding: 0 .3rem; }
.identity { padding-top: .85rem; border-top: 1px solid #416454; display: grid; gap: .2rem; min-width: 0; overflow-wrap: anywhere; }
.identity > span { color: #c0d3c6; font-size: .8rem; }
button.sign-out { margin-top: .3rem; padding: .32rem 0; background: transparent; color: var(--leaf); font-size: .85rem; }
button.sign-out:hover { text-decoration: underline; }
.workspace-main { width: min(100%, 74rem); margin: 0 auto; padding: 2.6rem clamp(1.1rem, 4vw, 3rem) 4rem; }
.workspace-main.wide-workspace { width: min(100%, 94rem); }
.workspace-head { margin: 0 0 1.65rem; }
.workspace-head h1 { font-size: clamp(1.8rem, 4.6vw, 3.05rem); }
.section-context { margin: 0 0 .35rem; font-size: .84rem; color: var(--accent); font-weight: 700; }
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.tool-card { position: relative; padding-bottom: 2.5rem; color: inherit; text-decoration: none; min-height: 9.8rem; }
.tool-card:hover { border-color: #7da58e; background: #fbfdfb; }
.tool-card h2 { font-size: 1.22rem; }
.tool-card p { margin: .6rem 0 0; font-size: .9rem; }
.tool-card > span { color: var(--accent); position: absolute; bottom: .85rem; right: 1rem; }
.tool-panel { margin-top: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-grid .form-actions, .full-field { grid-column: 1 / -1; }
.form-bottom { margin-top: .9rem; }
.form-with-action { display: flex; align-items: end; gap: .75rem; }
.form-with-action label { flex: 1; min-width: 0; }
.tool-links { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin-top: .9rem; }
.button-secondary { display: inline-block; background: white; border: 1px solid #a4b8ab; color: var(--accent); border-radius: .5rem; padding: .64rem .85rem; text-decoration: none; font-weight: 650; font-size: .88rem; }
.button-secondary:hover { background: var(--mint); color: #103b2a; }
.builder-fields { margin: 1rem 0 0; }
label small { display: block; margin-top: .24rem; font-weight: normal; color: var(--muted); }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.copy-block { max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; background: #f4f7f4; border: 1px solid var(--line); border-radius: .55rem; padding: .8rem; line-height: 1.5; font-size: .86rem; }
.floating-status:not(:empty) { display: block; position: fixed; bottom: 1rem; right: 1rem; background: var(--deep); color: white; padding: .65rem 1rem; border-radius: .5rem; z-index: 8; }
.panel > summary { cursor: pointer; font-weight: 680; }
.messages.success { background: #e1f3e7; color: #174e33; }
.success, p.messages { padding-left: 1rem; }
.formula > p { margin: .5rem 0; }
.formula strong { font-size: 1.65rem; }
.tool-tabs { display: flex; flex-wrap: wrap; gap: .45rem; }
.tool-tabs a { padding: .5rem .75rem; background: #fff; border: 1px solid var(--line); border-radius: .45rem; text-decoration: none; font-weight: 620; font-size: .86rem; }
.tool-tabs a[aria-current=page] { background: var(--mint); border-color: #aacfba; }
.detail-list > div { display: grid; grid-template-columns: minmax(8rem, 28%) 1fr; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.account-list, .account form { margin-top: .7rem; }
.account { border-bottom: 1px solid var(--line); padding: .55rem 0; }
.account summary { cursor: pointer; gap: .6rem; list-style: none; display: flex; justify-content: space-between; align-items: center; padding: .27rem .1rem; }
.account summary::after { content: "+"; color: var(--accent); font-weight: 700; }
.account[open] summary::after { content: "−"; }
.account summary > span:first-child { flex: 1; }
.account small { display: block; color: var(--muted); }
.account-role { font-size: .88rem; }
.account form { padding-bottom: .6rem; }
.sku-preview { padding: .85rem 0; }
.sku-chip { display: inline-block; cursor: pointer; border-radius: .3rem; background: #e6f0e8; padding: .12rem .28rem; }
.sku-active { background: #c8e6d3; }
.sku-table th:first-child { width: auto; }
.label-table { margin-top: 1rem; }
.label-table input { width: 5.25rem; padding: .43rem .45rem; font-size: .82rem; }
.label-table input.label-long { width: 12rem; }
.label-article { white-space: nowrap; }
.label-article .copy { margin-inline-start: .25rem; }
.label-table thead th { white-space: nowrap; }
.custom-label { margin-top: 1.15rem; }
.custom-label summary { cursor: pointer; }
.label-previews { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: .7rem; }
.label-previews figure { margin: 0; }
.label-previews figcaption { margin-bottom: .35rem; color: var(--muted); font-weight: 650; font-size: .9rem; }
.label-preview { padding: .8rem; background: #e8eeea; border-radius: .5rem; contain: paint; }
.label-preview .sticker-container { width: 58mm; height: 40mm; box-sizing: border-box; overflow: hidden; background: #fff; }

@media (max-width: 62rem) {
    .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .app-shell { grid-template-columns: 12rem minmax(0, 1fr); }
}

@media (max-width: 43rem) {
    .access { display: block; min-height: auto; margin: 1rem auto; }
    .access-brand { min-height: 7rem; }
    .access-identity, .access-brand .access-secondary { display: none; }
    .access-mobile-link { display: block; }
    .app-shell { display: block; }
    .sidebar { position: static; height: auto; gap: .8rem; padding: .9rem; }
    .sidebar nav { display: flex; flex-wrap: wrap; gap: .3rem; }
    .sidebar nav a { padding: .48rem .55rem; font-size: .86rem; }
    .sidebar-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
    .identity { padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: .82rem; }
    .identity > span { display: none; }
    button.sign-out { margin: 0; }
    .workspace-main { padding-top: 1.4rem; }
    .tool-grid, .form-grid, .split { grid-template-columns: 1fr; }
    .tool-card { min-height: auto; }
}

@media (max-width: 31rem) {
    .standalone-head, .form-with-action { flex-direction: column; align-items: stretch; }
    .detail-list > div { grid-template-columns: 1fr; gap: .15rem; }
}
