:root { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #121722;
  --muted: #697386;
  --line: #e6e9ee;
  --soft: #f8fafc;
  --accent: #3157d5;
  --accent-hover: #2849b8;
  --danger: #c73b4a;
  --dark: #171a21;
  --radius: 18px;
  --shadow: 0 14px 40px rgba(17, 24, 39, 0.07);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
button, input { font: inherit; }
.app-shell { max-width: 1480px; margin: 0 auto; padding: 30px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.eyebrow, .panel-label { margin: 0 0 8px; letter-spacing: .12em; font-size: 11px; font-weight: 700; color: var(--accent); }
h1 { margin: 0; font-size: clamp(28px, 4vw, 44px); line-height: 1.05; }
.subtitle { max-width: 760px; color: var(--muted); margin: 12px 0 0; line-height: 1.6; }
.status-pill { background: #eaf6ee; color: #267443; padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; }

.upload-card {
  min-height: 420px;
  border: 1.5px dashed #bfc7d4;
  border-radius: 24px;
  background: rgba(255,255,255,.78);
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  padding: 40px;
  transition: .2s ease;
}
.upload-card.drag { border-color: var(--accent); background: #f5f7ff; transform: translateY(-2px); }
.upload-icon { width: 64px; height: 64px; border-radius: 18px; background: #eef2ff; color: var(--accent); display: grid; place-items: center; font-size: 28px; font-weight: 700; margin-bottom: 16px; }
.upload-card h2 { margin: 0; font-size: 24px; }
.upload-card p { color: var(--muted); margin: 8px 0 18px; }
.upload-card small { color: #8a93a3; margin-top: 12px; }

.workspace { display: grid; grid-template-columns: minmax(300px, .72fr) minmax(0, 1.55fr); gap: 22px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-size: 16px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-box { background: #eef1f5; min-height: 420px; display: grid; place-items: center; overflow: hidden; }
.preview-box img { display: block; width: 100%; height: 100%; max-height: 620px; object-fit: contain; }
.file-stats { padding: 16px 22px 20px; display: grid; gap: 8px; color: var(--muted); font-size: 13px; }
.file-stats strong { color: var(--text); font-weight: 600; }

.btn { border: 1px solid transparent; border-radius: 11px; padding: 10px 14px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: .18s ease; }
.btn.primary { background: var(--accent); color: white; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.dark { background: var(--dark); color: white; }
.btn.ghost { background: white; border-color: var(--line); color: var(--text); }
.btn.ghost:hover { background: var(--soft); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 8px 11px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.toolbar { padding: 14px 18px; display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); background: #fbfcfd; }
.toolbar input { flex: 1; min-width: 0; border: 1px solid #dfe3e9; border-radius: 10px; padding: 11px 13px; outline: none; background: white; }
.toolbar input:focus { border-color: #8ca0e8; box-shadow: 0 0 0 3px rgba(49,87,213,.10); }
.counter { white-space: nowrap; color: var(--muted); font-size: 13px; }
.notice { margin: 14px 18px 0; padding: 11px 13px; border-radius: 11px; background: #fff8e9; color: #745510; font-size: 12px; line-height: 1.5; border: 1px solid #f2e1ac; }
.table-wrap { overflow: auto; max-height: 72vh; padding: 14px 18px 18px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
th { text-align: left; color: #7b8493; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 11px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: white; z-index: 1; }
td { padding: 8px 10px; border-bottom: 1px solid #eef0f3; vertical-align: top; }
td:first-child { width: 32%; font-weight: 600; word-break: break-word; }
td:nth-child(2) { width: 56%; }
td:nth-child(3) { width: 12%; color: #7b8493; font-size: 11px; }
.meta-input { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 7px 8px; color: var(--text); min-height: 36px; resize: vertical; }
.meta-input:hover { border-color: #e3e6eb; background: #fafbfc; }
.meta-input:focus { outline: none; border-color: #8ca0e8; background: white; box-shadow: 0 0 0 3px rgba(49,87,213,.08); }
.meta-input.changed { border-color: #9aabe6; background: #f5f7ff; }

.toast { position: fixed; right: 24px; bottom: 24px; max-width: 460px; padding: 13px 16px; border-radius: 12px; background: #161a22; color: white; box-shadow: 0 12px 30px rgba(0,0,0,.18); z-index: 50; font-size: 13px; line-height: 1.45; }
.toast.error { background: #a93443; }
.hidden { display: none !important; }

@media (max-width: 980px) {
  .app-shell { padding: 18px; }
  .workspace { grid-template-columns: 1fr; }
  .preview-box { min-height: 320px; }
  .metadata-head { align-items: flex-start; flex-direction: column; }
  .actions { justify-content: flex-start; }
  .table-wrap { max-height: none; }
}


.device-preset-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  background: #fafafa;
}
.device-preset-copy { display: grid; gap: 4px; }
.device-preset-copy strong { font-size: 14px; }
.device-preset-copy span { max-width: 720px; font-size: 12px; line-height: 1.5; color: #667085; }
.device-preset-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.device-preset-actions select {
  min-width: 190px;
  height: 40px;
  padding: 0 36px 0 12px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: #101828;
}
@media (max-width: 860px) {
  .device-preset-card { align-items: stretch; flex-direction: column; }
  .device-preset-actions { width: 100%; flex-direction: column; align-items: stretch; }
  .device-preset-actions select { width: 100%; }
}

.transfer-card {
  margin: 14px 18px 0;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .75fr);
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfd;
}
.transfer-card strong { font-size: 14px; }
.transfer-card p:not(.panel-label) { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.transfer-note { padding: 10px 12px; border-radius: 10px; background: #f4f6ff; color: #4f5f8f; font-size: 12px; line-height: 1.55; }
@media (max-width: 760px) {
  .transfer-card { grid-template-columns: 1fr; }
}

.app-footer{padding:24px 0 36px;text-align:center;font-size:12px;opacity:.55}
