:root {
  --stone: #EDEEF0; --surface: #FFFFFF; --ink: #1E2124; --ink-soft: #6B7075;
  --line: #D8DADC; --accent: #4C5FD1; --accent-soft: #E7E9FB; --success: #2F7D5C;
}

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px 10px; }
.hero { width:100%;text-align:center; }
.eyebrow { font-family: soraneu; font-size: 14px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 10px; }
.hero h1 { font-family: soraneu; font-weight: 600; font-size: 36px; margin: 0 0 8px; letter-spacing: -0.01em; }
.hero p.sub { max-width: 100%; color: var(--ink-soft); font-size: 15px; margin: 0; text-align:center; }
.hero p.sub a { color: var(--accent); }

.app-layout { display: flex; gap: 20px; align-items: flex-start; margin-top: 8px; }
@media (max-width: 940px) { .app-layout { flex-direction: column; } }

.shape-rail { width: 190px; flex-shrink: 0; background: #000; border: 0px solid var(--line); border-radius: 14px; padding: 10px; position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; }
@media (max-width: 940px) { .shape-rail { width: 100%; position: static; max-height: none; } }
.rail-category { font-family: soraneu; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); margin: 14px 0 6px 8px; }
.rail-category:first-child { margin-top: 4px; }
.rail-btn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font-family: soraneu; font-size: 13.5px; font-weight: 500; color: var(--ink-soft); background: none; border: none; border-radius: 8px; padding: 8px 10px; cursor: pointer; margin-bottom: 1px;
 }
@media (max-width: 940px) { .rail-btn { width: auto; } }
.rail-btn:hover { background: #333; color: #CCC; }
.rail-btn.active { background: var(--ink); color: #fff; }
.rail-swatch { width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0; }

.main-area { flex: 1; min-width: 0;  }
.panel { background:#000; border: 0px solid var(--line); border-radius: 14px; padding: 22px; }
.panel + .panel { margin-top: 0px; }
.panel h2 { font-family: soraneu; font-size: 24px; font-weight: 500; margin: 0 0 4px; }
.panel .panel-hint { font-size: 13px; color: var(--ink-soft); margin: 0; }
.panel-top-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }

.stage {
  position: relative; display: flex; align-items: center; justify-content: center; min-height: 320px;
  border-radius: 10px; border: 0px solid var(--line);
  /*background-image: repeating-conic-gradient(#e4e4e4 0% 25%, #fff 0% 50%); background-size: 20px 20px;*/
  background:#333;
}
#previewMount svg { width: 260px; height: 260px; }

.field-section { margin-bottom: 16px; }
.field-section:last-child { margin-bottom: 0; }
.field-section-title { font-family: soraneu; font-size: 16px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 8px; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; flex-direction:row !important; }
.field:last-child { margin-bottom: 0; }
.field label { font-size: 13px; color: var(--ink-soft); flex-shrink: 0; min-width: 96px; }
.field .readout { font-family: soraneu; font-size: 16px; color: #A5F2FC; min-width: 34px; text-align: right; }
.field input[type="range"] { flex: 1; accent-color: var(--accent); }
.field input[type="color"] { width: 32px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
.field select { flex: 1; font-family: soraneu; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px;color:#FFF; background:#000; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.preset-swatch { width: 30px; height: 30px; border-radius: 8px; border: 1px solid rgba(0,0,0,0.1); cursor: pointer; }
.preset-swatch:hover { outline: 2px solid var(--accent); outline-offset: 1px; }

.export-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.export-tab { font-family: soraneu; font-size: 12px; letter-spacing: 0.03em; text-transform: uppercase; background: none; border: none; border-bottom: 2px solid transparent; padding: 6px 4px; color: var(--ink-soft); cursor: pointer; }
.export-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.code-block { background: var(--ink); color: #E7EEF1; border-radius: 8px; padding: 16px; margin: 0 0 12px; max-height: 360px; overflow: auto; font-family: soraneu; font-size: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.export-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.css-note { font-size: 12px; color: var(--ink-soft); margin: 12px 0 0; }
.css-note code { font-family: soraneu; background: var(--stone); padding: 1px 5px; border-radius: 4px; }

.btn-action { font-family: soraneu; font-size: 13px; font-weight: 500; padding: 8px 16px; border-radius: 8px; border: 0px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; 
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;}
.btn-action:hover { transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4); }
.btn-action.copied { background: var(--success); border-color: var(--success); color: #fff; }
.btn-action.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-action.primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.lower-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; align-items: start; }
@media (max-width: 760px) { .lower-grid { grid-template-columns: 1fr; } }


.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; font-family: soraneu; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
