/* IPA Panel — plain dark theme. One accent colour, small radii, no decoration. */
:root {
  --bg: #161616; --panel: #1c1c1c; --panel-2: #222222; --line: #2e2e2e; --line-2: #3a3a3a;
  --text: #e8e4da; --text-2: #c4c0b6; --muted: #938f85;
  --accent: #e9b84c; --accent-ink: #1a1400; --link: #f0c868;
  --ok: #8fc98a; --warn: #e9b84c; --bad: #e36b5f; --info: #8ab4f8;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --r: 3px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; font-weight: 600; margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
h3 { font-size: 13px; font-weight: 600; margin: 16px 0 6px; color: var(--text-2); }
p { margin: 0 0 10px; }
code { font-family: var(--mono); font-size: 12.5px; background: #111; border: 1px solid var(--line); padding: 1px 5px; border-radius: var(--r); }
pre { font-family: var(--mono); font-size: 12.5px; line-height: 1.5; background: #111; border: 1px solid var(--line); padding: 12px 14px; overflow: auto; margin: 0 0 12px; color: var(--text-2); border-radius: var(--r); }
pre code { background: none; border: 0; padding: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.boot { padding: 60px; text-align: center; color: var(--muted); }

/* top bar */
.topbar { height: 50px; border-bottom: 1px solid var(--line); background: var(--panel); display: flex; align-items: center; gap: 22px; padding: 0 20px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; color: var(--text); }
.brand img { width: 22px; height: 22px; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 2px; height: 100%; }
.nav a { display: flex; align-items: center; padding: 0 10px; color: var(--text-2); border-bottom: 2px solid transparent; height: 50px; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.active { color: var(--text); border-bottom-color: var(--accent); }
.nav .sep { width: 1px; background: var(--line); margin: 14px 6px; }
.topbar .who { margin-left: auto; color: var(--muted); font-size: 13px; display: flex; gap: 12px; align-items: center; }
.topbar .who a { color: var(--text-2); }
.btn.menu-btn { display: none; }
.main { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 0; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .input { width: auto; }
.summary { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.summary b { color: var(--text-2); font-weight: 600; }
.summary span + span::before { content: "·"; margin: 0 8px; color: var(--line-2); }

/* boxes */
.box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 14px; }
.box-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }

/* forms & buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: inherit; font-size: 13px; border-radius: var(--r); cursor: pointer; line-height: 1.3; white-space: nowrap; }
.btn:hover { background: #2a2a2a; border-color: #4a4a4a; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: #f2c45c; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--text-2); padding-left: 6px; padding-right: 6px; }
.btn.quiet:hover { background: #262626; }
.btn.sm { padding: 3px 8px; font-size: 12.5px; }
.btn.block { width: 100%; justify-content: center; }
.btn svg { width: 14px; height: 14px; }
label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.input { width: 100%; background: #121212; border: 1px solid var(--line-2); color: var(--text); padding: 7px 9px; border-radius: var(--r); font: inherit; outline: none; }
.input:focus { border-color: var(--accent); }
.input::placeholder { color: #6e6a62; }
textarea.input { min-height: 90px; resize: vertical; }
.hint { color: var(--muted); font-size: 12px; margin-top: 3px; }
.err { background: #2a1917; border: 1px solid #5a2b26; color: #f1b1a8; padding: 8px 10px; border-radius: var(--r); margin-bottom: 12px; font-size: 13px; }
.note { background: #1f1d16; border: 1px solid #4a3e1c; color: #efe1b6; padding: 8px 10px; border-radius: var(--r); margin-bottom: 12px; font-size: 13px; }
.good { background: #172217; border: 1px solid #2b4d2a; color: #c6e9c2; padding: 8px 10px; border-radius: var(--r); margin-bottom: 12px; font-size: 13px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { accent-color: var(--accent); }

/* status */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.st.ok::before { background: var(--ok); }
.st.warn::before { background: var(--warn); }
.st.bad::before { background: var(--bad); }
.st.info::before { background: var(--info); }
.tag { display: inline-block; font-size: 11.5px; padding: 1px 6px; border: 1px solid var(--line-2); border-radius: var(--r); color: var(--text-2); white-space: nowrap; }
.tag.new { border-color: #3d5c3b; color: var(--ok); }
.tag.upd { border-color: #5a4a1c; color: var(--accent); }
.tag.private { color: var(--muted); }

/* tables */
.table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.table th, .table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: #1a1a1a; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #202020; }
.table tr.group td { background: #1a1a1a; color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .03em; padding: 6px 12px; }
.table tr.group:hover td { background: #1a1a1a; }
.table td.acts { white-space: nowrap; text-align: right; }
.table tr.row { cursor: pointer; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--r); }
.appcell { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.icon { width: 36px; height: 36px; border-radius: 8px; background: #111; border: 1px solid var(--line); object-fit: cover; flex: none; }
.icon.big { width: 72px; height: 72px; border-radius: 16px; }
.icon.empty { display: grid; place-items: center; color: var(--muted); }
.appname { font-weight: 600; }
.bundle { color: var(--muted); font-family: var(--mono); font-size: 12px; }

/* upload */
.drop { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 14px 16px; display: flex; align-items: center; gap: 14px; margin-bottom: 14px; color: var(--muted); }
.drop.over { border-color: var(--accent); color: var(--text); }
.drop b { color: var(--text-2); font-weight: 600; }
.uprow { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.uprow:last-child { border-bottom: 0; }
.uprow .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uprow .m { color: var(--muted); font-size: 12px; }
.bar { grid-column: 1 / -1; height: 4px; background: #2a2a2a; margin-top: 5px; }
.bar > i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.bar > i.done { background: var(--ok); }
.bar > i.bad { background: var(--bad); }

/* modal */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 50; }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r); width: 100%; max-width: 620px; }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; }
.modal-body { padding: 16px; }
.modal-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

/* toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 6px; z-index: 100; }
.toast { background: #262626; border: 1px solid var(--line-2); color: var(--text); padding: 8px 12px; border-radius: var(--r); font-size: 13px; max-width: 360px; }
.toast.bad { border-color: var(--bad); }

/* login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-box { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.auth-brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 16px; margin-bottom: 18px; }
.auth-brand img { width: 26px; height: 26px; }
.auth-foot { text-align: center; color: var(--muted); margin-top: 14px; font-size: 13px; }

/* detail */
.detail-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 5px 12px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.links { margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--r); }
.lrow { display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 10px; border-bottom: 1px solid var(--line); }
.lrow:last-child { border-bottom: 0; }
.lrow .l { color: var(--muted); font-size: 12px; width: 64px; flex: none; }
.lrow .u { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 14px 0 12px; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); padding: 7px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.shots { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.shots img { height: 200px; border: 1px solid var(--line); border-radius: var(--r); }
.desc { white-space: pre-wrap; color: var(--text-2); font-size: 13px; max-height: 240px; overflow: auto; }
.hist { display: grid; gap: 3px; margin-top: 8px; max-width: 340px; }
.hist-row { display: grid; grid-template-columns: 26px 1fr 72px; gap: 8px; align-items: center; font-size: 12px; }
.hist-bar { height: 6px; background: #2a2a2a; }
.hist-bar > i { display: block; height: 100%; background: var(--accent); }
table.mini { border-collapse: collapse; }
table.mini td { padding: 3px 10px 3px 0; font-size: 13px; }
.store-head { display: flex; gap: 10px; align-items: center; margin: 10px 0; }
.lang-tabs { display: flex; gap: 6px; margin: 8px 0 12px; }
.lang-tabs button { background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text-2); padding: 4px 10px; border-radius: var(--r); font: inherit; font-size: 13px; cursor: pointer; }
.lang-tabs button.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* public page */
body.pub { padding: 36px 16px; }
.pub-box { max-width: 520px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.pub-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.pub-head h1 { font-size: 18px; }
.pub-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.pub-table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.pub-table th { width: 42%; text-align: left; color: var(--muted); font-weight: 500; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.pub-table td { font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.pub-desc summary { cursor: pointer; color: var(--text-2); font-weight: 600; margin-bottom: 6px; }
.pub-desc p { color: var(--text-2); font-size: 13px; white-space: pre-wrap; }

@media (max-width: 760px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .nav { display: none; position: absolute; top: 50px; left: 0; right: 0; background: var(--panel); border-bottom: 1px solid var(--line); flex-direction: column; height: auto; z-index: 40; }
  .nav.open { display: flex; }
  .nav a { height: 42px; border-bottom: 0; border-left: 2px solid transparent; }
  .nav a.active { border-left-color: var(--accent); }
  .nav .sep { display: none; }
  .btn.menu-btn { display: inline-flex; }
  .topbar .who span { display: none; }
  .main { padding: 16px 12px 60px; }
  .two { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 1px 0; }
  .kv dt { margin-top: 6px; }
}

/* bulk selection, charts */
.table th.sel, .table td.sel { width: 28px; padding-right: 0; }
.table td.sel input, .table th.sel input { accent-color: var(--accent); }
.toolbar.bulk { background: var(--panel); border: 1px solid var(--line); padding: 8px 10px; border-radius: var(--r); }
.chart { display: block; background: #121212; border: 1px solid var(--line); border-radius: var(--r); }
.chart-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 3px; }
