/* Kopplat: paste into Cards > Styling, replacing the old CSS.
   Applies to all cards using this note type. No field/template edits needed.
   Anki's selected theme takes precedence over the operating-system theme. */
.card {
 --kopplat-background: #f7f8fa;
 --kopplat-text: #202734;
 --kopplat-muted: #515e70;
 --kopplat-link: #1459a6;
 --kopplat-code: #e8edf4;
 --kopplat-border: #9ba8ba;
 color-scheme: light;
 box-sizing: border-box;
 max-width: 52rem;
 margin: 0 auto;
 padding: 32px 24px;
 font-family: Arial, Helvetica, sans-serif;
 font-size: 22px;
 line-height: 1.6;
 text-align: left;
 overflow-wrap: anywhere;
 color: var(--kopplat-text) !important;
 background-color: var(--kopplat-background) !important;
}

.card.nightMode,
.card.night_mode,
.nightMode .card,
.night_mode .card {
 --kopplat-background: #1f2330;
 --kopplat-text: #e8ecf2;
 --kopplat-muted: #b9c2d0;
 --kopplat-link: #9fc9ff;
 --kopplat-code: #30394a;
 --kopplat-border: #7d8ca5;
 color-scheme: dark;
}

/* Existing templates may set dark heading/answer colors inline.
   Normalize their text/backgrounds before applying the explicit roles below. */
.card * {
 color: inherit !important;
 background-color: transparent !important;
}

.card h1,
.card h2,
.card h3,
.card .question,
.card .front {
 color: var(--kopplat-text) !important;
 font-size: 1.15em;
 line-height: 1.45;
}

.card small,
.card small * {
 color: var(--kopplat-muted) !important;
}

.card small {
 font-size: 0.82em;
 line-height: 1.6;
}

.card a,
.card a *,
.card a:visited {
 color: var(--kopplat-link) !important;
 text-decoration: underline;
 text-underline-offset: 0.15em;
}

.card a:focus-visible {
 outline: 2px solid var(--kopplat-link);
 outline-offset: 3px;
 border-radius: 2px;
}

.card code,
.card pre {
 color: var(--kopplat-text) !important;
 background-color: var(--kopplat-code) !important;
 font-family: ui-monospace, Consolas, monospace;
 font-size: 0.9em;
 white-space: pre-wrap;
 overflow-wrap: anywhere;
}

.card code {
 padding: 0.08em 0.25em;
 border-radius: 4px;
}

.card pre {
 padding: 12px;
}

.card hr {
 height: 0;
 margin: 24px 0;
 border: 0;
 border-top: 1px solid var(--kopplat-border);
}

@media (max-width: 600px) {
 .card {
  padding: 20px 16px;
  font-size: 20px;
 }
}
