:root {
  --bg: #0B0B0D;
  --bg-2: #101012;
  --surface: #141417;
  --surface-2: #18181B;
  --surface-3: #1D1D21;
  --border: #2C2C31;
  --border-strong: #3D3D43;
  --border-bright: #5A5A60;
  --text: #E6E6E9;
  --text-strong: #F2F2F4;
  --text-muted: #B4B4BA;
  --text-dim: #82828A;
  --text-faint: #56565C;
  --accent: #E6E6E9;
  --accent-hover: #C8C8CC;
  --danger: #F47174;
  --danger-soft: rgba(244, 113, 116, 0.10);
  --radius: 2px;
  --radius-sm: 0px;
  --radius-lg: 4px;
  --font-sans: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color-scheme: dark;
}

body {
  margin: 0;
  padding: 28px 18px;
  padding-top: max(28px, env(safe-area-inset-top));
  padding-bottom: max(28px, env(safe-area-inset-bottom));
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.shell {
  max-width: 820px;
  margin: 0 auto;
}

a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dotted var(--text-dim);
  padding-bottom: 1px;
  transition: border-color 120ms ease, color 120ms ease;
}

a:hover,
a:focus-visible {
  text-decoration: none;
  border-bottom-color: var(--text);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 3px;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

input {
  font: inherit;
  color: inherit;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

/* Header */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--border-strong);
}

.brand {
  flex-shrink: 0;
  min-width: 0;
}

.status-dot {
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 0;
  padding-bottom: 0;
}

.brand:hover,
.brand:focus-visible {
  border-bottom: 0;
}

.brand-icon {
  width: 22px;
  height: 22px;
  color: var(--text);
  display: inline-flex;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  text-transform: uppercase;
}

.header-link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.header-link:hover,
.header-link:focus-visible {
  color: var(--text);
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-dot::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 3px rgba(230, 230, 233, 0.06);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Hero */

.hero {
  margin-bottom: 40px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.eyebrow::before {
  content: ">";
  color: var(--text);
}

.hero h1 {
  font-family: var(--font-mono);
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-strong);
}

.hero-sub {
  margin-top: 18px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.65;
  max-width: 64ch;
}

.hero-meta {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--border);
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-right: 1px solid var(--border);
}

.hero-meta span:last-child {
  border-right: 0;
}

.hero-meta span + span::before {
  content: none;
}

/* Notice */

.notice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  margin-bottom: 36px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
  position: relative;
}

.notice::before {
  content: "[!]";
  position: absolute;
  top: -1px;
  left: -1px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  transform: translateY(-100%);
}

.notice-icon {
  display: none;
}

.notice strong {
  color: var(--text);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
  display: inline-block;
  margin-bottom: 4px;
}

.notice a {
  color: var(--text);
  border-bottom-color: var(--text-dim);
}

.notice a:hover {
  border-bottom-color: var(--text);
}

/* Section label */

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::before {
  content: ">";
  color: var(--text);
}

.section-label .count {
  margin-left: auto;
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 0.06em;
}

/* Form */

.form-block {
  margin-bottom: 14px;
}

.form {
  display: flex;
  gap: 0;
  margin-bottom: 10px;
  border: 1px solid var(--border-strong);
}

.form:focus-within {
  border-color: var(--text);
}

.input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 56px;
  padding: 0 16px;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 16px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  color: var(--text);
  transition: background 120ms ease;
}

.input::placeholder {
  color: var(--text-dim);
  text-transform: lowercase;
  letter-spacing: 0.02em;
  opacity: 1;
}

.input:focus {
  outline: none;
  background: var(--surface);
}

