:root {
  color-scheme: light;
  --background: #ffffff;
  --surface: #ffffff;
  --surface-muted: #ffffff;
  --text: #202124;
  --text-muted: #68717d;
  --border: #e7eaee;
  --accent: #2f6f68;
  --accent-hover: #265b55;
  --button-soft: #f3f8f7;
  --header-band: #f6faf9;
  --shadow: 0 14px 34px rgba(32, 33, 36, 0.08);
  --focus: 0 0 0 3px rgba(47, 111, 104, 0.22);
}

body.dark {
  color-scheme: dark;
  --background: #171918;
  --surface: #222624;
  --surface-muted: #171c1a;
  --text: #f4f2ee;
  --text-muted: #b8c0bb;
  --border: #39423e;
  --accent: #8ed3c8;
  --accent-hover: #a8e2d8;
  --button-soft: #24332f;
  --header-band: #1b2825;
  --shadow: 0 18px 38px rgba(0, 0, 0, 0.3);
  --focus: 0 0 0 3px rgba(142, 211, 200, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(100% - 32px, 860px);
  margin: 0 auto;
  padding: 48px 0 32px;
}

.site-header {
  margin-bottom: 24px;
  text-align: center;
}

.site-header h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.site-title-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0;
}

.site-title-button:hover {
  color: var(--accent);
}

.site-title-feedback {
  position: absolute;
  left: 50%;
  bottom: -30px;
  padding: 5px 10px;
  background: var(--accent);
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 150ms ease, transform 150ms ease;
  white-space: nowrap;
}

.site-title-button.copied .site-title-feedback {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.site-header p {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 1.08rem;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 0;
  padding: 18px 26px;
  background: var(--header-band);
  border-bottom: 1px solid var(--border);
}

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

.card-header h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.25;
}

.toggles {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 10px;
  background: var(--button-soft);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.92rem;
  user-select: none;
}

.header-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 700;
}

.header-action svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.theme-action .icon-sun,
body.dark .theme-action .icon-moon {
  display: none;
}

body.dark .theme-action .icon-sun {
  display: block;
}

.header-action:hover {
  background: var(--button-soft);
  color: var(--accent);
}

.header-action:disabled {
  cursor: wait;
  opacity: 0.7;
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.info-box {
  min-height: 380px;
  margin: 0;
  padding: 14px 26px;
  overflow-x: auto;
  background: var(--surface-muted);
  border-radius: 0;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.95rem;
  line-height: 1.7;
}

.info-row {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

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

.info-label {
  color: var(--accent);
  font-weight: 700;
}

.info-value {
  color: var(--text);
  overflow-wrap: anywhere;
}

.loading-message {
  color: var(--text-muted);
}

.actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 8px;
}

.actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  transition: background-color 150ms ease, transform 150ms ease;
}

.actions svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: currentColor;
}

.actions button:not(:first-child) {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.actions button:hover {
  background: var(--accent-hover);
}

.actions button:not(:first-child):hover {
  background: var(--button-soft);
}

.actions button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.actions button:active {
  transform: translateY(1px);
}

.actions button:focus-visible,
.header-action:focus-visible,
.site-title-button:focus-visible,
.toggle input:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.status-message {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--text-muted);
  text-align: center;
}

.privacy-note {
  max-width: 680px;
  margin: 36px auto 0;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.95rem;
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 24px, 900px);
    padding-top: 30px;
  }

  .info-card {
    padding: 0;
  }

  .card-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 18px;
  }

  .toggles {
    justify-content: flex-start;
  }

  .header-action {
    flex: 1 1 auto;
  }

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

@media (max-width: 460px) {
  .actions {
    grid-template-columns: 1fr;
  }

  .info-box {
    min-height: 340px;
    padding: 12px 18px;
    font-size: 0.88rem;
  }

  .info-row {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 10px 0;
  }
}

@media (max-width: 380px) {
  .header-action {
    width: 38px;
    padding: 0;
  }

  .header-action span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media print {
  body {
    background: #ffffff;
    color: #000000;
  }

  .page-shell {
    width: 100%;
    padding: 0;
  }

  .info-card {
    box-shadow: none;
  }

  .actions,
  .toggles,
  .status-message,
  .privacy-note {
    display: none;
  }
}
