* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.usage-main {
  width: min(1126px, calc(100% - 56px));
  margin: 0 auto;
  padding: 22px 0 70px;
}

.usage-unlock {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 34px;
  align-items: end;
  padding: 24px 0;
  border-bottom: 1px solid var(--os-line);
}

.usage-unlock p,
.usage-section-head p,
.dialog-head p {
  margin: 0 0 4px;
  color: var(--os-muted);
  font-size: 11px !important;
  font-weight: 650;
}

.usage-unlock h2,
.usage-section-head h2,
.dialog-head h2 { margin: 0; }
.usage-unlock form { display: grid; gap: 7px; }
.usage-unlock label { color: var(--os-muted); font-size: 12px; }
.usage-unlock form > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.usage-unlock input,
.usage-dialog input,
.usage-dialog select {
  min-height: 40px;
  border: 1px solid var(--os-line-strong);
  border-radius: 6px;
  padding: 0 11px;
  color: var(--os-text);
  background: #fff;
  outline: none;
}
.usage-unlock input:focus,
.usage-dialog input:focus,
.usage-dialog select:focus { border-color: var(--os-text); }
.usage-unlock button,
.usage-toolbar button,
.usage-segments button,
.dialog-actions button {
  min-height: 38px;
  border: 1px solid var(--os-line-strong);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--os-text);
  background: #fff;
}
.usage-unlock button,
.dialog-actions button:last-child { color: #fff; border-color: var(--os-text); background: var(--os-text); }
#unlockError { min-height: 18px; margin: 0; color: #9f4d3c; font-size: 12px !important; }
.unlock-hint { margin: 0; color: var(--os-muted); font-size: 11px !important; }
.usage-unlock button:disabled { cursor: wait; opacity: .68; }

.usage-dashboard { display: grid; gap: 20px; }
.usage-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.usage-toolbar > div:first-child { display: grid; }
.usage-toolbar span { color: var(--os-muted); font-size: 11px; }
.usage-toolbar strong { margin-top: 2px; font-size: 13px; }
.usage-toolbar-actions { display: flex; gap: 7px; }
.usage-toolbar button { min-height: 32px; padding: 0 10px; font-size: 12px; }

.usage-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--os-line);
  border-radius: 8px;
  overflow: hidden;
}
.usage-summary article { min-height: 126px; padding: 16px; border-right: 1px solid var(--os-line); background: #fff; }
.usage-summary article:last-child { border-right: 0; }
.usage-summary span { color: var(--os-muted); font-size: 12px; }
.usage-summary strong { display: block; margin: 17px 0 5px; font-size: 25px; line-height: 1.1; }
.usage-summary p { margin: 0; color: var(--os-muted); font-size: 11px !important; }

.usage-heatmap-section,
.usage-section { padding: 18px; border: 1px solid var(--os-line); border-radius: 8px; background: #fff; }
.usage-section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.usage-section-head > span { color: var(--os-muted); font-size: 11px; }
.usage-segments { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--os-line); border-radius: 7px; background: var(--os-soft); }
.usage-segments button { min-height: 30px; border: 0; padding: 0 9px; color: var(--os-muted); background: transparent; font-size: 11px; }
.usage-segments button.active { color: var(--os-text); background: #fff; box-shadow: 0 1px 2px rgba(47, 52, 55, 0.09); }
.heatmap-scroll { overflow-x: auto; margin-top: 20px; padding-bottom: 5px; }
.token-heatmap { display: grid; grid-template-rows: repeat(7, 11px); grid-auto-flow: column; grid-auto-columns: 11px; gap: 3px; min-width: 739px; width: max-content; }
.token-day { width: 11px; height: 11px; border: 1px solid rgba(47, 52, 55, 0.05); border-radius: 2px; background: #ebedf0; }
.token-day[data-level="1"], .heatmap-legend i[data-level="1"] { background: #d8eadc; }
.token-day[data-level="2"], .heatmap-legend i[data-level="2"] { background: #9dc9a8; }
.token-day[data-level="3"], .heatmap-legend i[data-level="3"] { background: #57996a; }
.token-day[data-level="4"], .heatmap-legend i[data-level="4"] { background: #28653c; }
.heatmap-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; color: var(--os-muted); font-size: 11px; }
.heatmap-legend { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.heatmap-legend i { display: block; width: 11px; height: 11px; border-radius: 2px; background: #ebedf0; }

.usage-columns { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 20px; }
.monthly-list, .source-list { display: grid; gap: 9px; margin-top: 15px; }
.monthly-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) 78px; gap: 10px; align-items: center; }
.monthly-row time, .monthly-row strong { font-size: 12px; }
.monthly-row strong { text-align: right; }
.monthly-track { height: 8px; border-radius: 4px; background: var(--os-soft); overflow: hidden; }
.monthly-track i { display: block; height: 100%; border-radius: inherit; background: #57996a; }
.source-list article { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 11px 0; border-bottom: 1px solid var(--os-line); }
.source-list article:last-child { border-bottom: 0; }
.source-code { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 6px; background: var(--os-blue); font-size: 11px; font-weight: 750; }
.source-list article:nth-child(2) .source-code { background: var(--os-yellow); }
.source-list article:nth-child(3) .source-code { background: var(--os-green); }
.source-list article:nth-child(4) .source-code { background: var(--os-red); }
.source-list strong, .source-list span { display: block; }
.source-list p { margin: 4px 0 0; color: var(--os-muted); font-size: 11px !important; line-height: 1.45; }
.source-value { text-align: right; white-space: nowrap; }
.source-value strong { font-size: 14px; }
.source-value span { color: var(--os-muted); font-size: 10px; }
.source-status { display: inline-block !important; width: max-content; margin-top: 4px; padding: 2px 5px; border-radius: 4px; background: var(--os-soft); color: var(--os-muted); font-size: 10px !important; }
.source-status.connected { background: var(--os-green); color: #41634a; }
.usage-notes > div:last-child { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin-top: 14px; }
.usage-note { margin: 0; padding-left: 14px; color: var(--os-muted); font-size: 11px !important; line-height: 1.55; position: relative; }
.usage-note::before { content: ""; position: absolute; top: 7px; left: 0; width: 5px; height: 5px; border-radius: 50%; background: #57996a; }

.usage-dialog { width: min(440px, calc(100% - 28px)); border: 1px solid var(--os-line-strong); border-radius: 8px; padding: 0; color: var(--os-text); background: #fff; }
.usage-dialog::backdrop { background: rgba(47, 52, 55, 0.28); backdrop-filter: blur(2px); }
.usage-dialog form { display: grid; gap: 13px; padding: 18px; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.dialog-head button { width: 32px; height: 32px; border: 0; border-radius: 6px; color: var(--os-muted); background: var(--os-soft); font-size: 22px; line-height: 1; }
.usage-dialog label { display: grid; gap: 5px; color: var(--os-muted); font-size: 12px; }
.dialog-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }

.sean-os-usage.privacy-mode .usage-private { filter: blur(8px) saturate(.45); user-select: none; pointer-events: none; }

@media (max-width: 760px) {
  .usage-main { width: calc(100% - 24px); padding-top: 14px; }
  .usage-unlock { grid-template-columns: 1fr; gap: 16px; align-items: stretch; }
  .usage-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .usage-summary article { min-height: 104px; border-bottom: 1px solid var(--os-line); }
  .usage-summary article:nth-child(2) { border-right: 0; }
  .usage-summary article:nth-child(n + 3) { border-bottom: 0; }
  .usage-columns { grid-template-columns: 1fr; }
  .usage-section-head { display: grid; align-items: start; }
  .usage-segments { width: 100%; overflow-x: auto; }
  .usage-segments button { flex: 1 0 auto; }
  .heatmap-scroll { margin-right: -18px; padding-right: 18px; }
  .heatmap-foot { align-items: flex-start; }
  .usage-notes > div:last-child { grid-template-columns: 1fr; }
  .source-list article { grid-template-columns: 36px minmax(0, 1fr); }
  .source-value { grid-column: 2; text-align: left; }
}
