* { box-sizing: border-box; }
:root {
  --bg: #eef2ef;
  --panel: #f7f9f7;
  --panel-strong: #ffffff;
  --line: #d7dfda;
  --line-dark: #c5d0ca;
  --text: #1c2521;
  --muted: #6d7872;
  --soft: #e8eeea;
  --accent: #16986f;
  --accent-soft: #d8efe6;
  --accent-dark: #0d6e50;
  --warning: #a36d27;
  --sidebar: 190px;
  --controls: 316px;
}
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font-family: "Segoe UI", Arial, sans-serif; font-size: 12px; overflow: hidden; }
button, input { font: inherit; }
button { border: 1px solid var(--line-dark); background: var(--panel-strong); color: var(--text); cursor: pointer; }
[hidden] { display: none !important; }
button:disabled { cursor: not-allowed; opacity: .52; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(420px, 1fr) var(--controls); height: 100vh; min-width: 920px; }
.workflow-sidebar { display: flex; flex-direction: column; min-height: 0; background: #e5ebe7; border-right: 1px solid var(--line-dark); }
.brand-block { display: flex; gap: 8px; align-items: center; height: 40px; padding: 0 8px; border-bottom: 1px solid var(--line); }
.brand-mark { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 4px; background: var(--accent); color: white; font-weight: 700; }
.brand-name { font-size: 12px; font-weight: 700; line-height: 1.1; }
.brand-subtitle { color: var(--muted); font-size: 8px; white-space: nowrap; }
.workflow-list { flex: 1; overflow: auto; padding: 3px 0; }
.workflow-item { display: grid; grid-template-columns: 17px 1fr; gap: 2px; width: 100%; padding: 4px 8px 4px 5px; border: 0; border-left: 3px solid transparent; background: transparent; text-align: left; }
.workflow-item:hover { background: rgba(255,255,255,.48); }
.workflow-item.is-active { border-left-color: var(--accent); background: #cce9dd; }
.workflow-number { color: var(--muted); font-size: 11px; }
.workflow-item strong { display: block; font-size: 11px; line-height: 1.1; }
.workflow-item small { display: block; color: var(--muted); font-size: 8px; line-height: 1.15; }
.tutorial-button { display: grid; grid-template-columns: 20px 1fr 12px; gap: 4px; align-items: center; margin: 6px; padding: 7px 6px; border-color: var(--line); background: rgba(255,255,255,.35); text-align: left; }
.tutorial-button strong, .tutorial-button small { display: block; }
.tutorial-button strong { font-size: 10px; }
.tutorial-button small { color: var(--muted); font-size: 8px; }
.chevron { font-size: 18px; color: var(--muted); }
.sidebar-footer { display: flex; gap: 4px; padding: 5px; border-top: 1px solid var(--line-dark); }
.sidebar-footer button { min-width: 0; flex: 1; padding: 5px 2px; border-color: transparent; background: transparent; font-size: 9px; }
.sidebar-footer .upgrade-button { background: var(--accent); border-color: var(--accent); color: white; font-weight: 600; }
.workspace-column { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.workspace-header { display: flex; align-items: center; justify-content: space-between; min-height: 61px; padding: 0 9px; border-bottom: 1px solid var(--line); }
h1, h2, p { margin: 0; }
.workspace-header h1 { font-size: 12px; font-weight: 700; }
.workspace-header p { margin-top: 2px; color: var(--muted); font-size: 9px; }
.header-actions { display: flex; align-items: center; gap: 5px; }
.icon-button { width: 28px; height: 24px; padding: 0; }
.library-status { display: inline-flex; align-items: center; gap: 5px; max-width: 150px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.library-status i { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--warning); }
.library-status.is-ready i { background: var(--accent); }
.library-status.is-error i { background: #b64d4d; }
.preview-stage { position: relative; min-height: 0; flex: 1; margin: 24px 18px 0; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.23); overflow: hidden; }
.empty-state, .image-state, .result-state { position: absolute; inset: 0; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--muted); text-align: center; }
.image-glyph { color: #59645e; font-size: 39px; line-height: 1; }
.empty-state strong { color: #4d5952; font-size: 11px; }
.empty-state span { font-size: 9px; }
.open-image-button { margin-top: 8px; padding: 5px 18px; border-color: var(--line-dark); background: var(--panel); }
.phone-upload { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 310px; margin-top: 4px; padding: 9px; border: 1px solid #d9e3fa; border-radius: 6px; background: #f5f8ff; color: #2c5da4; }
.phone-label { color: #2759a0; font-size: 9px; }
.qr-placeholder { display: grid; place-items: center; width: 67px; height: 67px; border: 5px dotted #53627a; background: white; color: #53627a; font-weight: 700; }
.phone-status { color: var(--accent); font-size: 8px; }
.supported-formats { display: flex; gap: 5px; align-items: center; margin-top: 11px; font-size: 8px; }
.supported-formats b { padding: 1px 4px; border: 1px solid var(--line); border-radius: 2px; background: var(--panel); font-weight: 400; }
.drop-hint { max-width: 330px; margin-top: 7px; font-size: 8px; }
.image-state { display: grid; place-items: center; padding: 20px; }
.image-state img { max-width: 100%; max-height: 100%; object-fit: contain; border: 1px solid var(--line-dark); box-shadow: 0 2px 10px rgba(30,50,40,.12); }
.replace-button { position: absolute; right: 12px; top: 12px; padding: 5px 8px; }
.result-placeholder { padding: 20px; border: 1px dashed var(--line-dark); color: var(--muted); }
.workspace-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 39px; padding: 5px 8px; color: var(--muted); font-size: 9px; }
.footer-actions { display: flex; gap: 4px; }
.footer-actions button { padding: 4px 8px; font-size: 9px; }
.controls-column { min-width: 0; min-height: 0; overflow: auto; border-left: 1px solid var(--line-dark); background: #f1f5f2; }
.control-section { padding: 9px 9px 10px; border-bottom: 1px solid var(--line); }
.control-section h2 { font-size: 10px; font-weight: 700; text-transform: uppercase; }
.control-section p { margin-top: 2px; color: var(--muted); font-size: 8px; }
.control-row { display: flex; gap: 4px; margin-top: 7px; }
.control-row button { padding: 4px 9px; font-size: 9px; }
.soft-button { background: var(--accent-soft); border-color: #c0ded1; color: var(--accent-dark); }
.section-heading-row { display: flex; justify-content: space-between; }
.section-heading-row h2 { font-size: 11px; text-transform: none; }
.section-divider { height: 1px; margin: 9px 0 7px; background: var(--line); }
.library-section { min-height: 440px; }
.library-heading, .process-heading { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 9px; }
.selected-card { min-height: 16px; margin: 8px 0; color: var(--accent-dark); font-size: 9px; font-weight: 600; }
.library-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; color: var(--muted); font-size: 8px; }
.library-toolbar button { padding: 4px 8px; border-color: var(--accent); background: var(--accent); color: white; font-size: 9px; }
.library-search { width: 100%; height: 27px; padding: 4px 7px; border: 1px solid var(--line); background: white; color: var(--text); }
.library-list { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px; min-height: 238px; max-height: 320px; overflow: auto; margin-top: 7px; padding: 6px; border: 1px solid var(--line); background: rgba(255,255,255,.58); }
.library-card { padding: 4px 7px; border: 1px solid var(--line-dark); border-radius: 11px; background: var(--panel); color: var(--text); font-size: 9px; text-align: left; }
.library-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.library-card.is-selected { border-color: var(--accent); background: var(--accent); color: white; }
.library-loading, .library-empty { width: 100%; padding: 12px 5px; color: var(--muted); font-size: 9px; }
.library-help { margin-top: 5px; color: var(--muted); }
.process-section { margin-top: auto; }
.process-settings { padding: 4px 7px; border-color: #b9ded0; background: var(--accent-soft); color: var(--accent-dark); font-size: 9px; }
.cost-row { display: flex; justify-content: flex-end; gap: 9px; align-items: center; margin: 12px 0 7px; color: var(--muted); font-size: 9px; }
.credits { padding: 3px 10px; border: 1px solid #ebaaa0; border-radius: 12px; background: #ffe4de; color: #a94e40; }
.process-button { width: 100%; padding: 9px; border-color: #9bd5bd; background: #9bd9b9; color: white; font-weight: 700; }
.process-note { min-height: 13px; margin-top: 5px; text-align: center; }
@media (max-width: 1080px) { :root { --sidebar: 178px; --controls: 285px; } .app-shell { min-width: 760px; } .phone-upload { width: 250px; } }
@media (max-width: 760px) { body { overflow: auto; } .app-shell { display: flex; flex-direction: column; min-width: 0; height: auto; } .workflow-sidebar { max-height: 270px; } .workflow-list { max-height: 185px; } .workspace-column { min-height: 520px; } .controls-column { border-top: 1px solid var(--line-dark); border-left: 0; } .preview-stage { min-height: 360px; } .workspace-footer { flex-wrap: wrap; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
