:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #222;
  background: #fafafa;
  line-height: 1.5;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: #555; text-underline-offset: 3px; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
}

.shell { max-width: 680px; margin: 80px auto; padding: 0 24px; }
header { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
h1 { margin: 0; font-size: 1.25rem; font-weight: 600; }
header a { font-size: .875rem; }
.skip-link { position: absolute; top: -60px; left: 16px; }
.skip-link:focus { top: 12px; }

.result { background: #fff; border: 1px solid #d7d7d7; border-radius: 4px; padding: 24px; }
.code-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
#code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: clamp(1.25rem, 4.6vw, 1.875rem);
  font-weight: 600;
  overflow-wrap: anywhere;
  user-select: all;
  min-width: 0;
}
#copy { color: #fff; background: #222; border: 1px solid #222; border-radius: 3px; padding: 8px 18px; min-width: 88px; }
#copy:hover { background: #444; }
.validity { color: #666; font-size: .875rem; margin: 14px 0 0; }
.copy-status { font-size: .875rem; margin: 12px 0 0; }
.copy-status:empty { display: none; }

.options { display: flex; flex-wrap: wrap; gap: 20px 32px; margin-top: 24px; }
.date-control { flex: 1 1 240px; }
.date-control > label, legend { display: block; font-size: .875rem; margin-bottom: 8px; }
.date-row { display: flex; align-items: center; gap: 8px; }
input[type=date] { min-width: 0; width: 100%; padding: 8px 10px; border: 1px solid #bdbdbd; border-radius: 3px; background: #fff; color: #222; }
#today { padding: 8px 10px; border: 1px solid #bdbdbd; border-radius: 3px; background: #fff; }
#today:hover { background: #eee; }
fieldset { margin: 0; padding: 0; border: 0; flex: 0 1 190px; }
.periods { display: flex; gap: 20px; min-height: 42px; align-items: center; }
.periods label { display: flex; align-items: center; gap: 6px; font-size: .875rem; cursor: pointer; white-space: nowrap; }
.periods input { margin: 0; accent-color: #222; width: 16px; height: 16px; }
.error { color: #b42318; font-size: .875rem; margin: 0; flex-basis: 100%; }
footer { display: flex; gap: 16px; border-top: 1px solid #ddd; margin-top: 32px; padding-top: 16px; font-size: .75rem; }

@media (max-width: 480px) {
  .shell { margin-top: 32px; padding: 0 20px; }
  header { align-items: flex-start; gap: 16px; }
  h1 { font-size: 1.125rem; }
  .result { padding: 20px; }
  #copy { width: 100%; }
  .options { gap: 16px; }
}
