:root {
  color-scheme: only light;
  --ink: #0f172a;
  --muted: #4b5563;
  --border: #e5e7eb;
  --background: #f1f5f9;
  --card: #ffffff;
  --brand: #c2410c;
  --brand-dark: #9a3412;
  --brand-soft: #fff7ed;
  --button-text: #ffffff;
}
:root[data-theme="dark"] {
  --ink: #f1f5f9;
  --muted: #cbd5e1;
  --border: #475569;
  --background: #020617;
  --card: #111827;
  --brand: #facc15;
  --brand-dark: #fde047;
  --brand-soft: #293548;
  --button-text: #111827;
}
/* Keep the iframe canvas transparent, even when the widget itself is dark. */
:root[data-theme="dark"] .widget { color-scheme: dark; }
* { box-sizing: border-box; }
html { font: 16px/1.42 system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: transparent; }
body { margin: 0; padding: 4px; color: var(--ink); background: transparent; }
[hidden] { display: none !important; }
.widget {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 3px 10px rgb(14 49 75 / 6%); overflow: hidden;
}
.widget-main { padding: 18px 20px 17px; }
.eyebrow { font-size: 0.74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin: 0 0 9px; }
.heading-row { display: flex; gap: 8px 12px; flex-wrap: wrap; justify-content: space-between; align-items: baseline; }
.period { font-size: .78rem; font-weight: 600; color: var(--muted); }
.category { color: var(--brand); font-size: .82rem; font-weight: 650; margin: 4px 0 8px; }
h1 { font-size: clamp(1.15rem, 4vw, 1.45rem); line-height: 1.25; letter-spacing: -.02em; margin: 4px 0 12px; }
.summary { color: var(--muted); margin: 0 0 18px; font-size: .92rem; line-height: 1.5; overflow-wrap: anywhere; }
.summary.limit { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.primary {
  display: inline-block; background: var(--brand); color: var(--button-text);
  padding: 10px 15px; border: none; border-radius: 8px; font-weight: 750; font-size: .87rem;
  line-height: 1.3; text-decoration: none; cursor: pointer; font-family: inherit;
}
:root:not([data-theme="dark"]) .primary { color: #fff; }
.primary:hover, .primary:focus-visible { filter: brightness(.91); }
.secondary {
  appearance: none; background: var(--brand-soft); color: var(--brand-dark);
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
  padding: 9px 13px; font-size: .85rem; font-weight: 700; font-family: inherit;
}
.secondary:hover { filter: brightness(.94); }
.meta { color: var(--muted); font-size: .78rem; }
.topnote { color: var(--muted); font-size: .87rem; margin: 0 0 14px; }
.widget-bottom { border-top: 1px solid var(--border); background: var(--background); padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.widget-bottom span { color: var(--muted); font-size: .72rem; }
.widget-bottom a { color: var(--brand-dark); font-size: .85rem; font-weight: 700; text-decoration: none; }
.widget-bottom a:hover { text-decoration: underline; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 13px 0 15px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field label { font-weight: 700; font-size: .79rem; }
.field input, .field select {
  min-width: 0; width: 100%; background: var(--card); color: var(--ink);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 9px;
  font: inherit; font-size: .87rem;
}
.field input:focus-visible, .field select:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.status { color: var(--muted); font-size: .83rem; margin-top: 8px; min-height: 1.4em; }
/* Featured cards do not need to reserve space for an empty live region. */
body[data-widget="daily"] .status:empty,
body[data-widget="weekly"] .status:empty { display: none; }
.result { background: var(--background); border: 1px solid var(--border); border-radius: 10px; padding: 13px 14px; margin-top: 16px; }
.result h2 { font-size: 1.22rem; line-height: 1.25; margin: 4px 0 8px; }
.result .summary { margin-bottom: 12px; }
.result-placeholder { color: var(--muted); margin: 0; font-size: .87rem; }
.help-link { color: var(--brand-dark); font-weight: 700; text-decoration: underline; }
@media (max-width: 450px) {
  body { padding: 2px; }
  .widget-main { padding: 16px 14px; }
  .widget-bottom { padding: 9px 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .actions { align-items: stretch; }
  .actions > a, .actions > button { text-align: center; }
}
@media (prefers-reduced-motion: no-preference) {
  button, a.primary { transition: filter .12s ease; }
}

.search-form { display: grid; gap: 10px; }
.search-form .primary { justify-self: start; }
h1, h2 { overflow-wrap: anywhere; }

.widget-bottom a { display:inline-flex; align-items:center; gap:5px; }
.widget-bottom img { width:20px; height:20px; }
.eyebrow { border-bottom: 2px solid #facc15; padding-bottom: 8px; }
