:root {
  color-scheme: dark;
  --background: #0e0e0e;
  --surface: #1c1c1c;
  --surface-soft: #242424;
  --workspace: #111111;
  --ink: #ffffff;
  --muted: #aaaaaa;
  --line: #312f40;
  --accent: #ffa000;
  --accent-strong: #ffb52e;
  --accent-soft: #3a2a0b;
  --yellow: #ffa000;
  --teal: #dd4e36;
  --danger: #ef624c;
  --shadow: 0 10px 28px rgb(0 0 0 / 32%);
  --radius: 4px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --background: #0e0e0e;
  --surface: #1c1c1c;
  --surface-soft: #242424;
  --workspace: #111111;
  --ink: #ffffff;
  --muted: #aaaaaa;
  --line: #312f40;
  --accent: #ffa000;
  --accent-strong: #ffb52e;
  --accent-soft: #3a2a0b;
  --shadow: 0 10px 28px rgb(0 0 0 / 32%);
}

[data-theme="light"] {
  color-scheme: light;
  --background: #f2f2f2;
  --surface: #ffffff;
  --surface-soft: #e8e8e8;
  --workspace: #f7f7f7;
  --ink: #171717;
  --muted: #666666;
  --line: #d1d1d1;
  --accent: #d96d00;
  --accent-strong: #b85400;
  --accent-soft: #ffead0;
  --shadow: 0 8px 24px rgb(0 0 0 / 10%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family:
    "Fira Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header,
.ad-section,
.site-footer,
#app {
  width: min(1100px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--accent);
  background: color-mix(in srgb, var(--background) 96%, transparent);
  box-shadow: 0 8px 18px rgb(0 0 0 / 16%);
  backdrop-filter: blur(12px);
}

.ad-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 10px;
}

.ad-slot {
  position: relative;
  display: grid;
  min-height: 90px;
  place-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, transparent 0 48%, rgb(255 160 0 / 5%) 48% 52%, transparent 52%),
    var(--surface);
  color: var(--muted);
  text-align: center;
}

.ad-slot::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgb(255 255 255 / 3%);
  content: "";
  pointer-events: none;
}

.ad-label {
  position: absolute;
  top: 5px;
  right: 7px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ad-slot strong {
  color: var(--ink);
  font-family: Inter, sans-serif;
  font-size: 13px;
}

.ad-slot small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: Inter, sans-serif;
  font-size: 20px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  padding: 5px;
  border: 1px solid #333333;
  border-radius: 4px;
  background: #111111;
}

.brand-mark span {
  border-radius: 1px;
  background: var(--accent);
}

.brand-mark span:nth-child(2) {
  background: var(--danger);
}

.brand-mark span:nth-child(3) {
  background: #333333;
}

.brand-mark span:nth-child(4) {
  background: #ffffff;
}

.header-actions,
.toolbar,
.categories,
.tool-actions,
.tool-meta,
.field-header,
.output-actions {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 8px;
}

.language-picker {
  position: relative;
  display: inline-flex;
  height: 40px;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 11px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface-soft);
}

.language-picker:focus-within,
.language-picker:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.language-picker select {
  height: 100%;
  padding: 0 18px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.language-picker option {
  background: var(--surface-soft);
  color: var(--ink);
}

.icon-button,
.github-link,
.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface-soft);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.icon-button {
  width: 40px;
  padding: 0;
}

.github-link,
.button {
  padding: 0 14px;
  font-size: 14px;
  font-weight: 650;
}

.icon-button:hover,
.github-link:hover,
.button:hover {
  border-color: var(--accent);
  background: #272727;
  color: var(--accent);
}

.button:active,
.icon-button:active {
  transform: translateY(1px);
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #111111;
}

.button.primary:hover {
  background: var(--accent-strong);
  color: #111111;
}

