/* Blank Calendar PDF — uses the shared color tokens from assets/style.css */

body.wide {
  max-width: 1080px;
}

[hidden] {
  display: none !important;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.back-link {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.lang-toggle {
  display: flex;
  gap: 0.25rem;
}

.lang-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.7;
}

.lang-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  opacity: 1;
}

.lang-btn[aria-checked="true"] {
  border-color: var(--accent);
  color: var(--accent);
  opacity: 1;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.spec-line {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--fg);
  opacity: 0.7;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.45rem 0;
  margin: 0 0 1rem;
}

.lede {
  opacity: 0.8;
  max-width: 62ch;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: start;
}

@media (max-width: 820px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

.field-group h2 {
  font-size: 1rem;
  margin: 0 0 0.6rem;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}

.field-row label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  flex: 1;
  min-width: 90px;
}

.field-row.seg {
  gap: 1rem;
}

.field-row.seg label,
.check-line,
.zones-row label {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  min-width: 0;
  cursor: pointer;
}

.seg-label {
  font-size: 0.85rem;
  opacity: 0.8;
}

.sub-label {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 1rem 0 0.4rem;
}

.check-line {
  display: inline-flex;
  font-size: 0.9rem;
}

select,
input[type="text"],
input[type="date"] {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--fg);
  font-size: 0.95rem;
  width: 100%;
  font-family: inherit;
}

select {
  cursor: pointer;
}

select:focus-visible,
input:focus-visible,
button:focus-visible,
.theme-swatch:focus-visible,
.orientation-option:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Color scheme swatches --- */

.theme-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  font-size: 0.75rem;
  min-width: 68px;
}

.theme-swatch:hover {
  border-color: var(--accent);
}

.theme-swatch[aria-checked="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.theme-swatch .swatch-strip {
  display: flex;
  border-radius: 4px;
  overflow: hidden;
  width: 54px;
  height: 20px;
  border: 1px solid var(--border);
}

.theme-swatch .swatch-strip span {
  flex: 1;
}

/* --- Orientation toggle (shared pattern with photo-frame-pdf) --- */

.orientation-row {
  display: flex;
  gap: 0.4rem;
}

.orientation-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.75;
}

.orientation-option:hover,
.orientation-option:has(input:checked) {
  border-color: var(--accent);
  color: var(--accent);
  opacity: 1;
}

.orientation-option input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.orientation-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
}

/* --- Period list --- */

.period-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.period-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
}

.period-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid var(--border);
  flex: 0 0 auto;
}

.period-text {
  flex: 1;
  min-width: 0;
}

.remove-period-btn {
  width: 1.4rem;
  height: 1.4rem;
  line-height: 1;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--fg);
  opacity: 0.6;
  cursor: pointer;
  font-size: 0.9rem;
  flex: 0 0 auto;
}

.remove-period-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  opacity: 1;
}

.add-period {
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.add-period summary {
  cursor: pointer;
  color: var(--accent);
}

.add-period-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

/* --- Buttons --- */

button.primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 600;
}

button.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
}

button.secondary:hover {
  border-color: var(--accent);
}

.status-msg {
  font-size: 0.82rem;
  min-height: 1.2em;
  opacity: 0.85;
}

/* --- Preview --- */

.preview-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  width: 100%;
}

.pages-preview {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  width: 100%;
  min-height: 200px;
}

.page-svg {
  width: var(--sheet-w, 240px);
  height: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.preview-note {
  font-size: 0.82rem;
  opacity: 0.7;
  text-align: center;
}

@media (prefers-reduced-motion: no-preference) {
  .theme-swatch,
  button.secondary,
  button.primary,
  .remove-period-btn,
  .orientation-option {
    transition: border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
  }
}
