printhive/public/styles.css
dlawler489 eaf1bd93d5 Let the required colours be edited on the model page
The slot list comes from the project file, which is sometimes wrong and
sometimes not what you intend to print. "Edit slots" turns it into fields:
material and colour per slot, with slots you can add or drop. Saved slots are
marked as yours and shown with a "your list" badge, and "Use the project's
list" throws the override away and re-reads the 3MF.

Edits have to outlive the background reader, which is the part that would fail
silently: the reader only picks up models with no status, and reread() now
skips 'edited' rather than nulling everything. Verified on a real model — the
edit survived a reread plus a full worker pass, and the revert restored the
project's own four slots exactly.

Input cleaning moved out of the route into lib/filaments.js so it can be
tested: a slot with no material is dropped, and a colour that isn't a proper
hex becomes "any colour of that material" rather than being rejected.

Not verified: none of this has been seen rendered — the local preview browser
has no session.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-17 13:15:48 +10:00

486 lines
32 KiB
CSS

/* Printhive — Workshop Dark theme */
:root {
--bg: #15171c;
--surface: #1e2128;
--surface-2: #262a32;
--surface-3: #2d323b;
--border: #2f343d;
--border-strong: #3b424d;
--text: #e7e9ee;
--text-muted: #9aa0ab;
--text-dim: #6b7280;
--accent: #f0972a;
--accent-hover: #ffab45;
--accent-soft: rgba(240, 151, 42, 0.14);
--accent-text: #1a1205;
--danger: #e35d5b;
--danger-soft: rgba(227, 93, 91, 0.14);
--success: #4cc38a;
--radius: 10px;
--radius-sm: 7px;
--mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: var(--sans);
background: var(--bg);
color: var(--text);
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { min-height: 100vh; display: flex; flex-direction: column; }
/* ---- header ---- */
header {
position: sticky;
top: 0;
z-index: 50;
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px 28px;
background: rgba(21, 23, 28, 0.85);
backdrop-filter: blur(10px);
border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.brand .logo { width: 26px; height: 26px; color: var(--accent); }
.brand .accent { color: var(--accent); }
.header-actions { display: flex; gap: 10px; }
/* ---- buttons ---- */
.btn {
font-family: inherit;
font-size: 14px;
font-weight: 500;
padding: 9px 16px;
border-radius: var(--radius-sm);
border: 1px solid transparent;
cursor: pointer;
transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
}
.btn:active { transform: scale(0.98); }
.btn-sm { font-size: 12px; padding: 6px 12px; align-self: flex-start; }
.download-all { display: inline-block; text-decoration: none; margin-bottom: 10px; }
.download-all:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: transparent; color: var(--text-muted); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
/* ---- layout ---- */
.main-content { flex: 1; display: grid; grid-template-columns: 260px 1fr; gap: 24px; padding: 24px 28px; max-width: 1500px; width: 100%; margin: 0 auto; }
.sidebar { display: flex; flex-direction: column; gap: 22px; }
.sidebar-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.sidebar-section h3 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 12px; }
.projects-list { display: flex; flex-direction: column; gap: 2px; }
.project-item {
display: flex; align-items: center; justify-content: space-between;
padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer;
color: var(--text-muted); font-size: 14px; transition: background 0.12s, color 0.12s;
}
.project-item:hover { background: var(--surface-2); color: var(--text); }
.project-item.active { background: var(--accent-soft); color: var(--accent); }
.project-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-meta { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.collection-action { opacity: 0; background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 13px; line-height: 1; padding: 2px 3px; font-family: inherit; transition: color 0.12s, opacity 0.12s; }
.project-item:hover .collection-action { opacity: 1; }
.collection-action:hover { color: var(--text); }
.collection-delete:hover { color: var(--danger); }
.project-item .count { font-family: var(--mono); font-size: 12px; background: var(--surface-3); color: var(--text-muted); padding: 1px 8px; border-radius: 10px; }
.project-item.active .count { background: var(--accent); color: var(--accent-text); }
.tags-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
font-size: 12px; padding: 4px 10px; border-radius: 12px; cursor: pointer; white-space: nowrap;
background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
transition: all 0.12s;
}
.tag:hover { border-color: var(--border-strong); color: var(--text); }
.tag.include { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.tag.exclude { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); text-decoration: line-through; }
/* ---- form fields ---- */
.search-input, input[type="text"], input[type="search"], input[type="url"], input[type="password"], input[type="number"], input[type="file"], textarea, select {
width: 100%;
font-family: inherit;
font-size: 14px;
color: var(--text);
background: var(--surface-2);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
padding: 10px 12px;
transition: border-color 0.12s, box-shadow 0.12s;
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="file"] { padding: 8px; color: var(--text-muted); }
textarea { resize: vertical; }
label { display: block; font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 7px; }
/* ---- content ---- */
.content-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.content-header h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.view-options { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; }
.view-btn { font-family: inherit; font-size: 13px; padding: 5px 14px; border: none; background: transparent; color: var(--text-muted); border-radius: 5px; cursor: pointer; }
.view-btn.active { background: var(--surface-3); color: var(--text); }
/* ---- model grid ---- */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.file-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
overflow: hidden;
cursor: pointer;
transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.file-card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.file-thumbnail {
width: 100%; height: 185px;
background: radial-gradient(circle at 50% 40%, #232730 0%, #14161a 100%);
display: flex; align-items: center; justify-content: center;
color: var(--accent); font-size: 46px;
border-bottom: 1px solid var(--border);
}
.file-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.file-info { padding: 14px 16px; }
.file-name { font-size: 15px; font-weight: 600; margin-bottom: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-badge { display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; background: var(--accent-soft); color: var(--accent); padding: 2px 8px; border-radius: 10px; margin-bottom: 8px; }
.com-badge { display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 8px; border-radius: 10px; margin: 0 0 8px 6px; }
.com-badge.ok { background: rgba(76, 195, 138, 0.16); color: var(--success); }
.com-badge.no { background: var(--danger-soft); color: var(--danger); }
.lic-badge { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 10px; margin-left: 6px; }
.lic-badge.ok { background: rgba(76, 195, 138, 0.16); color: var(--success); }
.lic-badge.no { background: var(--danger-soft); color: var(--danger); }
.lic-badge.unknown { background: var(--surface-3); color: var(--text-muted); }
.lic-note { font-size: 12px; color: var(--text-dim); margin-top: 6px; }
.file-description { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.file-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.file-tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--surface-2); color: var(--text-muted); }
.file-meta { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
/* list view */
.file-grid.list-view { grid-template-columns: 1fr; }
.file-grid.list-view .file-card { display: flex; align-items: stretch; }
.file-grid.list-view .file-thumbnail { width: 130px; height: auto; min-height: 90px; flex-shrink: 0; border-bottom: none; border-right: 1px solid var(--border); font-size: 30px; }
.file-grid.list-view .file-info { flex: 1; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 80px 20px; color: var(--text-dim); }
.empty-state h3 { font-size: 18px; color: var(--text-muted); margin-bottom: 8px; }
/* ---- modals ---- */
.modal {
display: none; position: fixed; inset: 0; z-index: 100;
background: rgba(8, 9, 12, 0.7); backdrop-filter: blur(3px);
align-items: flex-start; justify-content: center; padding: 60px 20px; overflow-y: auto;
}
.modal.active { display: flex; }
.modal-content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); width: 100%; max-width: 520px; }
.modal-content.large { max-width: 960px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 18px; font-weight: 600; }
.close-btn { background: none; border: none; color: var(--text-dim); font-size: 26px; line-height: 1; cursor: pointer; transition: color 0.12s; }
.close-btn:hover { color: var(--text); }
.modal-body { padding: 22px; }
.form-group { margin-bottom: 18px; }
.print-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.form-actions .btn { white-space: nowrap; }
/* ---- model detail ---- */
/* minmax(0, …) keeps a long file name from widening its column and crushing the viewer */
.file-detail-content { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 26px; }
.file-detail-preview { display: flex; flex-direction: column; gap: 10px; }
.model-viewer { width: 100%; height: 380px; background: radial-gradient(circle at 50% 40%, #232730 0%, #131519 100%); border: 1px solid var(--border); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; }
.model-viewer canvas { display: block; border-radius: var(--radius); }
.viewer-msg { color: var(--text-dim); font-size: 14px; padding: 20px; text-align: center; }
.viewer-fallback { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px; }
.viewer-fallback img { max-width: 100%; max-height: 320px; object-fit: contain; border-radius: var(--radius-sm); }
.viewer-fallback span { color: var(--text-dim); font-size: 12px; text-align: center; }
.viewer-image { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-pdf, .viewer-text { align-self: stretch; width: 100%; height: 100%; border: 0; border-radius: var(--radius); }
.viewer-pdf { background: #fff; }
.viewer-text { margin: 0; padding: 14px 16px; overflow: auto; font-family: var(--mono); font-size: 12px; line-height: 1.55; color: var(--text); white-space: pre-wrap; word-break: break-word; text-align: left; }
.info-section .entry-list { margin: 2px 0 8px 10px; padding-left: 12px; border-left: 1px solid var(--border); max-height: 260px; overflow-y: auto; }
.info-section .entry-head { font-size: 12px; color: var(--text-dim); margin: 6px 0 2px; }
.info-section .entry-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 3px 0; font-size: 13px; color: var(--text-muted); }
.entry-row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.entry-row em { color: var(--text-dim); font-style: normal; font-family: var(--mono); font-size: 11px; margin-left: 4px; }
.entry-row .entry-folder { color: var(--text-dim); margin-left: 4px; }
.row-actions { display: flex; gap: 12px; flex-shrink: 0; align-items: center; }
.link-btn { background: none; border: none; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.plate-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.plate-chip { display: flex; align-items: center; gap: 6px; min-height: 30px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); padding: 2px 10px 2px 3px; border-radius: var(--radius-sm); font-family: inherit; font-size: 12px; cursor: pointer; }
.plate-chip:not(:has(img)) { padding-left: 10px; }
.plate-chip img { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; background: var(--surface-3); }
.plate-chip:hover { color: var(--text); border-color: var(--border-strong); }
.plate-chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.info-section .filament-list { display: flex; flex-direction: column; gap: 6px; }
.info-section .filament { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.filament em { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.swatch { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.25); flex-shrink: 0; }
.file-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.file-tab { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); padding: 5px 11px; border-radius: var(--radius-sm); font-size: 12px; cursor: pointer; font-family: inherit; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-tab:hover { color: var(--text); }
.file-tab.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.info-section { margin-bottom: 22px; }
.info-section:last-of-type { margin-bottom: 0; }
.info-section h3 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 9px; }
.info-section p, .info-section div { color: var(--text); font-size: 14px; line-height: 1.6; }
.info-section .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.info-section .tag { cursor: default; }
.file-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text-muted); }
.file-row:last-child { border-bottom: none; }
.file-row em { color: var(--text-dim); font-style: normal; font-family: var(--mono); font-size: 12px; }
.file-row > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.file-row[draggable="true"], .entry-row[draggable="true"], .drag-out-btn { cursor: grab; }
.drag-out-btn:active { cursor: grabbing; }
/* ---- slicer hand-off ---- */
.preview-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.preview-actions .btn-sm { align-self: auto; }
.slicer-bar { display: inline-flex; align-items: center; gap: 10px; }
.slicer-change { font-size: 12px; color: var(--text-dim); }
.slicer-notice { font-size: 13px; line-height: 1.5; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.slicer-notice.is-warning { border-color: var(--accent); color: var(--text); }
.slicer-notice-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.slicer-notice-actions .btn-sm { align-self: auto; }
.slicer-intro { margin: 0 0 14px; }
.slicer-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.slicer-option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: border-color 0.12s, background 0.12s; }
.slicer-option:hover { border-color: var(--border-strong); }
.slicer-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.slicer-option input { width: auto; margin-top: 3px; accent-color: var(--accent); flex-shrink: 0; }
.slicer-option strong { display: block; font-size: 14px; font-weight: 500; color: var(--text); }
.slicer-option em { display: block; font-style: normal; font-size: 12px; color: var(--text-dim); }
.slicer-error { color: var(--danger); font-size: 13px; min-height: 1em; }
/* ---- import / settings ---- */
.import-status { margin-top: 14px; color: var(--text-muted); font-size: 14px; min-height: 20px; }
.form-hint { font-size: 12px; color: var(--text-dim); margin-top: 7px; line-height: 1.5; }
.form-hint-inline { font-size: 12px; color: var(--text-dim); font-weight: 400; }
.settings-group-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 14px; }
.setting-status.is-set { color: var(--success); font-weight: 500; }
.setting-status.is-unset { color: var(--danger); font-weight: 500; }
.btn-link { background: none; border: none; color: var(--danger); padding: 6px 0 0; font-size: 13px; cursor: pointer; font-family: inherit; }
.btn-link:hover { text-decoration: underline; }
@media (max-width: 860px) {
.main-content { grid-template-columns: 1fr; }
.file-detail-content { grid-template-columns: 1fr; }
}
/* ---- auth screen ---- */
.auth-screen {
position: fixed; inset: 0; z-index: 200;
display: flex; align-items: center; justify-content: center;
background: var(--bg); padding: 20px;
}
.auth-card {
width: 100%; max-width: 380px;
background: var(--surface); border: 1px solid var(--border);
border-radius: var(--radius); padding: 32px 28px;
}
.auth-brand { justify-content: center; font-size: 24px; margin-bottom: 24px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form h2 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.auth-form input { width: 100%; }
.auth-form .btn-primary { margin-top: 4px; }
.auth-form .btn-link { color: var(--text-muted); align-self: center; }
.auth-form .btn-link:hover { color: var(--accent); }
.auth-error { margin-top: 14px; color: var(--text-muted); font-size: 13px; text-align: center; min-height: 18px; }
/* ---- license rules ---- */
.license-rules { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.license-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.license-name { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.license-name em { color: var(--text-dim); font-style: normal; }
.license-select { width: auto; flex-shrink: 0; padding: 6px 10px; font-size: 13px; }
/* ---- tag autocomplete ---- */
.tag-suggest {
position: absolute; z-index: 130;
background: var(--surface-2); border: 1px solid var(--border-strong);
border-radius: var(--radius-sm); max-height: 200px; overflow-y: auto;
box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.tag-suggest-item { padding: 7px 11px; font-size: 13px; cursor: pointer; color: var(--text-muted); }
.tag-suggest-item:hover, .tag-suggest-item.active { background: var(--accent-soft); color: var(--accent); }
[hidden] { display: none !important; }
/* ---- sidebar tag tools ---- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.sidebar-section .section-head h3 { margin-bottom: 0; }
.tag-tools { display: flex; align-items: center; gap: 8px; }
.tag-tools .btn-link { padding: 0; font-size: 12px; color: var(--text-muted); }
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px; }
.seg button { font-family: inherit; font-size: 11px; border: none; background: transparent; color: var(--text-muted); padding: 2px 8px; border-radius: 4px; cursor: pointer; }
.seg button.active { background: var(--surface-3); color: var(--text); }
/* ---- filter bar ---- */
.content-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.result-count { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filter-bar .search-input { flex: 1 1 260px; width: auto; }
.filter-bar select { width: auto; flex: 0 0 auto; padding: 9px 10px; font-size: 13px; }
.group-header {
grid-column: 1 / -1; display: flex; align-items: baseline; gap: 8px;
font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim);
padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.group-header:not(:first-child) { margin-top: 10px; }
.group-header span { font-family: var(--mono); font-weight: 400; }
.card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.notes-status { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-dim); margin-left: 6px; }
/* ---- duplicates ---- */
.dup-list { display: flex; flex-direction: column; gap: 18px; }
.dup-pending { font-size: 13px; color: var(--text-muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 10px 14px; }
.dup-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.dup-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.dup-head h3 { font-size: 15px; font-weight: 600; }
.dup-head .form-hint { margin-top: 2px; }
.dup-head .btn-sm { flex-shrink: 0; }
.dup-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.dup-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; transition: border-color 0.15s; }
.dup-card:hover { border-color: var(--border-strong); }
.dup-card.recommended { border-color: var(--success); }
.dup-card .file-thumbnail { height: 130px; font-size: 34px; }
.dup-card .file-info { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.dup-card .file-name { margin-bottom: 0; font-size: 14px; }
.dup-card .btn { margin-top: 6px; }
.rec-badge { align-self: flex-start; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 8px; border-radius: 10px; background: rgba(76, 195, 138, 0.16); color: var(--success); }
.warn { color: var(--accent); }
/* ---- AI & automatic tags ---- */
.ai-panel { display: flex; flex-direction: column; gap: 18px; max-width: 920px; }
.ai-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.ai-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ai-card h3 { font-size: 15px; font-weight: 600; }
.ai-card h4 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 6px; }
.ai-card .form-hint { margin: 0; }
.ai-callout { font-size: 13px; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ai-callout.is-warning { border-color: var(--accent); color: var(--text); }
.ai-callout code { font-family: var(--mono); font-size: 12px; color: var(--text); }
.ai-callout .btn-sm, .ai-run-actions .btn-sm, .ai-start-row .btn-sm, .rule-form .btn-sm, .ai-test-row .btn-sm { align-self: auto; }
.ai-start { display: flex; flex-direction: column; gap: 10px; }
.ai-start label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); cursor: pointer; }
.ai-scope { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.ai-start input[type="radio"], .ai-start input[type="checkbox"], .switch input { width: auto; margin: 0; accent-color: var(--accent); }
.count-inline { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.money-input { display: inline-flex; align-items: center; gap: 4px; }
.money-input input { width: 100px; padding: 6px 8px; }
.ai-start-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ai-runs { display: flex; flex-direction: column; gap: 10px; }
.ai-run { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.ai-run-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--text); }
.ai-run-meta { color: var(--text-dim); font-size: 12px; }
.ai-run-actions { margin-left: auto; display: flex; gap: 8px; }
.ai-run-stats { font-family: var(--mono); font-size: 12px; color: var(--text-muted); }
.ai-run-error { color: var(--danger); font-size: 13px; }
.pill { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 8px; border-radius: 10px; background: var(--surface-3); color: var(--text-muted); }
.pill-running { background: var(--accent-soft); color: var(--accent); }
.pill-done { background: rgba(76, 195, 138, 0.16); color: var(--success); }
.pill-failed { background: var(--danger-soft); color: var(--danger); }
.progress { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); transition: width 0.4s; }
.ai-feed { list-style: none; display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; font-size: 13px; }
.ai-feed li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.ai-card .tag { cursor: default; padding: 2px 8px; font-size: 11px; }
.rule-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.rule-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.rule-subhead { margin-top: 4px; }
.rule-list { display: flex; flex-direction: column; }
.rule-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text-muted); }
.rule-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rule-form input { flex: 1 1 160px; width: auto; padding: 7px 10px; font-size: 13px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); cursor: pointer; }
.tag.tag-ai::before { content: "✦ "; color: var(--accent); }
.tag.tag-rule { border-style: dashed; }
.ai-busy { background: transparent !important; color: var(--accent) !important; font-size: 10px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.filter-bar .search-mode { align-self: stretch; align-items: center; }
.filter-bar .search-mode button { padding: 5px 10px; font-size: 12px; }
.ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.ai-grid .form-group { margin-bottom: 12px; }
.ai-test-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.ai-test-result { min-height: 1em; margin-top: 8px; }
.ai-test-result.is-ok { color: var(--success); }
.ai-test-result.is-error { color: var(--danger); }
@media (max-width: 640px) { .ai-grid { grid-template-columns: 1fr; } .ai-run-actions { margin-left: 0; } }
.renamed-note { font-size: 13px; color: var(--text); background: var(--accent-soft); border: 1px solid rgba(240, 151, 42, 0.35); border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 16px; }
.renamed-from { font-size: 12px; color: var(--text-dim); }
.ai-tasks { border: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ai-tasks legend { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 8px; }
.ai-start .ai-subtask { margin-left: 26px; }
.ai-start label:has(input:disabled) { opacity: 0.5; cursor: default; }
.suggestion-list { display: flex; flex-direction: column; gap: 10px; }
.suggestion { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.suggestion-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 14px; }
.suggestion-actions { margin-left: auto; display: flex; gap: 8px; }
.suggestion-actions .btn-sm { align-self: auto; }
.suggestion-models { font-size: 13px; color: var(--text-muted); line-height: 1.7; }
.suggested-collections { font-size: 12px; color: var(--accent); }
.token-reason { font-size: 14px; color: var(--text); line-height: 1.5; margin-bottom: 12px; }
.token-steps { margin: 0 0 16px 18px; font-size: 13px; color: var(--text-muted); line-height: 1.7; }
.token-steps code, .token-steps kbd { font-family: var(--mono); font-size: 12px; }
.token-status { min-height: 1em; }
.token-status.is-error { color: var(--danger); }
.watch-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.watch-form input[type="url"] { flex: 1 1 320px; width: auto; }
.watch-form label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.watch-form select { width: auto; padding: 7px 10px; font-size: 13px; }
.watch-form input[type="checkbox"] { width: auto; accent-color: var(--accent); }
.watch-form .btn { align-self: auto; }
.watch-list { display: flex; flex-direction: column; gap: 10px; }
.watch { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.watch.is-paused { opacity: 0.65; }
.watch-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 14px; }
.watch-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.watch-actions .btn-sm { align-self: auto; }
.slot-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.slot-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.slot-edit .slot-material { width: 110px; padding: 5px 8px; font-size: 13px; }
.slot-edit .slot-colour { width: 42px; padding: 2px; }
.print-badge.yours { background: color-mix(in srgb, #6366f1 20%, transparent); color: #a5b4fc; }
.slot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.print-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; white-space: nowrap; }
.print-badge.ok { background: color-mix(in srgb, #22c55e 18%, transparent); color: #4ade80; }
.print-badge.no { background: color-mix(in srgb, #f59e0b 16%, transparent); color: #fbbf24; }
.spool-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--border); display: inline-block; }
.spool .watch-actions label { display: inline-flex; align-items: center; gap: 6px; }
.spool .spool-remaining { width: 90px; padding: 5px 8px; font-size: 13px; }
.ai-failures summary { cursor: pointer; font-size: 13px; color: var(--text-muted); }
.ai-failures summary:hover { color: var(--text); }
.watch-pending summary { cursor: pointer; font-size: 13px; color: var(--text-muted); }
.watch-pending summary:hover { color: var(--text); }
.watch-pending .watch-recent { margin-top: 6px; }
.watch-meta { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.watch-recent { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-muted); max-height: 180px; overflow-y: auto; }
#watchStatus.is-error { color: var(--danger); }