.button.danger {
  color: var(--danger);
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.hero {
  padding: 24px 0 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: Inter, sans-serif;
}

.hero h1 {
  max-width: none;
  margin-bottom: 9px;
  font-size: clamp(24px, 4vw, 40px);
  line-height: 1.12;
  letter-spacing: 0;
  white-space: nowrap;
}

.hero-copy {
  width: 100%;
  max-width: none;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.toolbar {
  position: sticky;
  z-index: 5;
  top: 8px;
  justify-content: space-between;
  gap: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.search-field {
  position: relative;
  width: min(430px, 100%);
}

.search-field svg {
  position: absolute;
  top: 50%;
  left: 13px;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-field input,
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 3px;
  outline: none;
  background: var(--workspace);
}

.search-field input {
  height: 40px;
  padding: 0 14px 0 42px;
}

.search-field input:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tool-count {
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.categories {
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 2px;
  scrollbar-width: none;
}

.categories::-webkit-scrollbar {
  display: none;
}

.category-button {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}

.category-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #111111;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 16px 0 10px;
  padding: 8px 10px;
  border-left: 4px solid var(--accent);
  background: var(--surface-soft);
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: 17px;
}

.section-heading p {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 14px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.tool-card {
  position: relative;
  display: flex;
  min-height: 148px;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.tool-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.tool-icon {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 12px;
  place-items: center;
  border: 1px solid #654714;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent);
}

.tool-card:nth-child(3n + 2) .tool-icon {
  border-color: #693326;
  background: #351d18;
  color: var(--danger);
}

.tool-card:nth-child(3n + 3) .tool-icon {
  border-color: #444444;
  background: #252525;
  color: #cccccc;
}

.tool-card h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.tool-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.tool-card .arrow {
  position: absolute;
  top: 22px;
  right: 22px;
  color: var(--muted);
  transition: transform 180ms ease;
}

.tool-card:hover .arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 70px 20px;
  color: var(--muted);
  text-align: center;
}

.privacy-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  margin: 28px 0 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.privacy-strip h2 {
  margin-bottom: 7px;
  font-size: 17px;
}

.privacy-strip p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (min-width: 801px) {
  .privacy-strip p {
    white-space: nowrap;
  }
}

.privacy-strip .tool-icon {
  margin: 0;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto auto auto auto;
  gap: 24px;
  align-items: center;
  margin-top: 30px;
  padding: 20px 0 26px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.site-footer p {
  margin: 0;
}

.footer-link {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.footer-link:hover {
  color: var(--accent);
}

.policy-page {
  width: min(820px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.policy-header {
  margin-bottom: 18px;
}

.policy-header h1 {
  margin: 10px 0 6px;
  font-family: Inter, sans-serif;
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.15;
}

.policy-header p,
.policy-section p,
.policy-section li {
  color: var(--muted);
}

.policy-section {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
}

.policy-section + .policy-section {
  margin-top: 10px;
}

.policy-section h2 {
  margin: 0 0 8px;
  font-family: Inter, sans-serif;
  font-size: 18px;
}

.policy-section p {
  margin: 0;
}

.policy-section p + p,
.policy-section ul {
  margin-top: 10px;
}

.policy-section a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.developer-credit {
  color: var(--muted);
  white-space: nowrap;
}

.developer-credit strong {
  color: var(--accent);
  font-weight: 700;
}

.footer-brand {
  color: var(--ink);
}

.tool-page {
  padding: 22px 0 18px;
}

.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumb:hover {
  color: var(--accent-strong);
}

.tool-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  width: 100%;
  margin-bottom: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tool-heading .tool-icon {
  width: 48px;
  height: 48px;
  margin: 0;
}

.tool-heading h1 {
  margin-bottom: 7px;
  overflow-wrap: anywhere;
  font-size: 28px;
}

.tool-heading p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.workspace.single {
  grid-template-columns: minmax(0, 720px);
}

.panel {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.tool-description {
  margin-top: 10px;
}

.tool-analytics {
  margin-top: 10px;
}

.analytics-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.analytics-heading .tool-icon {
  flex: 0 0 auto;
  margin: 0;
}

.analytics-heading h2 {
  margin: 0 0 4px;
  font-size: 17px;
}

.analytics-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.analytics-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.analytics-breakdown {
  margin-top: 12px;
}

.analytics-breakdown h3 {
  margin-bottom: 10px;
  font-size: 13px;
}

.analytics-list {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--workspace);
}

.analytics-row {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.analytics-row:last-child {
  border-bottom: 0;
}

.analytics-row strong {
  color: var(--accent);
  font-family: Inter, sans-serif;
}

.analytics-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.description-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.description-heading .tool-icon {
  flex: 0 0 auto;
  margin: 0;
}

.description-heading .eyebrow {
  margin-bottom: 3px;
  font-size: 10px;
}

.description-heading h2 {
  margin: 0;
  font-size: 17px;
}

.description-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.description-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 13px 13px 2px;
  border-right: 1px solid var(--line);
}

.description-item:first-child {
  padding-left: 0;
}

.description-item:last-child {
  padding-right: 0;
  border-right: 0;
}

.description-icon {
  color: var(--accent);
}

.description-item h3 {
  margin-bottom: 7px;
  font-size: 13px;
}

.description-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.field {
  margin-bottom: 11px;
}

.field:last-child {
  margin-bottom: 0;
}

.field-header {
  justify-content: space-between;
  min-height: 32px;
}

.field label,
.field-header label {
  font-size: 13px;
  font-weight: 750;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
}

.field input,
.field select {
  height: 40px;
  padding: 0 12px;
}

.field textarea {
  min-height: 310px;
  padding: 13px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
}

.tool-actions,
.output-actions {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.calculator-form .field {
  display: grid;
  gap: 7px;
}

.calculator-section-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--accent);
}

.calculator-section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.calculator-section-heading.secondary-heading {
  margin-top: 26px;
}

.calculator-error {
  min-height: 21px;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 13px;
}

.calculator-results {
  margin-top: 9px;
}

.money-value {
  overflow-wrap: anywhere;
  font-size: 20px;
}

.featured-result {
  border-color: color-mix(in srgb, var(--accent) 65%, var(--line));
  background: var(--accent-soft);
}

.formula-box {
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  background: var(--workspace);
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.6;
}

.sport-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--workspace);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.sport-notice svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--accent);
}

.sport-results {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sport-value {
  overflow-wrap: anywhere;
  font-size: 20px;
}

.time-inputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.field-group-label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 750;
}

.plate-result {
  grid-column: 1 / -1;
  padding: 13px;
  border: 1px solid var(--line);
  background: var(--workspace);
}

.plate-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.plate-chip {
  padding: 7px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}

.plate-empty {
  color: var(--muted);
  font-size: 13px;
}

.workout-plan {
  display: grid;
  gap: 8px;
}

.workout-day {
  display: grid;
  grid-template-columns: 72px minmax(130px, 0.7fr) minmax(180px, 1.3fr) minmax(150px, 0.7fr);
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--workspace);
}

.workout-day span,
.workout-day small {
  color: var(--muted);
  font-size: 12px;
}

.workout-day h3,
.workout-day p {
  margin: 0;
  font-size: 13px;
}

.workout-day p {
  color: var(--muted);
}

.table-wrap {
  margin-top: 11px;
  overflow-x: auto;
  border: 1px solid var(--line);
}

.training-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 13px;
}

.training-table th,
.training-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.training-table th {
  background: var(--workspace);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.training-table tbody tr:last-child td {
  border-bottom: 0;
}

.training-table strong {
  color: var(--accent);
}

.timer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.timer-panel {
  display: flex;
  min-height: 280px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.timer-phase {
  color: var(--accent);
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
}

.timer-round {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.timer-display {
  margin: 16px 0 20px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(54px, 8vw, 88px);
  line-height: 1;
}

.timer-progress {
  width: min(100%, 420px);
  height: 7px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--workspace);
}

.timer-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transition: width 250ms linear;
}

.timer-panel[data-phase="work"] .timer-phase,
.timer-panel[data-phase="work"] .timer-display {
  color: var(--accent);
}

.timer-panel[data-phase="rest"] .timer-phase {
  color: #65b88a;
}

.rep-controls {
  display: grid;
  grid-template-columns: 64px minmax(100px, 1fr) 64px;
  gap: 10px;
  align-items: center;
  margin: 14px 0;
}

.rep-controls strong {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 52px;
  text-align: center;
}

.rep-button {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: var(--accent);
  color: #111;
  cursor: pointer;
}

.rep-button.secondary {
  border-color: var(--line);
  background: var(--workspace);
  color: var(--ink);
}

.rep-history {
  margin-top: 15px;
}

.rep-history h2 {
  margin-bottom: 9px;
  font-size: 14px;
}

.rep-history-row {
  display: flex;
  justify-content: space-between;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  background: var(--workspace);
  font-size: 13px;
}

.rep-history-row strong {
  color: var(--accent);
}

.compact-textarea {
  min-height: 110px !important;
}

.fixture-rounds {
  display: grid;
  gap: 10px;
}

.fixture-round {
  border: 1px solid var(--line);
  background: var(--workspace);
}

.fixture-round h2 {
  margin: 0;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  color: var(--accent);
  font-size: 13px;
}

.fixture-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr);
  gap: 8px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.fixture-row:last-child {
  border-bottom: 0;
}

.fixture-row span:last-child {
  text-align: right;
}

.fixture-row strong {
  color: var(--muted);
  text-align: center;
}

.fixture-row.bye-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.team-panel {
  border: 1px solid var(--line);
  background: var(--workspace);
}

.team-panel > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
}

.team-panel h2 {
  margin: 0;
  font-size: 14px;
}

.team-panel span {
  color: var(--muted);
  font-size: 11px;
}

.team-panel ol {
  margin: 0;
  padding: 10px 11px 10px 36px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.bracket-list {
  display: grid;
  gap: 9px;
}

.bracket-match {
  display: grid;
  grid-template-columns: 85px minmax(0, 1fr) 50px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 11px;
  border: 1px solid var(--line);
  background: var(--workspace);
  font-size: 13px;
}

.bracket-match > span,
.bracket-match > strong {
  color: var(--muted);
}

.bracket-match > strong {
  text-align: center;
}

.scoreboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 310px;
}

.score-clock {
  grid-column: 1 / -1;
  text-align: center;
}

.score-clock span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.score-clock strong {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 34px;
}

.score-team {
  text-align: center;
}

.score-team h2 {
  min-height: 42px;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.score-team > strong {
  display: block;
  margin: 12px 0 16px;
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: clamp(58px, 9vw, 92px);
}

.score-team > div {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.score-button {
  display: grid;
  width: 46px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--workspace);
  color: var(--ink);
  cursor: pointer;
}

.score-button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #111;
}

.score-divider {
  color: var(--muted);
  font-size: 42px;
  font-weight: 800;
}

.standings-table {
  min-width: 760px;
}

.series-panel {
  min-height: 310px;
}

.series-status {
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.series-status span,
.series-status small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.series-status strong {
  display: block;
  margin: 7px 0;
  color: var(--accent);
  font-size: 18px;
}

.series-teams {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.series-teams > div {
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--workspace);
  text-align: center;
}

.series-teams h2 {
  min-height: 42px;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.series-teams > div > strong {
  display: block;
  margin: 12px 0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 56px;
}

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

.check-option {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--workspace);
  cursor: pointer;
  font-size: 13px;
}

.check-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.inline-check {
  width: fit-content;
  margin-bottom: 14px;
}

.password-output {
  min-height: 80px;
  padding: 18px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  background: var(--workspace);
  color: var(--accent);
  font-size: 18px;
  line-height: 1.6;
}

.password-output + .field-hint {
  margin-top: 10px;
}

.compact-result {
  min-height: 90px;
}

.prose-output {
  font-family: "Fira Sans", sans-serif;
  white-space: pre-wrap;
}

.markdown-preview {
  min-height: 310px;
  padding: 14px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  background: var(--workspace);
  line-height: 1.7;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3 {
  margin: 0 0 12px;
}

.markdown-preview h1 {
  font-size: 26px;
}

.markdown-preview h2 {
  font-size: 21px;
}

.markdown-preview h3 {
  font-size: 17px;
}

.markdown-preview p {
  margin-bottom: 14px;
}

.markdown-preview code {
  padding: 2px 5px;
  background: var(--surface-soft);
  color: var(--accent);
}

.markdown-preview blockquote {
  margin: 12px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.markdown-preview a {
  color: var(--accent);
  text-decoration: underline;
}

.date-value {
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.45;
}

.date-format-result {
  min-height: 92px;
}

.date-format-result .stat-value {
  font-size: 22px;
}

.calendar-result,
.day-result {
  min-height: 104px;
}

.calendar-result .stat-value,
.day-result .stat-value {
  font-size: 22px;
}

.calendar-note {
  margin: 12px 0 0;
  padding: 9px 11px;
  border-left: 3px solid var(--yellow);
  background: var(--workspace);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.calendar-note:empty {
  display: none;
}

.warning-text {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 14px;
  color: var(--yellow);
}

.warning-text svg {
  flex: 0 0 auto;
}

.result-heading {
  margin-top: 18px;
}

.jwt-result {
  min-height: 180px;
}

.color-preview {
  width: 100%;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--accent);
}

.qr-panel {
  display: grid;
  min-height: 320px;
  place-items: center;
}

.qr-panel canvas,
.qr-panel img {
  display: block;
  width: min(100%, 512px);
  height: auto;
  border: 10px solid #ffffff;
  background: #ffffff;
}

#qr-output {
  max-width: 100%;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.countdown-display {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.countdown-unit {
  min-width: 0;
  padding: 18px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface-soft);
  text-align: center;
}

.countdown-unit strong {
  display: block;
  color: var(--accent);
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.countdown-unit span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.countdown-status {
  margin: 14px 0 0;
  color: var(--muted);
  text-align: center;
}

.world-clock-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.world-clock-card {
  position: relative;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface-soft);
}

.world-clock-card > div {
  padding-right: 34px;
}

.world-clock-card strong,
.world-clock-card span {
  display: block;
  overflow-wrap: anywhere;
}

.world-clock-card span,
.world-clock-card p {
  color: var(--muted);
  font-size: 12px;
}

.world-clock-card time {
  display: block;
  margin: 16px 0 10px;
  color: var(--accent);
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 780;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.world-clock-card p {
  margin: 0;
}

.world-clock-remove {
  position: absolute;
  top: 9px;
  right: 9px;
}

.stat {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface-soft);
}

.stat-value {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-family: Inter, sans-serif;
  font-size: 25px;
  font-weight: 780;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
}

.result-box {
  min-height: 310px;
  padding: 13px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--workspace);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
}

.result-box.error {
  border-color: var(--danger);
  color: var(--danger);
}

.uuid-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.uuid-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: center;
  gap: 8px;
}

.uuid-item code {
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--workspace);
  text-overflow: ellipsis;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 22px;
  bottom: 22px;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--ink);
  color: var(--background);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 800px) {
  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .description-list {
    grid-template-columns: 1fr;
  }

  .description-item,
  .description-item:first-child,
  .description-item:last-child {
    padding: 11px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .description-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .site-footer {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 560px) {
  .countdown-display {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .world-clock-grid {
    grid-template-columns: 1fr;
  }

  .site-header,
  .ad-section,
  .site-footer,
  #app {
    width: min(100% - 28px, 1180px);
  }

  .site-header {
    min-height: 66px;
  }

  .ad-section {
    grid-template-columns: 1fr;
    gap: 6px;
    padding-top: 7px;
  }

  .ad-slot {
    min-height: 66px;
  }

  .github-link {
    width: 40px;
    padding: 0;
    font-size: 0;
  }

  .github-link span {
    display: none;
  }

  .language-picker {
    padding-inline: 8px;
  }

  .language-picker svg {
    display: none;
  }

  .hero {
    padding: 18px 0 14px;
  }

  .hero h1 {
    font-size: clamp(18px, 5.3vw, 23px);
  }

  .hero-copy {
    font-size: 13px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .tool-count {
    padding: 0 3px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

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

  .tool-card {
    display: grid;
    min-height: 82px;
    grid-template-columns: 36px minmax(0, 1fr) 22px;
    gap: 5px 10px;
    align-items: center;
    padding: 10px 12px;
  }

  .tool-card .tool-icon {
    grid-column: 1;
    grid-row: 1;
    width: 34px;
    height: 34px;
    margin: 0;
  }

  .tool-card h3 {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 14px;
  }

  .tool-card p {
    display: block;
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
  }

  .tool-card .arrow {
    position: static;
    display: grid;
    grid-column: 3;
    grid-row: 1;
    place-items: center;
  }

  .privacy-strip {
    grid-template-columns: 1fr;
  }

  .privacy-strip .tool-icon {
    order: -1;
  }

  .tool-heading h1 {
    font-size: 27px;
  }

  .tool-heading {
    align-items: start;
  }

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

  .time-inputs {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .workout-day {
    grid-template-columns: 1fr;
    gap: 5px;
  }

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

  .bracket-match {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .bracket-match > strong {
    text-align: left;
  }

  .series-teams {
    grid-template-columns: 1fr;
  }

  .field textarea,
  .result-box {
    min-height: 260px;
  }
}
