:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #fff8e8;
  color: #563b2f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 240, 183, 0.75), transparent 34%),
    linear-gradient(180deg, #fff6df 0%, #fffaf0 42%, #fff7e8 100%);
}

.shell {
  width: min(1500px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 54px 0 56px;
}

.topbar {
  display: grid;
  justify-items: center;
  gap: 20px;
  margin-bottom: 34px;
  text-align: center;
}

.brandBlock {
  max-width: 820px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 14px;
  color: #53372b;
  font-size: clamp(46px, 5.4vw, 76px);
  line-height: 1.04;
  letter-spacing: 0;
  font-weight: 860;
}

h2 {
  color: #583d31;
  font-size: 25px;
  font-weight: 820;
}

#subtitle {
  margin-top: 18px;
  color: #917769;
  font-size: 19px;
  font-weight: 650;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #e7603a;
  font-size: 19px;
  font-weight: 760;
  letter-spacing: 3px;
}

.statusDot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #64c878;
  box-shadow: 0 0 0 7px rgba(100, 200, 120, 0.16);
}

.statusDot.paused {
  background: #e88b5c;
  box-shadow: 0 0 0 7px rgba(232, 139, 92, 0.18);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.viewTabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: 0 12px 28px rgba(101, 72, 45, 0.08);
}

