:root {
  color-scheme: light;
  --page: #f4f7fb;
  --paper: #fff;
  --ink: #142c43;
  --muted: #50677b;
  --line: #dbe5ee;
  --accent: #076da5;
  --tint: #e7f3fc;
  --green: #1e715c;
  --green-bg: #e3f3ec;
  --shade: #f7fafd;
  --row-hover: #eef7fd;
  --borderRadius: 14px;
  font: 15px/1.5 Inter, "Segoe UI", Roboto, Arial, sans-serif;
}
:root[data-theme=dark] {
  color-scheme: dark;
  --page: #111c27; --paper: #192937; --ink: #edf5fd; --muted: #aec0ce;
  --line: #314455; --accent: #83cafa; --tint: #203e50; --green: #91ddbe;
  --green-bg: #244337; --shade: #1c2e3d; --row-hover: #213a4d;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--page); color: var(--ink); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1440px; width: 100%; margin-inline: auto; padding-inline: clamp(16px, 4vw, 64px); }
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 720; letter-spacing: -.04em; white-space: nowrap; }
.brandmark { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; background: #117bb9; color: white; font-size: 19px; }
.brandmark::before { content:""; display:block; width:19px; height:16px; background:#fff; clip-path:polygon(0 43%,100% 0,79% 95%,50% 67%,37% 84%,39% 58%,83% 17%,31% 50%); }
main { padding-block: clamp(24px, 5vw, 62px) max(40px, env(safe-area-inset-bottom)); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(29px, 3.4vw, 46px); line-height: 1.12; letter-spacing: -.05em; overflow-wrap: anywhere; }
h2 { font-size: 20px; letter-spacing: -.035em; }
.sub, .metadata { color: var(--muted); }
.sub { margin-top: 6px; font-size: 14px; }
.section { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 18px; flex-wrap: wrap; }
.ghost, .retry { padding: 8px 13px; border: 1px solid var(--line); color: var(--accent); background: var(--paper); border-radius: 9px; font-weight: 600; }
.ghost:hover, .retry:hover { background: var(--tint); }
.accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 295px), 1fr)); gap: 14px; margin-top: 26px; }
.account { display: flex; align-items: center; gap: 15px; padding: 23px 19px; text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: var(--borderRadius); }
.account:hover { border-color: var(--accent); }
.account .avatar { width: 46px; height: 46px; flex: none; display: grid; place-items: center; font-size: 19px; font-weight: 700; color: var(--accent); background: var(--tint); border-radius: 13px; }
.account .title, .account small { display: block; }
.account .title { font-weight: 650; font-size: 18px; overflow-wrap: anywhere; }
.account small { margin-top: 2px; color: var(--muted); }
.arrow { margin-left: auto; color: var(--accent); font-size: 22px; }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 22px 0 32px; }
.metric { padding: 17px 19px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--borderRadius); }
.metric:first-child { border-color: var(--accent); background: var(--tint); }
.metric .label { color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 5px; font-size: clamp(21px, 2.1vw, 31px); font-weight: 680; letter-spacing: -.045em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.metric .unit { font-size: .55em; letter-spacing: -.02em; margin-left: .35em; }
.stars-amount { display: inline-flex; align-items: center; gap: .14em; white-space: nowrap; }
.stars-icon {
  display: inline-block;
  width: .95em;
  height: .95em;
  flex: none;
  background: linear-gradient(145deg, #ffe99a 8%, #ffcf56 37%, #ffb332 59%, #ed950f 93%);
  clip-path: polygon(50% 1%, 65% 32%, 99% 38%, 75% 62%, 80% 97%, 50% 81%, 19% 97%, 25% 62%, 1% 38%, 36% 32%);
}
.panel { border: 1px solid var(--line); border-radius: var(--borderRadius); background: var(--paper); overflow: hidden; }
.toolbar { padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.search, .sort, .month { background: var(--shade); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; min-width: 0; }
.search { width: min(380px,100%); }
.sort { display: none; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { padding: 13px 10px; border-top: 1px solid var(--line); text-align: right; vertical-align: middle; white-space: nowrap; }
th { color: var(--muted); background: var(--shade); font-weight: 600; }
th:first-child, td:first-child { text-align: left; padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }
.ads tr:hover td { background-color: var(--row-hover); }
.thbtn { border: none; background: none; color: inherit; font-size: 12px; font-weight: inherit; padding: 4px 0; }
th[aria-sort] .thbtn { color: var(--accent); }
.ad-title { display: block; text-align: left; border: none; background: none; padding: 0; font-weight: 670; color: var(--accent); font-size: 14px; max-width: 290px; overflow-wrap: anywhere; white-space: normal; }
.ad-title:hover { text-decoration: underline; }
.ad-url { display: block; color: var(--muted); max-width: 225px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.status { display: inline-block; padding: 2px 8px; border-radius: 12px; background: var(--shade); color: var(--muted); border: 1px solid var(--line); font-size: 12px; }
.status.active { color: var(--green); background: var(--green-bg); border-color: transparent; }
.notice { padding: 25px; border: 1px solid var(--line); background: var(--paper); border-radius: var(--borderRadius); color: var(--muted); }
.notice .retry { display: block; margin-top: 14px; }
.panel .notice { border: none; border-top: 1px solid var(--line); border-radius: 0; }
.detail-wrap { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(0,1fr); align-items: start; gap: 20px; margin-top: 24px; }
.facts { margin: 0; padding: 0 18px 14px; }
.fact { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.fact dt { color: var(--muted); }
.fact dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.days tfoot { font-weight: 700; background: var(--tint); }
.metadata { padding: 12px 18px; font-size: 12px; }
@media (max-width: 780px) {
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 18px 0 22px; }
  .metric { padding: 12px; }
  .detail-wrap { grid-template-columns: minmax(0,1fr); }
  .sort { display: inline; max-width: 100%; }
  .toolbar { padding: 12px; }
  .ads, .ads tbody { display: block; width: 100%; }
  .ads thead { display: none; }
  .ads tbody tr { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px 6px; align-items: start; padding: 14px 12px; border-top: 1px solid var(--line); }
  .ads td { display: none; border: none; text-align: left; padding: 0; white-space: normal; }
  .ads td.mobile { display: block; }
  .ads td:first-child { display: block; grid-column: 1 / span 2; grid-row: 1; min-width: 0; }
  .ads td[data-key=status] { display: block; grid-column: 3; grid-row: 1; text-align: right; }
  .ads td.mobile::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; }
  .ad-title, .ad-url { max-width: 100%; }
  .scroll { overflow: visible; }
}
@media(max-width:420px){ .search { width: 100%; } .bar-inner { min-height: 55px; } }
.commands { display:flex; gap:8px; flex-wrap:wrap; }
.primary { color:#fff; background:#086fae; border:none; border-radius:9px; font-weight:650; min-height:41px; padding:9px 17px; }
.primary:hover { background:#075f94; }
.primary:disabled { opacity:.65; cursor:wait; }
.form { padding:clamp(16px, 3vw, 28px); max-width:590px; margin-top:24px; }
.control { display:flex; flex-direction:column; gap:5px; font-weight:600; margin-bottom:16px; }
.control input:not([type=checkbox]), .control textarea { width:100%; font:inherit; color:inherit; font-weight:400; border:1px solid var(--line); border-radius:8px; padding:9px; background:var(--shade); }
.control.check { flex-direction:row; align-items:center; gap:10px; }
.check input { width:18px; height:18px; accent-color:#086fae; }
.form .facts { padding:0; }
.form .ghost { margin-left:7px; }
.form .error { margin:12px 0; color:var(--muted); }
.form .error:empty { margin:0; }
.approval { display:grid; gap:16px; }
.approval .check { margin:0; cursor:pointer; }
.approval .check input { flex:none; margin:0; }
.approval .sub { margin:0; }
.approval .sub:empty { display:none; }
.approval .ghost { margin-left:0; }
.approval-tag { width:fit-content; border:1px solid var(--line); border-radius:9px; background:var(--tint); color:var(--accent); font-size:22px; font-variant-numeric:tabular-nums; padding:7px 13px; }
.notice + .panel, .notice + .notice { margin-top:14px; }
.query-list { padding: 2px 18px 18px; }
.query-list h3 { margin: 0; font-size: 15px; }
.query-list ul { display: flex; flex-wrap: wrap; gap: 5px; list-style: none; padding: 0; margin: 8px 0; }
.query-list li { padding: 3px 8px; border-radius: 5px; background: var(--tint); color: var(--accent); overflow-wrap: anywhere; min-width: 0; }
