:root{
  --bg:#f8f4ed;
  --panel:#fffdf8;
  --panel-soft:#f3ecdf;
  --ink:#252a27;
  --muted:#6e746f;
  --line:#e5ddd1;
  --sidebar:#28352e;
  --sidebar-soft:#35463d;
  --brand:#d86e3d;
  --brand-hover:#be5930;
  --pine:#365346;
  --ok:#3f7a55;
  --warn:#c8872f;
  --bad:#b94b43;
  --shadow:0 16px 45px rgba(65,50,35,.08);
  --shadow-soft:0 5px 18px rgba(65,50,35,.05);
}

*{box-sizing:border-box}
html{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;color:var(--ink);background:var(--bg);scroll-behavior:smooth}
body{margin:0;background:var(--bg);line-height:1.55}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid rgba(216,110,61,.28);outline-offset:2px}
[hidden]{display:none!important}

.shell{display:grid;grid-template-columns:264px minmax(0,1fr);min-height:100vh}
.sidebar{position:sticky;top:0;height:100vh;padding:28px 18px 24px;background:var(--sidebar);color:#f8f2e8;overflow-y:auto}
.brand{position:relative;padding:0 12px 26px 54px;font-size:16px;font-weight:800;line-height:1.42}
.brand::before{content:"树";position:absolute;left:4px;top:1px;width:38px;height:38px;display:grid;place-items:center;border-radius:12px;background:var(--brand);color:#fff;font-size:18px;box-shadow:0 8px 18px rgba(0,0,0,.16)}
.brand small{display:block;margin-top:5px;color:#b8c5ba;font-size:11px;font-weight:500}
.nav a{display:flex;align-items:center;gap:10px;margin:5px 0;padding:11px 13px;border-radius:11px;color:#cbd5cd;font-size:14px;transition:background .18s,color .18s,transform .18s}
.nav a:hover{background:rgba(255,255,255,.07);color:#fff;transform:translateX(2px)}
.nav a.active{background:#f5eee3;color:var(--sidebar);font-weight:700;box-shadow:var(--shadow-soft)}
.nav .section{margin:24px 12px 8px;color:#91a398;font-size:10px;font-weight:700;letter-spacing:.14em;text-transform:uppercase}
.sidebar-foot{position:absolute;right:18px;bottom:22px;left:18px;padding:12px;border:1px solid rgba(255,255,255,.09);border-radius:11px;color:#9eafa4;font-size:11px}

.content{min-width:0;padding:30px 38px 52px}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:26px}
.topbar h1{margin:0;font-family:Georgia,"Songti SC",serif;font-size:28px;letter-spacing:-.02em}
.user-pill{display:inline-flex;align-items:center;padding:8px 13px;border:1px solid var(--line);border-radius:999px;background:rgba(255,253,248,.76);color:var(--muted);font-size:13px}

.hero{display:flex;align-items:center;justify-content:space-between;gap:28px;margin-bottom:20px;padding:31px 34px;border:1px solid #dfd4c4;border-radius:20px;background:linear-gradient(125deg,#fffaf1 0%,#f3e3d1 100%);box-shadow:var(--shadow);overflow:hidden}
.hero h2{margin:4px 0 8px;font-family:Georgia,"Songti SC",serif;font-size:30px;line-height:1.25}
.hero p{max-width:650px;margin:0;color:var(--muted)}
.eyebrow,.step-label{display:inline-block;color:var(--brand);font-size:11px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}
.step-label{margin-bottom:5px}

.grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:18px}
.card{min-width:0;padding:21px;border:1px solid var(--line);border-radius:16px;background:var(--panel);box-shadow:var(--shadow-soft)}
.card h2,.card h3{margin:0 0 14px}
.card h2{font-family:Georgia,"Songti SC",serif;font-size:19px}
.card h3{font-size:15px}
.span-12{grid-column:span 12}.span-8{grid-column:span 8}.span-7{grid-column:span 7}.span-6{grid-column:span 6}.span-5{grid-column:span 5}.span-4{grid-column:span 4}
.metrics-grid{margin-bottom:18px}
.metric-card{position:relative;overflow:hidden}
.metric-card::after{content:"";position:absolute;right:-22px;bottom:-30px;width:88px;height:88px;border-radius:50%;background:rgba(216,110,61,.07)}
.metric{margin:5px 0 3px;font-size:31px;font-weight:800;letter-spacing:-.03em}
.muted{color:var(--muted)}
.small{font-size:12px}
.text-link{color:var(--pine);font-weight:700}
.error-text{color:var(--bad)}

.btn{appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:10px 16px;border:1px solid transparent;border-radius:10px;background:var(--brand);color:#fff;font-size:14px;font-weight:700;cursor:pointer;transition:background .18s,transform .18s,box-shadow .18s}
.btn:hover{background:var(--brand-hover);transform:translateY(-1px);box-shadow:0 6px 14px rgba(190,89,48,.18)}
.btn.secondary{border-color:#d8d0c4;background:#f4efe7;color:#344a3e}
.btn.secondary:hover{background:#ebe4d8;box-shadow:none}
.btn.danger{border-color:#e5aaa4;background:#fff0ed;color:var(--bad)}
.btn.danger:hover{background:#f9deda;color:#92362f;box-shadow:0 6px 14px rgba(185,75,67,.12)}
.btn.success{border-color:#cce1d2;background:#edf7ef;color:var(--ok)}
.btn.sm{padding:7px 10px;border-radius:8px;font-size:12px}
.actions{display:flex;flex-wrap:wrap;align-items:center;gap:9px}

.field{margin-bottom:15px}
.field label{display:block;margin-bottom:7px;font-size:13px;font-weight:700}
.field input,.field select,.field textarea,.compact-select{width:100%;padding:10px 11px;border:1px solid #d6cdc0;border-radius:10px;background:#fffefa;color:var(--ink)}
.field input:hover,.field select:hover,.field textarea:hover{border-color:#bdad9b}
.field input:focus,.field select:focus,.field textarea:focus,.compact-select:focus{border-color:var(--brand);outline:3px solid rgba(216,110,61,.14)}
.field textarea{min-height:112px;resize:vertical}
.facts-editor{min-height:270px!important;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px;line-height:1.6}
.inline{display:flex;gap:12px}.inline>*{flex:1}
.compact-select{width:auto;min-width:92px;padding:9px 10px}
.upload-field input[type=file]{padding:14px;border-style:dashed;background:#fbf7f0}
.section-actions{margin-bottom:14px}
.custom-product-type{padding:12px;border:1px dashed #d9cabb;border-radius:11px;background:#fbf7f0}

.help-tip{position:relative;display:inline-flex;vertical-align:middle;margin-left:4px;z-index:4}
.help-trigger{width:19px;height:19px;display:inline-grid;place-items:center;padding:0;border:1px solid #cdbba8;border-radius:50%;background:#fffaf2;color:#8a6044;font-size:11px;font-weight:900;line-height:1;cursor:help}
.help-trigger:hover,.help-trigger:focus-visible{border-color:var(--brand);background:#fff2e7;color:var(--brand)}
.help-popover{position:absolute;z-index:40;left:50%;bottom:calc(100% + 10px);width:min(290px,calc(100vw - 36px));padding:11px 12px;border:1px solid #d7c7b5;border-radius:10px;background:#28352e;color:#f8f4ed;font-size:12px;font-weight:500;line-height:1.55;text-align:left;white-space:normal;box-shadow:0 12px 32px rgba(26,35,30,.22);opacity:0;visibility:hidden;pointer-events:none;transform:translate(-50%,5px);transition:opacity .16s,transform .16s,visibility .16s}
.help-popover::after{content:"";position:absolute;top:100%;left:50%;margin-left:-6px;border:6px solid transparent;border-top-color:#28352e}
.help-tip:hover .help-popover,.help-tip:focus-within .help-popover,.help-tip.is-open .help-popover{opacity:1;visibility:visible;pointer-events:auto;transform:translate(-50%,0)}

.alert{margin-bottom:18px;padding:12px 15px;border:1px solid;border-radius:11px;font-size:14px}
.alert.ok{border-color:#bcd9c5;background:#edf7ef;color:#2e6541}
.alert.error{border-color:#e9beb8;background:#fff1ef;color:#9f3932}
.alert.info{border-color:#dbcdb9;background:#fff8e9;color:#6d5634}

.section-heading{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:16px}
.section-heading h2{margin:2px 0 0}
.generation-form{padding:18px;border:1px solid #ddcfbe;border-radius:14px;background:linear-gradient(135deg,#fffaf2,#f7eee2)}
.generation-options{display:grid;grid-template-columns:minmax(180px,240px) minmax(260px,1fr);gap:16px;align-items:stretch;margin-bottom:5px}
.generation-options .field{margin:0}
.video-option{display:flex;align-items:flex-start;gap:11px;padding:13px 14px;border:1px solid #dfd2c2;border-radius:11px;background:#fffdf8}
.video-option>input{width:18px;height:18px;margin-top:2px;accent-color:var(--brand)}
.video-option>span{display:flex;flex-direction:column;gap:3px}
.video-option strong{font-size:13px}
.video-option label{cursor:pointer}
.video-option small{color:var(--muted);font-size:11px;line-height:1.5}
.regenerate-tools{margin-top:14px;padding-top:12px;border-top:1px dashed var(--line)}
.regenerate-tools summary{width:max-content;color:var(--pine);font-size:12px;font-weight:800;cursor:pointer}
.regenerate-tools .generate-actions{margin-top:12px}
.delete-project-form{display:flex;align-items:center}
.project-overview{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:18px;padding:2px 2px 0}
.project-overview h2{margin:3px 0 0;font-family:Georgia,"Songti SC",serif;font-size:25px}
.project-workflow{align-items:start}
.create-project-card{position:sticky;top:28px}
.project-list{display:grid;gap:10px}
.project-card{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:16px;border:1px solid transparent;border-radius:13px;background:#fbf8f2;transition:border .18s,background .18s,transform .18s}
.project-card:hover{border-color:#d9cabb;background:#fffdf8;transform:translateY(-1px)}
.project-card-main{min-width:0;flex:1}
.project-card-title{display:flex;align-items:center;gap:8px;margin-bottom:5px}
.project-card-title h3{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.project-progress{display:grid;grid-template-columns:minmax(120px,1fr) auto;align-items:center;gap:10px;margin-top:11px;color:var(--muted);font-size:11px}

.badge{display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;padding:4px 9px;border-radius:999px;background:#eee9e1;color:#5c625e;font-size:11px;font-weight:800}
.badge.active,.badge.completed,.badge.ready{background:#e7f3e9;color:#326c47}
.badge.failed,.badge.exhausted,.badge.disabled{background:#fdecea;color:#a43e37}
.badge.processing,.badge.generating,.badge.queued,.badge.cooldown{background:#fff1d9;color:#9a641d}
.badge.partial{background:#f8e9dc;color:#a5552e}
.badge.idle,.badge.draft{background:#eee9e1;color:#626662}

.progress{height:8px;overflow:hidden;border-radius:999px;background:#e9e2d8}
.progress i{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,var(--brand),#e69b5f);transition:width .28s ease}
.task-panel{border-color:#d9ccbb;background:linear-gradient(180deg,#fffdf8,#fbf6ee)}
.task-progress-meta{display:flex;justify-content:space-between;margin-bottom:7px;color:var(--muted);font-size:11px}
.task-progress{margin-bottom:15px}
.project-task-list{display:grid;gap:8px}
.task-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:11px;padding:11px 12px;border:1px solid #e8dfd3;border-radius:11px;background:#fffefa}
.task-main{display:flex;min-width:0;flex-direction:column}
.task-main strong{font-size:13px}
.task-main .small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.status-dot{width:9px;height:9px;border-radius:50%;background:#a8aaa7}
.status-dot.queued{background:var(--warn)}
.status-dot.processing{background:var(--brand);box-shadow:0 0 0 4px rgba(216,110,61,.13);animation:pulse 1.6s infinite}
.status-dot.completed{background:var(--ok)}
.status-dot.failed{background:var(--bad)}
.task-empty{padding:20px}
.status-warning{margin-top:12px}
@keyframes pulse{50%{box-shadow:0 0 0 7px rgba(216,110,61,0)}}

.chat-shell{display:grid;grid-template-columns:260px minmax(0,1fr);min-height:calc(100vh - 130px);overflow:hidden;border:1px solid var(--line);border-radius:16px;background:#fffefa;box-shadow:var(--shadow-soft)}
.chat-history{min-width:0;padding:16px;border-right:1px solid var(--line);background:#f5f1ea}
.chat-history>.btn{width:100%;margin-bottom:14px}
.chat-history-list{display:grid;gap:5px;max-height:calc(100vh - 220px);overflow-y:auto}
.chat-history-item{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:4px;border-radius:9px;color:var(--muted)}
.chat-history-item:hover,.chat-history-item.active{background:#fff;color:var(--ink)}
.chat-history-link{display:flex;min-width:0;flex-direction:column;gap:2px;padding:9px 4px 9px 10px;color:inherit}
.chat-history-actions{display:flex;align-items:center;padding-right:5px}
.chat-history-actions form{margin:0}
.chat-history-actions button{display:grid;width:28px;height:28px;padding:0;border:0;border-radius:7px;background:transparent;color:var(--muted);font-size:18px;font-weight:700;line-height:1;place-items:center;cursor:pointer}
.chat-history-actions button:hover{background:var(--cream);color:var(--accent)}
.chat-history-actions .chat-history-delete:hover{color:var(--danger)}
.chat-history-list span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:700}
.chat-history-list small{font-size:10px}
.chat-main{display:flex;min-width:0;min-height:calc(100vh - 130px);flex-direction:column;background:#fffefa}
.chat-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 18px;border-bottom:1px solid var(--line)}
.chat-toolbar form{display:flex;align-items:center}
.chat-messages{flex:1;min-height:300px;padding:24px clamp(16px,5vw,70px);overflow-y:auto}
.chat-empty{max-width:600px;margin:12vh auto 0;color:var(--muted);text-align:center}
.chat-empty h2{margin:0 0 8px;color:var(--ink);font-size:22px}
.chat-message{display:flex;margin:0 auto 22px;max-width:880px}
.chat-message.user{justify-content:flex-end}
.chat-bubble{min-width:0}
.user-bubble{max-width:min(620px,88%);padding:12px 14px;border-radius:14px;background:#eee9e1}
.user-bubble img{display:block;width:min(280px,100%);max-height:280px;margin-bottom:10px;border-radius:10px;object-fit:contain;background:#fff}
.user-bubble p{margin:0;white-space:pre-wrap;word-break:break-word}
.assistant-bubble{width:100%}
.chat-output-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px}
.chat-output{margin-bottom:14px;padding-bottom:14px;border-bottom:1px solid #eee7dd}
.chat-output-image{min-width:0;padding:10px;border:1px solid var(--line);border-radius:12px;background:#fff}
.chat-output-list>.chat-output-listing,.chat-output-list>.chat-output-text,.chat-output-list>.chat-output-video{grid-column:1/-1}
.chat-output:last-child{margin-bottom:0;padding-bottom:0;border-bottom:0}
.chat-result-image{display:block;width:100%;aspect-ratio:3/2;margin-bottom:10px;border-radius:10px;object-fit:contain;background:#f1ede7;cursor:zoom-in}
.chat-image-preview[hidden]{display:none}
.chat-image-preview{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.88)}
.chat-image-preview img{max-width:calc(100vw - 32px);max-height:calc(100vh - 32px);object-fit:contain}
.chat-image-preview-close{position:fixed;top:16px;right:16px;display:grid;width:48px;height:48px;padding:0;border:0;border-radius:50%;background:rgba(0,0,0,.7);color:#fff;font-size:32px;line-height:1;place-items:center;cursor:pointer}
.chat-result-video{display:block;width:min(640px,100%);margin-bottom:10px;border-radius:12px;background:#111}
.chat-purged{padding:22px;border:1px dashed #d1c7ba;border-radius:10px;color:var(--muted);text-align:center;background:#f7f4ee}
.chat-output-error{padding:14px;border:1px solid #ead0cc;border-radius:10px;background:#fff5f3;color:var(--bad)}
.chat-output-error p{margin:5px 0 10px}
.chat-output-error small{display:block;margin-top:8px;color:var(--muted)}
.chat-data-unavailable{padding:14px;border:1px dashed #d1c7ba;border-radius:10px;color:var(--muted);background:#f7f4ee}
.chat-listing{display:grid;gap:13px}
.chat-listing h3{margin:0 0 6px;color:var(--pine);font-size:13px}
.chat-listing .copybox{background:#f8f5ef}
.chat-listing details{padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#faf7f1}
.chat-listing summary{cursor:pointer;font-weight:700;color:var(--pine)}
.chat-listing-details{display:grid;gap:5px;margin-top:10px}
.chat-listing-details p{margin:0;font-size:12px;line-height:1.55}
.chat-text-answer{white-space:pre-wrap;word-break:break-word;line-height:1.75}
.chat-composer{position:sticky;bottom:0;display:grid;grid-template-columns:minmax(150px,220px) minmax(240px,1fr) auto auto;align-items:end;gap:10px;padding:14px 18px;border-top:1px solid var(--line);background:rgba(255,253,248,.97);box-shadow:0 -7px 18px rgba(65,50,35,.04)}
.etsy-chat-composer{grid-template-columns:minmax(150px,200px) minmax(120px,150px) minmax(240px,1fr) auto auto}
.general-chat-composer{grid-template-columns:minmax(150px,220px) minmax(240px,1fr) auto}
.chat-upload label{display:block;margin-bottom:5px;font-size:12px;font-weight:700}
.chat-upload input{width:100%;font-size:12px}
.chat-count label{display:block;margin-bottom:5px;font-size:12px;font-weight:700}
.chat-count select{width:100%;padding:8px;border:1px solid #d6cdc0;border-radius:9px;background:#fff}
.chat-count small{display:block;margin-top:4px;color:var(--muted);font-size:10px;line-height:1.35}
.chat-composer textarea{min-height:64px;max-height:160px;padding:10px 12px;border:1px solid #d6cdc0;border-radius:10px;resize:vertical}
.chat-video-option{display:flex;align-items:center;gap:6px;padding:10px 2px;white-space:nowrap;font-size:12px}
.chat-readonly{padding:14px 18px;border-top:1px solid var(--line);color:var(--muted);text-align:center;background:#f7f4ee}

@media(max-width:800px){
  .chat-shell{grid-template-columns:1fr}
  .chat-history{border-right:0;border-bottom:1px solid var(--line)}
  .chat-history-list{display:flex;max-height:none;overflow-x:auto}
  .chat-history-item{min-width:190px}
  .chat-main{min-height:65vh}
  .chat-composer,.etsy-chat-composer,.general-chat-composer{grid-template-columns:1fr 1fr}
  .chat-composer textarea{grid-column:1/-1;grid-row:1}
  .chat-output-list{grid-template-columns:1fr}
}

.gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px}
.compact-gallery{grid-template-columns:repeat(auto-fill,minmax(110px,1fr));margin-top:15px}
.media-card{overflow:hidden;border:1px solid var(--line);border-radius:13px;background:#fff;box-shadow:0 3px 12px rgba(65,50,35,.04)}
.media-card img,.media-card video{display:block;width:100%;aspect-ratio:1/1;object-fit:cover;background:#ece8e1}
.media-card video{aspect-ratio:16/9}
button:disabled{cursor:not-allowed;opacity:.68;transform:none!important;box-shadow:none!important}
.media-meta{padding:9px 10px;color:var(--muted);font-size:12px}
.listing-card{scroll-margin-top:18px}
.copybox{position:relative;min-height:52px;padding:13px 72px 13px 13px;border:1px solid var(--line);border-radius:10px;background:#f9f5ee;white-space:pre-wrap;word-break:break-word;font-size:13px;line-height:1.65}
.copybox button{position:absolute;top:8px;right:8px}
.etsy-start-card{border-color:#d9ccbb;background:linear-gradient(180deg,#fffdf8,#fbf6ee)}
.etsy-input-grid{display:grid;grid-template-columns:minmax(220px,320px) minmax(0,1fr);gap:24px;align-items:start}
.current-product-photo{display:block;overflow:hidden;border:1px solid var(--line);border-radius:13px;background:#fff}
.current-product-photo img{display:block;width:100%;max-height:240px;object-fit:contain;background:#f1ece4}
.current-product-photo span{display:block;padding:8px 10px;color:var(--muted);font-size:12px}
.choice-row{display:grid;grid-template-columns:minmax(120px,180px) minmax(240px,1fr);gap:14px;align-items:stretch}
.choice-row .field{margin:0}
.video-option.compact{min-height:66px;padding:10px 12px}
.cost-estimate{display:flex;flex-direction:column;gap:3px;margin:15px 0;padding:12px 14px;border:1px solid #e3d2b7;border-radius:11px;background:#fff8e9;color:#6d5634;font-size:12px}
.cost-estimate strong{font-size:14px;color:#5d4728}
.primary-confirm{min-width:190px;padding:12px 18px}
.batch-progress{scroll-margin-top:16px}
.project-results{display:grid;gap:18px}
.result-card{min-width:0}
.result-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.result-slot{position:relative}
.slot-number{padding:8px 10px;border-bottom:1px solid var(--line);color:var(--muted);font-size:12px;font-weight:800}
.slot-pending{display:flex;min-height:180px;align-items:center;justify-content:center;gap:9px;padding:20px;color:var(--muted);background:#f7f3ec;font-size:13px}
.slot-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px}
.slot-actions form{margin-left:auto}
.slot-actions .btn{min-height:40px}
.video-result{margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}
.video-result video{display:block;width:min(680px,100%);border-radius:12px;background:#111}
.listing-compact{min-width:0}
.listing-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.listing-field{min-width:0}
.listing-field-description{grid-column:1/-1}
.listing-field h3{margin-bottom:8px;color:var(--pine)}
.batch-history{padding:15px 18px;border:1px solid var(--line);border-radius:13px;background:rgba(255,253,248,.72)}
.batch-history summary{color:var(--pine);font-size:13px;font-weight:800;cursor:pointer}
.history-list{display:grid;gap:8px;margin-top:12px}
.history-list>div{display:flex;justify-content:space-between;gap:14px;padding:10px 12px;border-radius:9px;background:#f7f2ea;color:var(--muted);font-size:12px}
.provider-warning{margin:13px 0;padding:10px 12px;border:1px solid #ead2a5;border-radius:9px;background:#fff8e9;color:#765626;font-size:12px;line-height:1.55}
.route-url{display:inline-block;max-width:240px;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px}

.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:11px}
table{width:100%;border-collapse:collapse;background:#fffefa;font-size:13px}
th,td{padding:11px 10px;border-bottom:1px solid var(--line);text-align:left;white-space:nowrap}
th{background:#f5f0e8;color:var(--muted);font-size:11px;letter-spacing:.03em}
tbody tr:last-child td{border-bottom:0}
.user-account-actions{display:grid;gap:8px;min-width:290px}
.compact-password{width:110px;padding:7px;border:1px solid var(--line);border-radius:7px}
.user-delete-tools{position:relative}
.user-delete-tools>summary{cursor:pointer;color:var(--danger);font-size:12px;font-weight:700;list-style:none}
.user-delete-tools>summary::-webkit-details-marker{display:none}
.user-delete-panel{margin-top:8px;padding:10px;border:1px solid #e8b7ab;border-radius:10px;background:#fff7f4}
.user-delete-panel p{margin:0 0 8px;max-width:360px;font-size:12px;line-height:1.55;color:var(--danger)}
.user-delete-panel form{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.user-delete-panel input{width:190px;padding:7px 9px;border:1px solid var(--line);border-radius:7px;background:#fff}
.empty{padding:28px;border:1px dashed #d5cabd;border-radius:12px;color:var(--muted);text-align:center;background:rgba(255,255,255,.38)}
.tabs{display:flex;gap:4px;margin-bottom:18px;border-bottom:1px solid var(--line)}
.tabs a{padding:10px 12px;color:var(--muted);font-size:13px}.tabs a.active{border-bottom:2px solid var(--brand);color:var(--brand)}

.login-page{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 12% 12%,rgba(216,110,61,.13),transparent 30%),radial-gradient(circle at 88% 78%,rgba(54,83,70,.14),transparent 32%),var(--bg)}
.login-card{width:min(440px,100%);padding:36px;border:1px solid #dfd4c6;border-radius:22px;background:rgba(255,253,248,.94);box-shadow:var(--shadow)}
.login-logo{width:52px;height:52px;display:grid;place-items:center;margin-bottom:18px;border-radius:15px;background:linear-gradient(135deg,var(--brand),#e59358);color:#fff;font-size:20px;font-weight:900;box-shadow:0 10px 24px rgba(190,89,48,.22)}
.login-card h1{margin:0 0 7px;font-family:Georgia,"Songti SC",serif;font-size:23px;line-height:1.35}
.login-card .btn{width:100%;padding:12px}

@media(max-width:1100px){
  .shell{grid-template-columns:230px minmax(0,1fr)}
  .content{padding:26px 25px 44px}
  .hero{align-items:flex-start;flex-direction:column}
}

@media(max-width:900px){
  .shell{display:block}
  .sidebar{position:relative;height:auto;padding:15px 15px 10px}
  .brand{padding-bottom:15px}
  .sidebar-foot{display:none}
  .nav{display:flex;gap:4px;overflow-x:auto;padding-bottom:4px}
  .nav .section{display:none}
  .nav a{flex:0 0 auto;white-space:nowrap}
  .content{padding:22px 18px 40px}
  .create-project-card{position:static}
  .span-8,.span-7,.span-6,.span-5,.span-4{grid-column:span 12}
  .generation-options{grid-template-columns:1fr}
}

@media(max-width:600px){
  .content{padding:17px 13px 34px}
  .topbar{align-items:flex-start;flex-direction:column;margin-bottom:19px}
  .topbar .actions{width:100%;justify-content:space-between}
  .topbar h1{font-size:24px}
  .hero{padding:23px 20px;border-radius:16px}
  .hero h2{font-size:25px}
  .hero .actions,.hero .btn{width:100%}
  .card{padding:17px}
  .grid{gap:13px}
  .inline{display:block}
  .project-overview,.section-heading{align-items:flex-start;flex-direction:column}
  .project-overview .actions{width:100%;justify-content:space-between}
  .project-card{align-items:flex-start;flex-direction:column}
  .project-card>.badge{align-self:flex-start}
  .gallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .compact-gallery{grid-template-columns:repeat(3,minmax(0,1fr))}
  .generate-actions{align-items:stretch;flex-direction:column}
  .generate-actions form,.generate-actions .btn{width:100%}
  .generate-actions form.actions{display:grid;grid-template-columns:95px minmax(0,1fr)}
  .compact-select{width:100%}
  .copybox{padding-right:13px;padding-top:49px}
  .copybox button{left:8px;right:auto}
  .help-popover{position:fixed;right:14px;bottom:18px;left:14px;width:auto;transform:translateY(8px)}
  .help-popover::after{display:none}
  .help-tip:hover .help-popover,.help-tip:focus-within .help-popover,.help-tip.is-open .help-popover{transform:translateY(0)}
  .project-overview .delete-project-form{width:auto}
  .user-delete-panel input,.user-delete-panel .btn{width:100%}
}

@media(max-width:760px){
  .etsy-input-grid,.choice-row,.result-grid,.listing-fields{grid-template-columns:1fr}
  .listing-field-description{grid-column:auto}
  .primary-confirm{width:100%;min-height:44px}
  .slot-actions{align-items:stretch;flex-direction:column}
  .slot-actions form,.slot-actions .btn{width:100%;min-height:40px}
  .history-list>div{align-items:flex-start;flex-direction:column;gap:3px}
}

.employee-guide{display:grid;grid-template-columns:minmax(190px,240px) minmax(0,1fr);gap:18px;align-items:start}
.guide-hero{grid-column:1/-1;display:flex;align-items:flex-end;justify-content:space-between;gap:24px;padding:28px;border:1px solid #dfd4c4;border-radius:20px;background:linear-gradient(125deg,#fffaf1,#f3e3d1);box-shadow:var(--shadow)}
.guide-hero h2{margin:5px 0 8px;font-family:Georgia,"Songti SC",serif;font-size:30px;line-height:1.25}
.guide-hero p{max-width:760px;margin:0 0 8px;color:var(--muted)}
.guide-hero small{color:var(--muted)}
.guide-download-actions{flex:0 0 auto}
.guide-toc{position:sticky;top:24px;display:grid;gap:5px;padding:18px;border:1px solid var(--line);border-radius:14px;background:var(--panel);box-shadow:var(--shadow-soft)}
.guide-toc strong{margin-bottom:7px;color:var(--pine);font-size:14px}
.guide-toc a{padding:7px 9px;border-radius:8px;color:var(--muted);font-size:12px;line-height:1.45}
.guide-toc a:hover{background:var(--panel-soft);color:var(--pine)}
.guide-content{display:grid;gap:18px;min-width:0}
.guide-section{scroll-margin-top:24px;padding:24px;border:1px solid var(--line);border-radius:16px;background:var(--panel);box-shadow:var(--shadow-soft)}
.guide-section h2{margin:3px 0 8px;font-family:Georgia,"Songti SC",serif;font-size:22px}
.guide-summary{margin:0 0 18px;color:var(--muted)}
.guide-figure{margin:18px 0}
.guide-figure img{display:block;width:100%;height:auto;border:1px solid var(--line);border-radius:12px;background:#f4efe7}
.guide-figure figcaption{padding:8px 4px 0;color:var(--muted);font-size:12px;text-align:center}
.guide-steps{display:grid;gap:9px;margin:18px 0;padding-left:30px}
.guide-steps li{padding-left:4px;line-height:1.7}
.guide-steps li::marker{color:var(--brand);font-weight:800}
.guide-callout{margin:14px 0;padding:12px 14px;border-left:4px solid var(--pine);border-radius:8px;background:#eef4f0}
.guide-callout strong{font-size:13px}
.guide-callout p{margin:4px 0 0;font-size:13px;line-height:1.65}
.guide-callout.cost,.guide-callout.warning{border-left-color:var(--warn);background:#fff7e8;color:#735522}
.guide-callout.danger{border-left-color:var(--bad);background:#fff1ef;color:#913a34}
.guide-examples{display:grid;gap:12px;margin-top:18px}
.guide-examples article{padding:14px;border:1px solid var(--line);border-radius:12px;background:#faf7f1}
.guide-examples h3{margin:0 0 8px;color:var(--pine);font-size:14px}
.guide-back-top{display:block;margin-top:18px;color:var(--pine);font-size:12px;font-weight:700;text-align:right}

@media(max-width:900px){
  .employee-guide{grid-template-columns:1fr}
  .guide-toc{position:static;grid-template-columns:repeat(2,minmax(0,1fr))}
  .guide-toc strong{grid-column:1/-1}
}

@media(max-width:800px){
  .employee-guide{grid-template-columns:1fr}
  .guide-hero{align-items:flex-start;flex-direction:column;padding:20px}
  .guide-download-actions,.guide-download-actions .btn{width:100%}
  .guide-toc{position:static}
  .guide-section{padding:17px}
  .guide-figure{margin:14px 0}
}

@media(max-width:600px){
  .guide-toc{grid-template-columns:1fr}
}

@media print{
  .sidebar,.topbar,.guide-download-actions,.guide-back-top{display:none!important}
  .shell,.employee-guide{display:block}
  .content{padding:0}
  .guide-hero,.guide-section{break-inside:avoid;box-shadow:none}
  .guide-toc{position:static;margin:14px 0;box-shadow:none}
  .guide-figure img{max-width:100%;page-break-inside:avoid}
}
