:root {
  color-scheme: light;
  --bg: #f3f6fa;
  --panel: #ffffff;
  --ink: #17212b;
  --muted: #667384;
  --line: #d9e1ea;
  --soft-line: #e8edf3;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff5ff;
  --teal: #0f766e;
  --teal-soft: #ecf8f6;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(26, 37, 55, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.09), transparent 32%),
    var(--bg);
  color: var(--ink);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

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

button {
  color: inherit;
}

h1,
h2,
p {
  margin: 0;
}

.app-shell {
  display: grid;
  gap: 22px;
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 24px;
}

.tool-header,
.now-panel,
.converter-card,
.guide-panel {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.tool-header,
.now-panel,
.converter-card,
.guide-panel {
  padding: 24px;
}

.brand-row,
.brand,
.section-heading,
.button-row {
  display: flex;
  align-items: center;
}

.brand-row,
.section-heading {
  justify-content: space-between;
  gap: 18px;
}

.brand {
  min-width: 0;
  gap: 12px;
}

.brand > div,
.section-heading > div {
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  box-shadow: inset 0 -8px 20px rgba(0, 0, 0, 0.12);
}

h1 {
  font-size: 22px;
  line-height: 1.15;
}

h2 {
  font-size: 19px;
  line-height: 1.2;
}

.brand p,
.privacy-note,
.section-heading > span,
.field-help,
.status,
.precision-note,
.hero-result span,
.hero-result small,
.detail-list dt,
.timestamp-values span,
.guide-grid span,
.guide-note {
  color: var(--muted);
}

.brand p {
  margin-top: 3px;
}

.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 68px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  text-decoration: none;
}

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

.privacy-note {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #f7f9fc;
  font-size: 13px;
}

.now-panel,
.converter-card,
.guide-panel {
  display: grid;
  gap: 18px;
}

.eyebrow {
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-heading > span {
  flex: 0 0 auto;
  font-size: 13px;
}

.current-date {
  min-width: 0;
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 820;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

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

.now-value {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.now-value:hover,
.now-value:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
  transform: translateY(-1px);
}

.now-value span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.now-value strong {
  min-width: 0;
  overflow: hidden;
  font: 760 15px/1.35 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.now-value small,
.precision-note {
  color: var(--muted);
  font-size: 11px;
}

.converter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: start;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(150px, 0.55fr);
  gap: 12px;
}

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

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field > span,
.timezone-field legend {
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
}

.field small {
  color: var(--muted);
  font-weight: 500;
}

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

input,
select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

#timestampInput,
#subsecondInput {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

input:focus,
select:focus {
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

input::placeholder {
  color: #98a3b2;
}

.button-row {
  flex-wrap: wrap;
  gap: 8px;
}

.primary-action,
.secondary-action,
.copy-button {
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 780;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.primary-action,
.secondary-action {
  height: 42px;
  padding: 0 14px;
}

.primary-action {
  flex: 1 1 180px;
  border: 0;
  background: var(--accent);
  color: #ffffff;
}

.primary-action:hover,
.primary-action:focus-visible {
  background: var(--accent-hover);
  outline: none;
  transform: translateY(-1px);
}

.secondary-action,
.copy-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
}

.secondary-action:hover,
.secondary-action:focus-visible,
.copy-button:hover,
.copy-button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.field-help,
.status {
  min-height: 20px;
  font-size: 12px;
}

.status {
  padding: 10px 12px;
  border-radius: var(--radius);
  background: #f7f9fc;
}

.status.is-success {
  background: var(--teal-soft);
  color: var(--teal);
}

.status.is-error {
  background: #fff2f0;
  color: var(--danger);
}

.result-stack {
  display: grid;
  gap: 14px;
}

.hero-result {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 18px;
  border: 1px solid #cfdbef;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f7faff, #f2f8ff);
}

.hero-result output {
  min-width: 0;
  font-size: clamp(19px, 3vw, 25px);
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.hero-result small {
  font-size: 12px;
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(110px, 0.32fr) minmax(0, 1fr);
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
}

.detail-list dt,
.detail-list dd {
  min-width: 0;
  margin: 0;
  padding: 11px 12px;
  border-bottom: 1px solid var(--soft-line);
}

.detail-list dt {
  background: #f8fafc;
  font-size: 12px;
  font-weight: 760;
}

.detail-list dd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.detail-list dt:last-of-type,
.detail-list dd:last-of-type {
  border-bottom: 0;
}

.detail-list code,
.timestamp-values code,
.guide-grid code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.detail-list code {
  min-width: 0;
  overflow-wrap: anywhere;
}

.timestamp-values {
  display: grid;
  gap: 8px;
}

.timestamp-values article {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.timestamp-values span {
  font-size: 12px;
  font-weight: 700;
}

.timestamp-values code {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-button {
  min-width: 52px;
  height: 30px;
  padding: 0 8px;
  font-size: 11px;
}

.timezone-field {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 18px;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.timezone-field legend {
  padding: 0 5px;
}

.timezone-field label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 13px;
}

.timezone-field input {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  box-shadow: none;
}

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

.guide-grid article {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.guide-grid strong {
  font-size: 14px;
}

.guide-grid span {
  font-size: 12px;
}

.guide-grid code {
  min-width: 0;
  overflow: hidden;
  color: var(--accent);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guide-note {
  font-size: 13px;
}

.site-footer {
  color: var(--muted);
  font-size: 12px;
}

[hidden] {
  display: none !important;
}

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

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 28px, 1240px);
    padding-top: 18px;
  }

  .tool-header,
  .now-panel,
  .converter-card,
  .guide-panel {
    padding: 18px;
  }

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

  .form-grid,
  .date-form {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .brand-row {
    align-items: flex-start;
  }

  .brand p,
  .section-heading > span {
    display: none;
  }

  .now-grid,
  .guide-grid {
    grid-template-columns: 1fr;
  }

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

  .primary-action {
    grid-column: 1 / -1;
  }

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

  .detail-list dt,
  .detail-list dd {
    border-bottom: 0;
  }

  .detail-list dd {
    border-bottom: 1px solid var(--soft-line);
  }

  .timestamp-values article {
    grid-template-columns: 1fr auto;
  }

  .timestamp-values code {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .timestamp-values .copy-button {
    grid-column: 2;
    grid-row: 1;
  }
}
