.hub {
  width: min(1080px, calc(100% - 32px));
  margin: 16px auto 56px;
}

.hub-hero, .hub-panel {
  border: 1px solid var(--shiro-line);
  border-radius: var(--shiro-radius);
  padding: clamp(16px, 4vw, 36px);
  background: var(--shiro-panel);
  box-shadow: var(--shiro-shadow);
}

.hub-hero {
  margin-block: 14px 20px;
  background: radial-gradient(ellipse at 100% 0%, color-mix(in srgb, var(--shiro-accent) 16%, transparent), transparent 61%),
    var(--shiro-panel);
}

.hub-hero h1, .hub-panel h2 {
  font-family: var(--shiro-serif);
  line-height: 1.2;
  letter-spacing: .06em;
  margin: 0;
}

.hub-hero h1 { font-size: clamp(2.15rem, 6vw, 4.2rem); }
.hub-panel h2 { font-size: clamp(1.45rem, 3vw, 2.2rem); }
.hub-panel h3 { margin-block: 0 .7rem; }
.hub-panel { margin-block: 18px; }
.hub-hero p, .hub-panel p { color: var(--shiro-muted); margin-block: .55rem; }
.hub-jumps, .hub-actions, .hub-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hub-heading { justify-content: space-between; margin-bottom: .9rem; }
.hub-heading > div { flex: 1 1 16rem; }
.hub-jumps { margin-top: 1rem; }

.hub-jumps > a, .hub button, .hub input, .hub select {
  min-height: 44px;
  box-sizing: border-box;
  border: 1px solid var(--shiro-line);
  border-radius: 8px;
  background: var(--shiro-panel);
  color: var(--shiro-ink);
  padding: .45rem .7rem;
  font: inherit;
}

.hub-jumps > a {
  display: inline-flex;
  align-items: center;
  color: var(--shiro-accent);
  text-decoration: none;
}

.hub button { cursor: pointer; }
.hub button:disabled { opacity: .56; cursor: default; }
.hub :is(button:enabled, .hub-jumps > a):hover { border-color: var(--shiro-accent); }
.hub-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: 12px; }
.hub-field, .hub-controls > label { display: grid; gap: .25rem; min-width: 0; }
.hub-field { width: min(100%, 30rem); }
.hub-controls :is(input, select), .hub-field :is(input, select) { width: 100%; min-width: 0; }
.hub-actions { margin-block: 12px; }
.hub [role="status"]:empty { margin-block: 0; }
.hub :is(.hub-month, .hub-year) { display: grid; gap: clamp(3px, 1vw, 8px); margin-block: .8rem; }
.hub .hub-month { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.hub .hub-year { grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5rem), 1fr)); }
.hub-weekday { text-align: center; color: var(--shiro-muted); }

.hub-day {
  min-height: 44px;
  border: 1px solid var(--shiro-line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  color: var(--shiro-muted);
  font-variant-numeric: tabular-nums;
}

.hub button.hub-event-day {
  padding: 1px;
  background: color-mix(in srgb, var(--shiro-accent) 10%, var(--shiro-panel));
  border-color: var(--shiro-accent);
  gap: 1px .4rem;
  flex-wrap: wrap;
  font-weight: 650;
}

.hub-year button { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; }
.hub-year small, .hub-event-day small { color: var(--shiro-accent); font-size: .75rem; }
.hub-event-day small { min-width: 1em; }
.hub-event-list, .hub-connections, .hub-bars { list-style: none; margin: 0; padding: 0; }
.hub-event-list li, .hub-connections li {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem 1rem;
  border-bottom: 1px solid var(--shiro-line);
  padding: .35rem 0;
}

.hub :is(.hub-event-list, .hub-connections) a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  overflow-wrap: anywhere;
}

.hub-event-list time, .hub-event-list small { color: var(--shiro-muted); font-size: .88rem; }
.hub-event-list li { scroll-margin-top: 16px; }
.hub-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.75rem), 1fr)); gap: .55rem; margin: 0 0 1.35rem; }
.hub-totals > div { border: 1px solid var(--shiro-line); background: var(--shiro-paper); border-radius: 10px; padding: .55rem .7rem; }
.hub-totals dt { color: var(--shiro-muted); font-size: .86rem; }
.hub-totals dd { margin: 0; font-size: clamp(1.4rem, 2.5vw, 2.1rem); font-variant-numeric: tabular-nums; font-weight: 650; }
.hub-stat-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1.5rem; }
.hub-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 .75rem; padding: .13rem 0; }
.hub-bars li > :is(a, span:first-child) { overflow-wrap: anywhere; }
.hub-bars a { min-height: 44px; display: inline-flex; align-items: center; }
.hub-bars li strong { font-variant-numeric: tabular-nums; }
.hub-bar { grid-column: 1 / -1; height: 5px; width: 100%; border-radius: 4px; background: var(--shiro-line); }
.hub-bar::before { content: ''; display: block; height: 100%; width: var(--bar, 0%); border-radius: inherit; background: var(--shiro-accent); }
.hub-compare table { width: 100%; border-collapse: collapse; table-layout: fixed; margin-top: .8rem; }
.hub-compare thead th:first-child { width: 24%; }
.hub-compare :is(th, td) { text-align: start; vertical-align: top; padding: .55rem .45rem; border-bottom: 1px solid var(--shiro-line); overflow-wrap: anywhere; }
.hub-compare thead :is(th, td) { color: var(--shiro-accent); }
.hub-compare thead a { display: inline-flex; align-items: center; min-height: 44px; }
.hub-compare tbody tr:nth-child(odd) { background: var(--shiro-paper); }
.hub-connection-labels { display: flex; flex: 1 1 12rem; gap: .25rem .65rem; flex-wrap: wrap; align-items: center; color: var(--shiro-muted); font-size: .88rem; }
.hub-connection-action { margin-inline-start: auto; }
.hub details summary { cursor: pointer; font-weight: 650; min-height: 44px; box-sizing: border-box; padding-block: .5rem; }
.hub details[open] :is(.hub-field, .hub-event-list) { margin-top: .65rem; }

@media (max-width: 420px) {
  .hub { width: calc(100% - 20px); }
  .hub-panel, .hub-hero { padding: 12px; }
  .hub button.hub-event-day { flex-direction: column; gap: 0; line-height: 1.1; }
  .hub-event-list time { flex-basis: 100%; }
  .hub-compare :is(th, td) { padding-inline: .3rem; }
}

@media (max-width: 370px) {
  .hub .hub-month { display: none; }
}