.btn {
  height: 56px;
  min-width: 132px;
  padding: 0 22px;
  background: var(--text);
  color: var(--bg);
  border: 0;
  border-left: 1px solid var(--text);
  border-radius: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 120ms ease, color 120ms ease, transform 80ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

.btn:disabled {
  background: var(--surface);
  color: var(--text-dim);
  border-left-color: var(--border);
  cursor: not-allowed;
}

@media (hover: hover) {
  .btn:not(:disabled):hover {
    background: var(--accent-hover);
  }
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(11, 11, 13, 0.25);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.form-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Status */

.status {
  min-height: 22px;
  margin: 18px 0 24px;
  padding-left: 18px;
  position: relative;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status:not(:empty)::before {
  content: ">";
  position: absolute;
  left: 0;
  color: var(--text);
}

.status[data-state="error"] {
  color: var(--danger);
}

.status[data-state="error"]::before {
  color: var(--danger);
  content: "!";
}

.status[data-state="success"] {
  color: var(--text);
}

.status[data-state="success"]::before {
  color: var(--text);
  content: "OK";
  font-size: 10px;
  font-weight: 700;
}

.status[data-state="success"] {
  padding-left: 28px;
}

/* Results */

.results-section,
.recents-section {
  margin-bottom: 36px;
}

.results {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.result {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  animation: fadein 180ms ease-out;
}

.result:last-child {
  border-bottom: 0;
}

@media (hover: hover) {
  .result:hover {
    background: var(--surface);
  }
}

@keyframes fadein {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-marker {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0;
}

.result-marker::before {
  content: "[+]";
}

.result-marker {
  width: auto;
  height: auto;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.result-ip {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}

.result-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: transparent;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}

.icon-btn svg {
  width: 14px;
  height: 14px;
}

@media (hover: hover) {
  .icon-btn:hover {
    color: var(--bg);
    background: var(--text);
    border-color: var(--text);
  }
}

.icon-btn:focus-visible {
  color: var(--bg);
  background: var(--text);
  border-color: var(--text);
}

.icon-btn[data-copied="true"] {
  color: var(--bg);
  background: var(--text);
  border-color: var(--text);
}

/* Recents */

.recents {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.recent {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0;
  overflow: hidden;
}

@media (hover: hover) {
  .recent:hover {
    border-color: var(--text);
  }
}

.recent-tag {
  padding: 6px 12px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text);
  letter-spacing: 0.02em;
}

@media (hover: hover) {
  .recent-tag:hover {
    background: var(--surface);
  }
}

.recent-remove {
  width: 28px;
  height: 30px;
  color: var(--text-dim);
  border-left: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.recent-remove svg {
  width: 12px;
  height: 12px;
}

@media (hover: hover) {
  .recent-remove:hover {
    color: var(--bg);
    background: var(--text);
  }
}

/* Empty state */

.empty {
  padding: 18px 14px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 0;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  font-family: var(--font-mono);
}

/* Footer */

.footer {
  margin-top: 80px;
  padding: 22px 0 4px;
  border-top: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 0;
}

.footer-brand:hover,
.footer-brand:focus-visible {
  border-bottom: 0;
  color: var(--text);
}

.footer-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0;
}

.footer-nav {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}

.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  padding-bottom: 1px;
  transition: color 120ms ease, border-color 120ms ease;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--text);
  border-bottom-color: var(--text);
}

.footer-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: lowercase;
  gap: 6px 24px;
  justify-content: flex-start;
}

.footer-meta .footer-inline {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dotted var(--text-dim);
  padding-bottom: 1px;
  transition: border-color 120ms ease;
}

.footer-meta .footer-inline:hover,
.footer-meta .footer-inline:focus-visible {
  border-bottom-color: var(--text);
}

/* Terms page */

.prose {
  max-width: 760px;
  margin: 0 auto;
  font-family: var(--font-mono);
}

.prose h1 {
  font-family: var(--font-mono);
  font-size: 32px;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.prose .updated {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 40px;
}

.prose h2 {
  font-family: var(--font-mono);
  font-size: 14px;
  margin-top: 36px;
  margin-bottom: 12px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.prose p {
  margin-bottom: 14px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
}

.prose ul {
  margin: 0 0 14px;
  padding-left: 22px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
}

.prose li {
  margin-bottom: 6px;
}

.prose .back {
  margin-top: 40px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Visually hidden helper */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Larger viewports */

@media (min-width: 640px) {
  body {
    padding: 56px 28px;
  }
  .hero h1 {
    font-size: 56px;
  }
  .hero-sub {
    font-size: 15px;
  }
  .header {
    margin-bottom: 56px;
  }
}

@media (min-width: 900px) {
  body {
    padding: 72px 28px;
  }
  .hero h1 {
    font-size: 68px;
  }
}

/* Small screens */

@media (max-width: 520px) {
  body {
    padding: 24px 16px;
    padding-top: max(24px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  .header {
    margin-bottom: 32px;
    padding-bottom: 14px;
  }
  .hero {
    margin-bottom: 32px;
  }
  .hero h1 {
    font-size: 32px;
  }
  .hero-sub {
    font-size: 13.5px;
    margin-top: 14px;
  }
  .hero-meta {
    flex-direction: column;
  }
  .hero-meta span {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 8px 12px;
  }
  .hero-meta span:last-child {
    border-bottom: 0;
  }
  .form {
    flex-direction: column;
  }
  .input {
    width: 100%;
    flex: none;
    height: 52px;
    padding: 0 14px;
    font-size: 16px;
  }
  .btn {
    width: 100%;
    flex: none;
    height: 52px;
    border-left: 0;
    border-top: 1px solid var(--text);
    font-size: 12px;
    letter-spacing: 0.1em;
  }
  .status-dot {
    display: none;
  }
  .notice {
    padding: 16px;
    margin-bottom: 28px;
    font-size: 12.5px;
    line-height: 1.6;
  }
  .notice strong {
    font-size: 11px;
  }
  .section-label {
    font-size: 10.5px;
  }
  .result {
    flex-wrap: wrap;
    padding: 12px 14px;
    gap: 10px;
    column-gap: 10px;
    row-gap: 6px;
  }
  .result-marker {
    font-size: 10.5px;
  }
  .result-ip {
    font-size: 13.5px;
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-all;
  }
  .result-time {
    flex: 1 1 100%;
    order: 5;
    padding-left: 24px;
    font-size: 10.5px;
  }
  .icon-btn {
    width: 34px;
    height: 34px;
  }
  .icon-btn svg {
    width: 14px;
    height: 14px;
  }
  .recent-tag {
    padding: 6px 10px;
    font-size: 11.5px;
  }
  .recent-remove {
    width: 26px;
    height: 28px;
  }
  .status {
    margin: 14px 0 20px;
    font-size: 11.5px;
  }
  .footer {
    margin-top: 56px;
    padding-top: 18px;
  }
  .footer-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .footer-meta {
    flex-direction: column;
    align-items: flex-start;
  }
  .prose h1 {
    font-size: 26px;
  }
  .prose h2 {
    font-size: 13px;
    margin-top: 28px;
  }
  .prose p,
  .prose ul {
    font-size: 12.5px;
  }
}

/* Very narrow phones */

@media (max-width: 380px) {
  .brand {
    font-size: 13px;
    gap: 10px;
  }
  .brand-icon {
    width: 20px;
    height: 20px;
  }
  .brand-tag {
    display: none;
  }
  .hero h1 {
    font-size: 26px;
    letter-spacing: -0.02em;
  }
  .hero-meta {
    font-size: 10px;
  }
  .input {
    padding: 0 12px;
    font-size: 14px;
  }
  .btn {
    font-size: 11px;
    letter-spacing: 0.08em;
  }
  .result-ip {
    font-size: 12.5px;
  }
  .footer-brand {
    font-size: 12px;
  }
  .footer-nav {
    gap: 16px;
    font-size: 11.5px;
  }
}

/* Long-string safety */

.input,
.result-ip,
.recent-tag,
.notice,
.hero-sub,
.prose p,
.prose li {
  overflow-wrap: anywhere;
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
