:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #647084;
  --line: #d9e0ea;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --code: #0b1220;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

a {
  color: inherit;
}

.shell {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0;
}

.tool-shell {
  padding-top: 28px;
}

.mast {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
}

.mast.compact {
  margin-bottom: 20px;
}

.mark {
  flex: 0 0 auto;
  display: block;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.12;
  letter-spacing: 0;
}

.lede {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.tool-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 94px;
  padding: 18px;
  color: var(--ink);
  text-decoration: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tool-card:hover,
.tool-card:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.tool-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 8px;
  color: #ecfdf5;
  background: var(--accent);
  font-weight: 800;
  letter-spacing: 0;
}

.tool-card strong,
.tool-card small {
  display: block;
}

.tool-card strong {
  margin-bottom: 5px;
  font-size: 17px;
}

.tool-card small {
  color: var(--muted);
  line-height: 1.35;
}

.topbar {
  display: flex;
  gap: 8px;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 14px;
}

.topbar a {
  color: var(--accent-strong);
  text-decoration: none;
}

.converter {
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.converter + .converter {
  margin-top: 16px;
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.segmented {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segmented legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.segmented label {
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--muted);
}

.segmented input {
  margin-right: 6px;
}

.segmented label:has(input:checked) {
  color: #ffffff;
  background: var(--accent);
}

.ghost {
  min-height: 38px;
  padding: 0 14px;
  color: var(--accent-strong);
  background: #ecfdf5;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  cursor: pointer;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.field {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.section-head,
.timestamp-now {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
}

.section-head {
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 3px 0 0;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
}

.section-label {
  display: block;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.timestamp-code {
  margin-top: 7px;
  font-size: 32px;
  line-height: 1.2;
}

.subtle-line {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font: 13px/1.4 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

.field span,
.output span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: 15px/1.4 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

textarea {
  resize: vertical;
}

select {
  appearance: auto;
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(15, 118, 110, 0.15);
}

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

.output {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.output textarea {
  min-height: 74px;
  padding-right: 58px;
  background: transparent;
}

.output.wide {
  grid-column: 1 / -1;
}

.copy-link {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 30px;
  padding: 0 10px;
  color: var(--accent-strong);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.option-row {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.compact-field,
.check-field {
  display: grid;
  gap: 8px;
}

.compact-field span,
.check-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.check-field {
  grid-template-columns: auto 1fr;
  align-items: center;
  padding-bottom: 10px;
}

.check-field input {
  width: 18px;
  min-height: 18px;
  padding: 0;
}

.format-tabs {
  flex-wrap: wrap;
}

code {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--code);
  font: 14px/1.45 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

.message {
  min-height: 20px;
  margin: 14px 0 0;
  color: #b45309;
  font-size: 14px;
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 24px, 960px);
    padding: 28px 0;
  }

  .mast {
    align-items: flex-start;
  }

  h1 {
    font-size: 25px;
  }

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

  .option-row {
    grid-template-columns: 1fr;
  }

  .section-head,
  .timestamp-now {
    display: grid;
  }

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

  .timestamp-code {
    font-size: 25px;
  }
}