button,
.button,
input {
  min-height: 42px;
  border: 1px solid rgba(108, 74, 56, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #5b4034;
  padding: 0 17px;
  font: inherit;
  box-shadow: 0 12px 28px rgba(101, 72, 45, 0.08);
}

select,
textarea {
  width: 100%;
  border: 1px solid rgba(108, 74, 56, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: #5b4034;
  padding: 12px 14px;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

.viewTab {
  min-height: 32px;
  padding: 0 15px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.viewTab.active {
  background: #fffaf2;
  color: #e7603a;
  box-shadow: 0 8px 18px rgba(101, 72, 45, 0.08);
}

button,
.button {
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  font-weight: 760;
}

button:hover,
.button:hover,
input:hover {
  background: rgba(255, 255, 255, 0.92);
}

button.primary {
  background: #e8845c;
  color: #fffaf2;
  border-color: #e8845c;
}

.warning {
  margin: 0 auto 20px;
  max-width: 960px;
  padding: 14px 18px;
  border: 1px solid #e8be70;
  background: rgba(255, 244, 217, 0.86);
  border-radius: 20px;
  color: #704b21;
}

.hidden {
  display: none;
}

.heroGrid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(360px, 1fr);
  gap: 28px;
  align-items: start;
}

.focusCard,
.panel {
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow:
    0 34px 90px rgba(108, 76, 45, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.focusCard {
  min-height: 590px;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.focusCard::before {
  content: "";
  position: absolute;
  inset: 72px 10% auto;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 232, 149, 0.5), transparent 68%);
  filter: blur(8px);
}

.focusLabel {
  position: relative;
  z-index: 1;
  color: #8b6f60;
  font-size: 20px;
  font-weight: 800;
}

.focusCard > strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 12px;
  color: #53372b;
  font-size: clamp(48px, 6vw, 84px);
  line-height: 1;
  letter-spacing: 0;
}

.focusMeta {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  max-width: 680px;
  margin-top: 22px;
  color: #8b7164;
  font-size: 18px;
  font-weight: 680;
}

.focusMeta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chartStack {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 34px;
  margin-top: 34px;
}

.chartBlock {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: 100%;
}

.chartPanelBlock {
  padding: 30px 28px 34px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow:
    0 22px 58px rgba(108, 76, 45, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.chartTitle {
  color: #8b6f60;
  font-size: 18px;
  font-weight: 820;
}

.pieChart {
  position: relative;
  width: min(340px, 70vw);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 246, 229, 0.5);
  box-shadow: 0 28px 70px rgba(155, 102, 50, 0.15);
}

.categoryPieChart {
  width: min(280px, 62vw);
}

.donutSvg {
  position: absolute;
  inset: -16px;
  width: calc(100% + 32px);
  height: calc(100% + 32px);
  overflow: visible;
}

.donutSegment {
  cursor: default;
  filter: drop-shadow(0 10px 16px rgba(100, 64, 38, 0.08));
  transform-box: fill-box;
  transform-origin: center;
  transition:
    transform 180ms ease,
    opacity 180ms ease,
    filter 180ms ease;
}

.donutSegment:hover,
.donutSegment.active {
  transform: scale(1.055);
  filter: drop-shadow(0 18px 24px rgba(100, 64, 38, 0.16));
}

.donutSegment.dimmed {
  opacity: 0.32;
}

.chartCenter {
  position: absolute;
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 48%;
  aspect-ratio: 1;
  place-content: center;
  border-radius: 50%;
  background: rgba(255, 254, 250, 0.94);
  box-shadow: inset 0 0 18px rgba(143, 93, 47, 0.05);
  text-align: center;
  pointer-events: none;
}

.chartCenter strong {
  color: #5a3e32;
  font-size: 24px;
  font-weight: 860;
}

.chartCenter span {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #9b938c;
  font-size: 13px;
  font-weight: 760;
}

.sideStack {
  display: grid;
  gap: 26px;
}

.panel {
  overflow: hidden;
}

.panelHead {
  min-height: 74px;
  padding: 28px 32px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panelHead span {
  color: #8d7466;
  font-weight: 760;
}

.statRows {
  padding: 0 32px 30px;
}

.statRows > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px dashed rgba(94, 66, 51, 0.16);
}

.statRows > div:last-child {
  border-bottom: 0;
}

.statRows span {
  color: #6c5144;
  font-size: 20px;
  font-weight: 760;
}

.statRows strong {
  color: #5b4034;
  font-size: 20px;
  font-weight: 860;
}

.chartLegend {
  display: grid;
  gap: 14px;
  padding: 6px 32px 32px;
}

.compactLegend {
  width: min(560px, 100%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 4px 0 0;
}

.legendItem {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: default;
  font: inherit;
}

.categoryItem {
  min-height: 42px;
}

.legendItem.active .legendName {
  color: #e3764f;
}

.legendSwatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color);
}

.legendName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #5a4034;
  font-size: 17px;
  font-weight: 780;
}

.legendTime {
  color: #8b7164;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(0, 1.35fr);
  gap: 28px;
  margin-top: 28px;
}

.categoryRulesPanel {
  margin-top: 28px;
}

.categoryRulesPanel .panelHead {
  padding-bottom: 12px;
}

.ruleForm {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto 88px;
  align-items: center;
  gap: 12px;
  margin: 0 32px 20px;
  padding: 10px;
  border: 1px solid rgba(108, 74, 56, 0.09);
  border-radius: 26px;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 227, 135, 0.18), transparent 36%),
    rgba(255, 250, 242, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 14px 34px rgba(101, 72, 45, 0.06);
}

.ruleCategoryButtons {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(108, 74, 56, 0.08);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.72);
}

.ruleCategoryButtons button {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  box-shadow: none;
  background: transparent;
  color: #8b7164;
  font-size: 15px;
  font-weight: 860;
}

.ruleCategoryButtons button.active {
  background: #ef9b72;
  color: #fffaf4;
  box-shadow: 0 8px 18px rgba(221, 118, 77, 0.2);
}

.ruleForm > button {
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  background: #fff8ed;
}

.ruleForm > button:disabled {
  cursor: progress;
  opacity: 0.68;
}

.ruleToolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 32px 18px;
}

.ruleToolbar input {
  width: min(360px, 100%);
  min-height: 42px;
  border-radius: 999px;
}

.ruleToolbar span {
  color: #8b7164;
  font-weight: 780;
}

.ruleFeedback {
  min-height: 22px;
  margin: -8px 32px 14px;
  color: #8b7164;
  font-size: 14px;
  font-weight: 760;
}

