:root {
  color-scheme: light;
  --ink: #151719;
  --muted: #697078;
  --line: #dfe3e8;
  --paper: #f5f7fa;
  --panel: rgba(255,255,255,.94);
  --blue: #0669ed;
  --blue-dark: #0455c6;
  --black: #101214;
  --shadow: 0 16px 50px rgba(35,46,61,.09);
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 86% 2%, #e9f3ff 0, transparent 26rem), var(--paper); color: var(--ink); font: 15px/1.48 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.topbar { min-height: 92px; display: flex; align-items: center; gap: 17px; padding: 20px clamp(22px, 5vw, 72px); background: rgba(255,255,255,.78); border-bottom: 1px solid rgba(192,200,211,.75); backdrop-filter: blur(22px); position: sticky; top: 0; z-index: 20; }
.brand-mark { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; color: white; background: linear-gradient(145deg,#292d32,#050607); font-weight: 850; letter-spacing: -.06em; box-shadow: 0 8px 19px rgba(0,0,0,.18); }
.brand-mark span { color: #75b4ff; margin-left: 2px; }
h1,h2,h3,p { margin-top: 0; }
h1 { font-size: 22px; margin-bottom: 0; letter-spacing: -.03em; }
h2 { font-size: 25px; letter-spacing: -.035em; margin-bottom: 8px; }
h3 { margin: 0; font-size: 17px; }
.eyebrow { margin: 0 0 3px; font-size: 10px; letter-spacing: .16em; font-weight: 800; color: #7b838d; }
.eyebrow.blue, .blue { color: var(--blue); }
.connection { margin-left: auto; padding: 8px 12px; border-radius: 999px; background: #eef1f4; color: #60666d; font-size: 12px; font-weight: 700; }
.connection i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #9da4ad; margin-right: 6px; }
.connection.online { background: #e9f8ef; color: #1f7741; }
.connection.online i { background: #2db364; box-shadow: 0 0 0 4px rgba(45,179,100,.12); }
main { width: min(1460px, calc(100% - 36px)); margin: 30px auto 70px; }
.panel, .auth-card { border: 1px solid rgba(208,214,222,.9); background: var(--panel); border-radius: 22px; box-shadow: var(--shadow); }
.auth-card { max-width: 850px; margin: 10vh auto; padding: clamp(26px,5vw,50px); display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: end; }
.auth-card p:last-child { color: var(--muted); margin-bottom: 0; }
.auth-card form { display: flex; align-items: end; gap: 10px; }
.auth-card label { flex: 1; }
.workspace { display: grid; grid-template-columns: minmax(520px, .95fr) minmax(500px, 1.05fr); align-items: start; gap: 24px; }
.controls, .output-column { display: grid; gap: 16px; }
.output-column { position: sticky; top: 115px; }
.panel { padding: 24px; }
.intro-panel { display: grid; grid-template-columns: 1fr auto; }
.intro-panel p:last-child { grid-column: 1 / -1; margin: 8px 0 0; color: var(--muted); }
.ticket-count { color: var(--blue); background: #eaf3ff; border-radius: 999px; padding: 6px 10px; height: fit-content; font-size: 12px; font-weight: 800; }
.section-heading { display: flex; gap: 11px; align-items: center; margin-bottom: 20px; }
.section-heading span { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--black); color: white; font-size: 11px; font-weight: 800; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-grid.three { grid-template-columns: repeat(3,1fr); }
label, legend { color: #555d66; font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; margin-top: 6px; padding: 11px 12px; background: white; color: var(--ink); border: 1px solid #cfd5dc; border-radius: 10px; outline: none; transition: border .15s, box-shadow .15s; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(6,105,237,.12); }
fieldset { border: 0; padding: 0; margin: 20px 0 0; }
legend { margin-bottom: 9px; }
legend small { margin-left: 8px; color: #969da5; font-weight: 500; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-grid label { position: relative; }
.chip-grid input { position: absolute; opacity: 0; }
.chip-grid span { display: block; padding: 7px 10px; border: 1px solid #d5dae0; border-radius: 999px; background: white; font-size: 11px; color: #5e6670; }
.chip-grid input:checked + span { background: #e8f2ff; border-color: #80b8ff; color: #075fcf; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.check-grid label { display: flex; align-items: center; padding: 10px; background: #f7f8fa; border: 1px solid #e5e8ec; border-radius: 10px; color: #33393f; }
.check-grid input { width: 16px; height: 16px; margin: 0 9px 0 0; accent-color: var(--blue); }
.advanced { margin-top: 17px; border-top: 1px solid var(--line); padding-top: 15px; }
.advanced summary { color: #4e565e; font-size: 12px; font-weight: 800; cursor: pointer; }
.advanced summary span { float: right; color: #a05c00; font-size: 9px; background: #fff1da; padding: 3px 6px; border-radius: 6px; }
.advanced .form-grid, .advanced .check-grid { margin-top: 14px; }
.advanced p { color: var(--muted); font-size: 12px; }
button { border: 0; border-radius: 10px; padding: 11px 15px; font-weight: 800; font-size: 11px; letter-spacing: .04em; }
.primary { background: var(--blue); color: white; box-shadow: 0 7px 18px rgba(6,105,237,.22); }
.primary:hover { background: var(--blue-dark); }
.secondary { background: #151719; color: white; }
.download { background: #e8f2ff; color: #075fcf; }
button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.quiet { background: transparent; border: 1px solid #d6dbe1; color: #515960; }
.inline-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 13px; }
.sticky-actions { position: sticky; bottom: 14px; display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 9px; padding: 12px; background: rgba(255,255,255,.82); border: 1px solid rgba(210,216,224,.85); border-radius: 16px; backdrop-filter: blur(18px); box-shadow: 0 12px 35px rgba(22,35,50,.15); z-index: 10; }
.output-panel { padding: 27px; overflow: hidden; background: linear-gradient(160deg,#fff 55%,#f0f6ff); }
.output-header { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.view-toggle { padding: 3px; background: #edf0f3; border-radius: 9px; white-space: nowrap; }
.view-toggle button { padding: 6px 9px; color: #737a82; background: transparent; font-size: 9px; }
.view-toggle button.active { background: white; color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.calculator-shell { width: min(390px, 90%); margin: 18px auto 4px; padding: 26px 30px 32px; border-radius: 40px 40px 22px 22px; background: linear-gradient(145deg,#fbfbfa,#dfe1e2 80%); border: 1px solid #c6c9cc; box-shadow: inset 0 2px 3px white, 0 25px 50px rgba(22,28,36,.19); }
.calculator-top { display: flex; justify-content: center; gap: 5px; margin-bottom: 12px; color: #3f454b; font-size: 12px; letter-spacing: .03em; }
.calculator-top strong { color: var(--blue); }
.screen { margin: 0; width: 100%; min-height: 284px; padding: 18px; overflow: hidden; border: 10px solid #202327; border-radius: 12px; background: #e8f2db; color: #172016; font: 16px/1.33 "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: .01em; box-shadow: inset 0 0 18px rgba(54,79,44,.18); }
.keypad { display: grid; grid-template-columns: repeat(4,1fr); gap: 9px; margin-top: 21px; }
.keypad i { height: 17px; border-radius: 5px 5px 7px 7px; background: linear-gradient(#545b62,#20252a); box-shadow: 0 3px 0 #0f1214; }
.keypad i:nth-child(-n+4) { background: linear-gradient(#f5f6f7,#c2c7cc); box-shadow: 0 3px 0 #9aa0a5; }
.keypad i:nth-child(5) { background: linear-gradient(#2489ff,#075fcf); }
.metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin-top: 24px; }
.metrics div { padding: 12px; border: 1px solid #dde3e9; background: rgba(255,255,255,.75); border-radius: 12px; }
.metrics span { display: block; color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.metrics strong { font-size: 15px; }
.warning, .privacy-warning { margin: 13px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 12px; }
.warning { background: #fff0db; color: #875007; }
.privacy-warning { background: #fff0f0; color: #a32e2e; }
.source-panel textarea { min-height: 390px; background: #121518; color: #e8f0f7; border: 0; border-radius: 14px; font: 12px/1.5 "SFMono-Regular", Menlo, Consolas, monospace; white-space: pre; tab-size: 2; }
.source-panel #editState { font-size: 10px; border-radius: 999px; padding: 5px 8px; color: #697078; background: #eef1f4; }
.source-panel #editState.edited { color: #9b5a00; background: #fff0d9; }
.source-actions { justify-content: flex-start; }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: 380px; transform: translateY(30px); opacity: 0; pointer-events: none; padding: 13px 16px; border-radius: 11px; background: #17191c; color: white; box-shadow: 0 12px 35px rgba(0,0,0,.2); transition: .2s; z-index: 50; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #a82525; }
@media (max-width: 1050px) { .workspace { grid-template-columns: 1fr; } .output-column { position: static; } }
@media (max-width: 660px) { main { width: min(100% - 20px,1460px); margin-top: 14px; } .topbar { padding: 14px; } .connection { font-size: 0; } .auth-card { grid-template-columns: 1fr; gap: 25px; } .auth-card form { display: grid; } .form-grid.two,.form-grid.three { grid-template-columns: 1fr; } .sticky-actions { grid-template-columns: 1fr; } .panel { padding: 18px; } .calculator-shell { width: 100%; padding: 20px; } }
