:root {
  color-scheme: dark;
  --bg: #111014;
  --panel: #19171c;
  --panel-2: #201d23;
  --panel-3: #27232a;
  --line: #343039;
  --line-soft: #2a272e;
  --text: #eee9ed;
  --muted: #9c939d;
  --subtle: #706974;
  --accent: #c9a5a1;
  --accent-strong: #e0bdb7;
  --accent-dark: #725b5a;
  --green: #8bb9a0;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(ellipse at 82% 4%, rgba(119, 79, 83, .12), transparent 34rem),
    radial-gradient(ellipse at 0% 60%, rgba(81, 64, 86, .08), transparent 34rem),
    var(--bg);
  font-family: "DM Sans", "Noto Sans SC", sans-serif;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1480px, calc(100% - 48px)); margin: 0 auto; }
.topbar {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border: 1px solid #55474b; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; gap: 3px;
  background: linear-gradient(145deg, #33262c, #19171c);
}
.brand-mark i { width: 3px; border-radius: 4px; background: #d3b1ac; display: block; opacity: .9; }
.brand-mark i:nth-child(1) { height: 9px; opacity: .45; }
.brand-mark i:nth-child(2) { height: 17px; opacity: .7; }
.brand-mark i:nth-child(3) { height: 22px; }
.brand-mark i:nth-child(4) { height: 12px; opacity: .55; }
.brand strong { display: block; font-size: 15px; letter-spacing: .01em; font-weight: 700; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font: 9px "DM Mono", monospace; letter-spacing: .14em; }
.top-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 10px "DM Mono", monospace; letter-spacing: .12em; }
.live-dot, .status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(139,185,160,.45); }
.layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 26px; padding: 28px 0 38px; align-items: start; }
.control-panel, .preview-card {
  background: linear-gradient(155deg, rgba(32,29,35,.98), rgba(24,22,27,.98));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0,0,0,.14);
}
.control-panel { padding: 22px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; padding-bottom: 19px; border-bottom: 1px solid var(--line-soft); }
.eyebrow { color: #b89591; font: 10px "DM Mono", monospace; letter-spacing: .16em; }
.panel-title h1, .workspace-heading h2 { margin: 5px 0 0; font-size: 21px; letter-spacing: -.03em; }
.sliders-icon { color: #b99b9c; font-size: 23px; transform: rotate(90deg); }
.control-section { padding: 19px 0 18px; border-bottom: 1px solid var(--line-soft); }
.section-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.section-index { color: #9d7c7c; font: 10px "DM Mono", monospace; }
.section-heading h2 { margin: 0; font-size: 13px; font-weight: 600; }
.color-control { display: flex; gap: 12px; align-items: center; }
.color-swatch-wrap { position: relative; display: block; width: 48px; height: 42px; overflow: hidden; border-radius: 10px; border: 1px solid #51474d; cursor: pointer; }
.color-swatch-wrap input { position: absolute; inset: -10px; width: 70px; height: 70px; opacity: 0; cursor: pointer; }
.color-swatch { display: block; width: 100%; height: 100%; background: #170f10; pointer-events: none; }
.color-value { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.color-value label, .dimension-fields label span { color: var(--muted); font: 9px "DM Mono", monospace; letter-spacing: .1em; }
.text-input, .select-input {
  width: 100%; min-width: 0; color: var(--text); background: #141217;
  border: 1px solid #3c3740; border-radius: 8px; outline: none;
  padding: 9px 10px; font-size: 12px;
}
.text-input:focus, .select-input:focus { border-color: #9b7979; box-shadow: 0 0 0 3px rgba(201,165,161,.09); }
.mono { font-family: "DM Mono", monospace; letter-spacing: .04em; }
.hint { color: var(--subtle); font-size: 10px; line-height: 1.65; margin: 9px 0 0; }
.range-control { display: flex; flex-direction: column; gap: 12px; }
.range-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.range-title label, .grain-row label { font-size: 11px; color: #d8d0d7; }
.range-readout { display: flex; align-items: center; gap: 6px; font: 11px "DM Mono", monospace; }
.range-readout b { color: var(--accent-strong); font-weight: 500; }
.range-readout em { color: var(--subtle); font-style: normal; font-size: 9px; }
.dual-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.range-field { min-width: 0; }
.range-field small { display: block; color: var(--subtle); font-size: 9px; margin-bottom: 5px; }
input[type="range"] { width: 100%; accent-color: #b99592; cursor: pointer; }
.dimension-fields { display: grid; grid-template-columns: 1fr 16px 1fr; align-items: end; gap: 7px; }
.dimension-fields label { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dimension-x { color: var(--subtle); text-align: center; padding-bottom: 10px; }
.grain-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; }
.grain-row .select-input { width: 164px; }
.panel-actions { display: grid; gap: 9px; padding-top: 19px; }
.button {
  border-radius: 9px; border: 1px solid transparent; padding: 10px 12px;
  font-size: 11px; font-weight: 600; transition: .18s ease;
}
.button:disabled { opacity: .55; cursor: wait; }
.button-primary { color: #211a1d; background: linear-gradient(135deg, #d6b7b0, #b99592); box-shadow: 0 5px 18px rgba(185,149,146,.12); }
.button-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.button-secondary { color: #e0d7df; background: #2b262e; border-color: #48404a; }
.button-secondary:hover, .button-quiet:hover { background: #39313a; border-color: #75616a; }
.button-quiet { color: #b9adb9; background: transparent; border-color: #3c3540; }
.refresh-icon { font-size: 16px; vertical-align: -1px; margin-right: 5px; }
.privacy-note { color: #7e9f8c; font-size: 9px; line-height: 1.5; margin: 14px 0 0; text-align: center; }
.privacy-note span { margin-right: 4px; }
.workspace { min-width: 0; }
.workspace-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 5px 2px 19px; }
.workspace-heading h2 { font-size: 25px; }
.workspace-heading p { color: var(--muted); font-size: 11px; margin: 7px 0 0; }
.preview-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 10px "DM Mono", monospace; white-space: nowrap; padding-bottom: 4px; }
.preview-status .status-dot { background: #b99a96; box-shadow: 0 0 12px rgba(185,154,150,.35); }
.preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.preview-card { min-width: 0; padding: 15px; }
.preview-card-head { min-height: 60px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 1px 1px 13px; }
.variant-tag { color: #a88a89; font: 9px "DM Mono", monospace; letter-spacing: .15em; }
.preview-card h3 { margin: 5px 0 3px; font-size: 15px; }
.preview-card-head p { color: var(--muted); margin: 0; font-size: 10px; }
.sample-density { color: #d2b2ad; background: rgba(185,149,146,.1); border: 1px solid rgba(185,149,146,.22); border-radius: 20px; padding: 5px 8px; font: 10px "DM Mono", monospace; white-space: nowrap; }
.canvas-frame { width: 100%; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 10px; border: 1px solid #40383e; background-color: #171419; background-image: linear-gradient(45deg,#242027 25%,transparent 25%),linear-gradient(-45deg,#242027 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#242027 75%),linear-gradient(-45deg,transparent 75%,#242027 75%); background-size: 16px 16px; background-position: 0 0,0 8px,8px -8px,-8px 0; }
.canvas-frame canvas { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: auto; }
.preview-card-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 12px; }
.preview-card-foot .button { padding: 9px 5px; font-size: 10px; }
.workflow-note { display: flex; gap: 13px; margin-top: 18px; padding: 17px; border: 1px solid #4a3e45; border-radius: 13px; background: linear-gradient(110deg, rgba(74,54,62,.27), rgba(33,29,36,.48)); }
.workflow-icon { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; color: #d0a9a4; background: rgba(201,165,161,.1); border-radius: 9px; }
.workflow-note strong { font-size: 11px; }
.workflow-note p { color: var(--muted); font-size: 10px; line-height: 1.7; margin: 5px 0 0; }
.export-note { display: flex; align-items: center; gap: 9px; color: var(--subtle); font-size: 10px; margin: 13px 3px 0; }
.export-icon { color: #c19b98; font-size: 16px; }
.footer { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-top: 1px solid var(--line-soft); color: #68616c; font: 9px "DM Mono", monospace; letter-spacing: .1em; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; color: #f0e9ed; background: #302a33; border: 1px solid #62515a; border-radius: 10px; padding: 11px 15px; font-size: 11px; box-shadow: 0 12px 40px rgba(0,0,0,.35); transition: .2s ease; z-index: 20; max-width: calc(100% - 30px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 1050px) {
  .layout { grid-template-columns: 300px minmax(0,1fr); gap: 17px; }
  .control-panel { padding: 18px; }
  .preview-grid { gap: 12px; }
  .preview-card { padding: 11px; }
  .preview-card-foot { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { width: min(100% - 28px, 620px); }
  .topbar { height: 70px; }
  .top-meta { font-size: 8px; }
  .layout { display: flex; flex-direction: column; padding-top: 18px; }
  .control-panel { width: 100%; }
  .workspace { width: 100%; }
  .preview-grid { grid-template-columns: 1fr; }
  .preview-card { padding: 14px; }
  .preview-card-foot { grid-template-columns: 1fr 1fr; }
  .workspace-heading { align-items: flex-start; }
  .workspace-heading h2 { font-size: 22px; }
  .workspace-heading p { max-width: 250px; line-height: 1.5; }
  .footer { align-items: flex-start; flex-direction: column; justify-content: center; padding: 13px 0; gap: 5px; }
}