.ruleFeedback.error {
  color: #d76643;
}

.ruleGroups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0 32px 32px;
}

.ruleGroup {
  padding: 18px;
  border: 1px solid rgba(108, 74, 56, 0.1);
  border-radius: 24px;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 230, 140, 0.18), transparent 34%),
    rgba(255, 252, 247, 0.7);
  box-shadow: 0 14px 28px rgba(101, 72, 45, 0.05);
}

.ruleGroupHead {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ruleGroupHead h3 {
  margin: 0 0 4px;
  color: #563b2f;
  font-size: 22px;
  line-height: 1.1;
}

.ruleGroupHead span {
  color: #9b8578;
  font-size: 14px;
  font-weight: 760;
}

.ruleGroupHead button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 248, 237, 0.72);
  color: #8b7164;
  font-size: 14px;
  box-shadow: none;
}

.ruleChips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ruleChip {
  display: inline-grid;
  grid-template-columns: minmax(0, auto) auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  max-width: 100%;
  padding: 5px 5px 5px 13px;
  border: 1px solid rgba(108, 74, 56, 0.11);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.78);
  color: #5a4034;
  box-shadow: 0 8px 18px rgba(101, 72, 45, 0.045);
}

.ruleChip span {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 820;
}

.ruleChip button {
  width: 28px;
  height: 28px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  box-shadow: none;
  border-color: rgba(108, 74, 56, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: #8d7466;
  font-family: Arial, sans-serif;
  font-size: 18px;
  line-height: 1;
}

.ruleChip button:hover {
  color: #e3764f;
  border-color: rgba(232, 118, 79, 0.22);
  background: #fffaf2;
}

.list {
  display: grid;
  padding-bottom: 12px;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 17px 32px;
}

.title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #573d32;
  font-size: 16px;
  font-weight: 780;
}

.url {
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #967d70;
  font-size: 14px;
}

.time {
  align-self: start;
  color: #5b4034;
  font-weight: 840;
  white-space: nowrap;
}

.bar {
  grid-column: 1 / -1;
  height: 7px;
  background: rgba(238, 213, 180, 0.62);
  border-radius: 999px;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: var(--w);
  background: linear-gradient(90deg, #ef9b72, #f0c66e);
  border-radius: inherit;
}

.empty {
  padding: 26px 32px;
  color: #8b7164;
}

@media (max-width: 1100px) {
  .heroGrid,
  .grid {
    grid-template-columns: 1fr;
  }

  .focusCard {
    min-height: 520px;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100vw - 24px, 1500px);
    padding-top: 32px;
  }

  h1 {
    font-size: 42px;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .viewTabs {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .actions input,
  .actions .button {
    grid-column: 1 / -1;
  }

  .ruleForm {
    grid-template-columns: 1fr;
    margin: 0 22px 18px;
  }

  .ruleCategoryButtons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 22px;
  }

  .ruleToolbar {
    align-items: stretch;
    flex-direction: column;
    margin-left: 22px;
    margin-right: 22px;
  }

  .ruleToolbar input {
    width: 100%;
  }

  .ruleFeedback {
    margin-left: 22px;
    margin-right: 22px;
  }

  .ruleGroups {
    grid-template-columns: 1fr;
    margin-left: 22px;
    margin-right: 22px;
  }

  .focusCard,
  .panel {
    border-radius: 26px;
  }

  .focusCard {
    min-height: auto;
    padding: 30px;
  }

  .chartStack {
    gap: 28px;
  }

  .chartPanelBlock {
    padding: 24px 18px 28px;
    border-radius: 24px;
  }

  .compactLegend {
    grid-template-columns: 1fr;
  }

  .focusCard > strong {
    font-size: 48px;
  }

  .panelHead,
  .statRows,
  .chartLegend,
  .row {
    padding-left: 22px;
    padding-right: 22px;
  }

}
