:root {
  --navy: #0e1a33; --navy2: #0a1426; --text: #0f172a; --muted: #64748b; --line: #e5e9f0; --bg: #f4f6fa;
  --blue: #3b82f6; --blue-d: #2563eb; --blue-bg: #eaf2ff; --amber: #b45309; --amber-bg: #fff6e5; --green: #15803d; --green-bg: #e8f7ee;
  --red: #b91c1c; --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 Inter, "Segoe UI", system-ui, Arial, sans-serif; color: var(--text); background: var(--bg); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.fine { color: #94a3b8; font-size: 12px; }
h1, h2 { margin: 0; letter-spacing: -0.01em; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Sign-in */
.login { display: grid; grid-template-columns: 46% 1fr; min-height: 100vh; }
.login-art { background: radial-gradient(circle at 80% 85%, #0c3a5a 0, transparent 45%), linear-gradient(160deg, #13284a, var(--navy2) 70%); color: #fff; padding: 48px 44px; display: flex; flex-direction: column; }
.logos img, .side-logos img { height: 46px; margin-right: 18px; }
.login-pitch { margin: auto 0; max-width: 460px; }
.login-pitch h1 { font-size: 32px; margin-bottom: 14px; }
.login-pitch p { color: #cbd5e1; }
.login-pitch ul { list-style: none; padding: 0; margin-top: 26px; }
.login-pitch li { margin: 12px 0; padding-left: 32px; position: relative; color: #e2e8f0; }
.login-pitch li::before { content: "\2713"; position: absolute; left: 0; top: -2px; width: 22px; height: 22px; border-radius: 50%; background: rgba(56, 189, 248, .15); color: #38bdf8; display: grid; place-items: center; font-size: 12px; }
.login-foot { color: #94a3b8; font-size: 12px; }
.login-form { display: grid; place-items: center; padding: 24px; }
.login-box { width: min(420px, 100%); }
.login-box h2 { font-size: 26px; }
.login-box > p { margin: 8px 0 26px; }
.ms-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 13px; border-radius: 10px; border: 1px solid #d6dbe4; background: #fff; font: 600 15px inherit; font-family: inherit; color: var(--text); cursor: pointer; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
.ms-btn:hover { background: #f8fafc; }
.ms-btn:disabled { opacity: .6; cursor: wait; }
.ms-logo { display: grid; grid-template-columns: 9px 9px; gap: 2px; }
.ms-logo i { width: 9px; height: 9px; display: block; }
.ms-logo i:nth-child(1) { background: #f25022; } .ms-logo i:nth-child(2) { background: #7fba00; } .ms-logo i:nth-child(3) { background: #00a4ef; } .ms-logo i:nth-child(4) { background: #ffb900; }
.login-msg { color: var(--red); min-height: 20px; margin: 14px 0 4px; }
.login-box .fine { text-align: center; }

/* Shell */
.shell { display: grid; grid-template-columns: 266px 1fr; min-height: 100vh; }
.side { background: linear-gradient(180deg, #13244a, var(--navy2)); color: #cbd5e1; padding: 26px 12px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-logos { padding: 0 12px 22px; border-bottom: 1px solid rgba(255, 255, 255, .08); display: flex; align-items: center; }
.side-logos img { height: 40px; margin-right: 14px; }
.side nav { margin-top: 18px; display: grid; gap: 4px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: #cbd5e1; text-decoration: none; font-weight: 600; }
.side nav a:hover { background: rgba(255, 255, 255, .05); }
.side nav a.active { background: rgba(255, 255, 255, .09); color: #fff; box-shadow: inset 3px 0 0 #38bdf8; }
.side-help { margin-top: auto; border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; padding: 14px 16px; font-size: 12.5px; }
.side-help b { color: #fff; } .side-help p { margin: 6px 0 10px; color: #94a3b8; } .side-help a { color: #38bdf8; font-weight: 600; text-decoration: none; }
main { min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 32px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top h1 { font-size: 18px; } .top p { margin: 2px 0 0; font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding-left: 14px; margin-left: 4px; border-left: 1px solid var(--line); }
.me b { display: block; font-size: 13px; } .me small { color: var(--muted); font-size: 11.5px; }
.content { padding: 28px 32px; max-width: 1400px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(15, 23, 42, .04); }
.filters { padding: 18px 20px; margin-bottom: 18px; }
.filters input[type=search] { width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fbfcfe; }
.filter-row { display: flex; gap: 14px; margin: 14px 0 12px; flex-wrap: wrap; }
.filter-row label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: grid; gap: 6px; }
.filter-row select { min-width: 190px; }
select, input { font: inherit; color: var(--text); }
select, .drawer input { padding: 9px 11px; border: 1px solid #d9dee7; border-radius: 9px; background: #fff; }
.chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.chip { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid; }
.chip.blue { color: #1d4ed8; background: var(--blue-bg); border-color: #c7dbff; } .chip.amber { color: var(--amber); background: var(--amber-bg); border-color: #fde3b0; } .chip.green { color: var(--green); background: var(--green-bg); border-color: #bfe6cc; }
.hint { margin-left: auto; color: #94a3b8; font-size: 12px; }
.table-card { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 14px 16px; background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 16px; border-bottom: 1px solid #eef1f5; white-space: nowrap; }
tbody tr { cursor: pointer; } tbody tr:hover { background: #f8fbff; }
.person { display: flex; align-items: center; gap: 12px; }
.person b { display: block; } .person small { color: #94a3b8; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #3b6db3; color: #fff; font-weight: 700; font-size: 12px; object-fit: cover; flex: none; }
.avatar.small { width: 34px; height: 34px; }
.badge { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.badge.both { background: var(--blue-bg); color: #1d4ed8; } .badge.welsford { background: #eef2ff; color: #4338ca; } .badge.valveman { background: #fff1e6; color: #c2410c; }
.ok { color: var(--green); font-weight: 600; } .miss { color: var(--amber); font-weight: 600; }
.btn { border: 1px solid transparent; border-radius: 10px; padding: 9px 15px; font: 600 13.5px inherit; font-family: inherit; cursor: pointer; }
.btn.primary { background: var(--blue); color: #fff; box-shadow: 0 1px 2px rgba(37, 99, 235, .3); } .btn.primary:hover { background: var(--blue-d); }
.btn.ghost { background: #fff; border-color: #d6dbe4; color: var(--text); } .btn.ghost:hover { background: #f8fafc; }
.btn.danger { background: #fff; border-color: #f3c4c4; color: var(--red); }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; font-size: 22px; line-height: 1; } .icon-btn:hover { background: #f1f5f9; }
.prose { padding: 26px 30px; max-width: 900px; } .prose h2 { font-size: 18px; margin-bottom: 8px; } .prose li { margin: 8px 0; }
code { background: #f1f5f9; padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }
#readiness { margin-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; }

/* Drawer */
.drawer { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 20; display: flex; justify-content: flex-end; }
.drawer-panel { width: min(1180px, 100%); height: 100%; background: #fff; display: flex; flex-direction: column; box-shadow: -10px 0 30px rgba(15, 23, 42, .2); }
.drawer-panel > header { display: flex; justify-content: space-between; align-items: center; padding: 18px 26px; border-bottom: 1px solid var(--line); }
.drawer-body { display: grid; grid-template-columns: 400px 1fr; gap: 0; overflow: auto; flex: 1; }
#form { padding: 22px 26px; border-right: 1px solid var(--line); display: grid; gap: 12px; align-content: start; }
#form label { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: #475569; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .grid3 { display: grid; grid-template-columns: 1fr 1fr 70px; gap: 10px; }
.photo-edit { display: flex; gap: 16px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.photo-edit > div { display: grid; gap: 8px; }
.photo-preview { width: 104px; height: 104px; border-radius: 50%; background: #e2e8f0; object-fit: cover; }
.file-btn { display: inline-block; text-align: center; } .small-btn { padding: 7px 12px; }
.zoom { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 8px !important; }
.form-msg { min-height: 18px; margin: 0; font-size: 13px; } .form-msg.err { color: var(--red); } .form-msg.good { color: var(--green); }
.form-actions { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; }
.preview { padding: 22px 26px; background: #f8fafc; }
.preview-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.seg { border: 1px solid #d6dbe4; background: #fff; padding: 5px 12px; font: 600 12px inherit; font-family: inherit; cursor: pointer; }
.seg:first-child { border-radius: 8px 0 0 8px; } .seg:last-child { border-radius: 0 8px 8px 0; border-left: 0; } .seg.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.preview-stage { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; overflow: auto; }
#pv { border: 0; width: 780px; max-width: 100%; height: 260px; display: block; }

@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; } .side { display: none; }
  .login { grid-template-columns: 1fr; } .login-art { display: none; }
  .drawer-body { grid-template-columns: 1fr; } #form { border-right: 0; }
  .top { flex-wrap: wrap; padding: 14px 16px; } .content { padding: 16px; }
}

/* Brand logos */
.logo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 18px 0 22px; }
.logo-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 12px; justify-items: start; }
.logo-card h3, .prose h3 { margin: 0; font-size: 14px; }
.logo-card img { height: 140px; max-width: 100%; object-fit: contain; background: #fff; }
.logo-built { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-end; padding: 16px; background: #1e293b; border-radius: 12px; margin: 10px 0 14px; }
.logo-built figure { margin: 0; color: #cbd5e1; font-size: 12px; } .logo-built img { height: 72px; display: block; margin-bottom: 6px; }

.mt { margin-top: 26px !important; }
.strip-card { display: grid; gap: 8px; justify-items: start; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 12px 0; }
.strip-card img { width: 100%; max-width: 900px; }

/* Editor sizing (fix: Ext. and Save were cut off; preview scrolled sideways) */
.drawer-panel { width: min(1560px, 100%); }
.drawer-body { grid-template-columns: minmax(520px, 560px) minmax(0, 1fr); }
#form input, #form select { width: 100%; min-width: 0; }
.grid2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 90px; }
.photo-edit > div { flex: 1; min-width: 0; }
.form-actions { grid-template-columns: auto 1fr auto auto; align-items: center; }
#pv { width: 760px; }
@media (max-width: 1300px) { .drawer-body { grid-template-columns: 1fr; } #form { border-right: 0; border-bottom: 1px solid var(--line); } }

.cmd { background: #0f172a; color: #e2e8f0; padding: 12px 14px; border-radius: 10px; font-size: 12.5px; overflow-x: auto; }
