@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --ink: #18202b;
  --muted: #7b817f;
  --line: #dedbd3;
  --paper: #f4f1ea;
  --panel: #fffdf8;
  --accent: #e05c42;
  --accent-dark: #b94431;
  --soft-accent: #f6ded6;
  --canvas: #e9e6df;
  --shadow: 0 18px 60px rgba(29, 35, 38, 0.08);
  font-family: 'Manrope', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; padding: 28px 34px 34px; }

.topbar {
  max-width: 1480px;
  margin: 0 auto 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 12px 12px 12px 3px; background: var(--ink); color: #fff;
  font-size: 19px; font-weight: 800;
}
.brand strong { display: block; font-size: 18px; letter-spacing: -.04em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font: 500 8px/1 'DM Mono', monospace; letter-spacing: .08em; }

.privacy-pill {
  display: flex; align-items: center; gap: 8px; padding: 9px 13px;
  color: #597060; background: #e6eee5; border: 1px solid #d0dfd0;
  border-radius: 999px; font-size: 11px; font-weight: 700;
}
.privacy-dot { width: 7px; height: 7px; border-radius: 50%; background: #5ca169; box-shadow: 0 0 0 4px rgba(92,161,105,.12); }

.main-grid { max-width: 1480px; min-height: calc(100vh - 115px); margin: 0 auto; display: grid; grid-template-columns: minmax(320px, 380px) 1fr; gap: 24px; }
.control-panel, .preview-panel { border: 1px solid var(--line); border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); }
.control-panel { padding: 30px; display: flex; flex-direction: column; }
.preview-panel { min-width: 0; padding: 30px; display: flex; flex-direction: column; }

.eyebrow { margin: 0 0 9px; color: var(--accent); font: 500 10px/1 'DM Mono', monospace; letter-spacing: .13em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 15px; font-size: clamp(28px, 3vw, 39px); line-height: 1.12; letter-spacing: -.07em; }
h1 em { color: var(--accent); font-style: normal; }
.intro-copy { max-width: 310px; margin-bottom: 25px; color: var(--muted); font-size: 12px; line-height: 1.75; }

.dropzone { min-height: 137px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; border: 1px dashed #c7c4bb; border-radius: 17px; background: #faf8f2; transition: .2s ease; }
.dropzone:hover, .dropzone.dragging { border-color: var(--accent); background: var(--soft-accent); transform: translateY(-1px); }
.dropzone input { display: none; }
.drop-icon { width: 29px; height: 29px; display: grid; place-items: center; margin-bottom: 3px; border: 1px solid #c9c5bb; border-radius: 50%; color: var(--accent); font-size: 22px; line-height: 1; }
.drop-title { font-size: 12px; font-weight: 800; }
.drop-hint { color: var(--muted); font-size: 10px; }

.file-summary { display: flex; align-items: center; justify-content: space-between; min-height: 43px; color: var(--muted); font-size: 11px; font-weight: 700; }
.text-button { padding: 0; border: 0; color: var(--accent); background: transparent; font-size: 11px; font-weight: 800; }
.file-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 74px; overflow: auto; }
.file-chip { max-width: 100%; display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); font-size: 10px; cursor: pointer; }
.file-chip.active { border-color: var(--accent); background: var(--soft-accent); color: var(--accent-dark); }
.file-chip span { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.settings-section { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; margin-bottom: 17px; font-size: 12px; font-weight: 800; }
.section-note { color: var(--muted); font-size: 10px; font-weight: 500; }
.field { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 800; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 13px; }
.full-field { margin-bottom: 13px; }
input[type='text'], select { width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: #fff; color: var(--ink); font-size: 12px; font-weight: 700; transition: .2s; }
input[type='text']:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(224,92,66,.12); }
.color-field { height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.color-field input { width: 23px; height: 23px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.color-field output { color: var(--ink); font: 500 10px 'DM Mono', monospace; }
.range-field { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; color: var(--muted); font-size: 10px; font-weight: 800; }
.range-field[hidden] { display: none; }
.range-field > span { display: flex; justify-content: space-between; }
.range-field output { color: var(--ink); font: 500 10px 'DM Mono', monospace; }
input[type='range'] { width: 100%; height: 4px; accent-color: var(--accent); cursor: pointer; }

.action-stack { display: grid; gap: 9px; margin-top: auto; padding-top: 26px; }
.primary-button, .secondary-button { width: 100%; min-height: 43px; border-radius: 10px; font-size: 12px; font-weight: 800; transition: .2s; }
.primary-button { display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border: 1px solid var(--accent); background: var(--accent); color: #fff; box-shadow: 0 8px 18px rgba(224,92,66,.18); }
.primary-button:hover:not(:disabled) { background: var(--accent-dark); transform: translateY(-1px); }
.button-arrow { font-size: 18px; font-weight: 400; }
.secondary-button { border: 1px solid var(--line); background: transparent; color: var(--ink); }
.secondary-button:hover:not(:disabled) { border-color: var(--ink); }
button:disabled { cursor: not-allowed; opacity: .45; box-shadow: none; }
.tip { margin: 17px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.tip span { display: inline-grid; width: 17px; height: 17px; margin-right: 4px; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); font: 600 10px 'DM Mono', monospace; }

.preview-toolbar { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.preview-toolbar h2 { margin: 0; max-width: 680px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 23px; letter-spacing: -.06em; }
.dimension-badge { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font: 500 10px 'DM Mono', monospace; }
.canvas-wrap { position: relative; flex: 1; min-height: 520px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--canvas); background-image: linear-gradient(45deg, rgba(255,255,255,.32) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.32) 75%), linear-gradient(45deg, rgba(255,255,255,.32) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.32) 75%); background-position: 0 0, 9px 9px; background-size: 18px 18px; }
.canvas-wrap canvas { display: block; max-width: calc(100% - 40px); max-height: calc(100% - 40px); width: auto; height: auto; border-radius: 3px; box-shadow: 0 14px 35px rgba(26,29,34,.14); }
.empty-state { display: grid; place-items: center; padding: 30px; text-align: center; }
.empty-state[hidden] { display: none; }
.empty-orbit { width: 76px; height: 76px; display: grid; place-items: center; margin-bottom: 19px; border: 1px solid #c8c4bb; border-radius: 50%; color: var(--accent); font-size: 25px; font-weight: 800; transform: rotate(-12deg); }
.empty-orbit::before { content: ''; position: absolute; width: 101px; height: 38px; border: 1px solid #c8c4bb; border-radius: 50%; transform: rotate(42deg); }
.empty-state h3 { margin-bottom: 7px; font-size: 17px; letter-spacing: -.04em; }
.empty-state p { margin: 0; color: var(--muted); font-size: 11px; }
.preview-footer { display: flex; justify-content: space-between; padding-top: 15px; color: var(--muted); font: 500 10px 'DM Mono', monospace; }
.preview-footer > span:first-child { display: flex; align-items: center; gap: 7px; }
.status-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #c5c2bb; }
.status-dot.ready { background: #61a46b; box-shadow: 0 0 0 4px rgba(97,164,107,.12); }

@media (max-width: 920px) {
  .app-shell { padding: 18px; }
  .topbar { margin-bottom: 18px; }
  .main-grid { grid-template-columns: 1fr; }
  .control-panel { order: 1; }
  .preview-panel { order: 0; min-height: 65vh; }
  .canvas-wrap { min-height: 390px; }
}
@media (max-width: 500px) {
  .privacy-pill { display: none; }
  .control-panel, .preview-panel { padding: 20px; border-radius: 17px; }
  .preview-toolbar h2 { font-size: 19px; }
}
