/* ==========================================================================
   SPAM KING 3000 – sisäinen käyttöliittymä
   1997-tyylinen huijaussivusto, mutta luettava: AA-kontrasti, näkyvä fokus,
   Boss mode + prefers-reduced-motion pysäyttävät kaiken liikkeen.
   ========================================================================== */

:root {
  --sk-desktop: #008080;
  --sk-desktop-dot: #006a6a;
  --sk-silver: #c0c0c0;
  --sk-silver-light: #dfdfdf;
  --sk-shadow: #808080;
  --sk-dark: #0a0a0a;
  --sk-white: #ffffff;
  --sk-navy: #000080;
  --sk-title-end: #1060a8;
  --sk-night: #000040;
  --sk-yellow: #ffff00;
  --sk-red: #c00000;
  --sk-lcd: #33ff33;
  --sk-link: #0000cc;
  --sk-visited: #551a8b;
  --sk-font: Tahoma, Verdana, "Segoe UI", Geneva, sans-serif;
  --sk-mono: "Lucida Console", "Courier New", Courier, monospace;
  --sk-bevel-out: inset -1px -1px var(--sk-dark), inset 1px 1px var(--sk-white),
    inset -2px -2px var(--sk-shadow), inset 2px 2px var(--sk-silver-light);
  --sk-bevel-in: inset -1px -1px var(--sk-white), inset 1px 1px var(--sk-dark),
    inset -2px -2px var(--sk-silver-light), inset 2px 2px var(--sk-shadow);
  --sk-field: inset -1px -1px var(--sk-white), inset 1px 1px var(--sk-shadow),
    inset -2px -2px var(--sk-silver-light), inset 2px 2px var(--sk-dark);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  font: 15px/1.45 var(--sk-font);
  color: #000;
  background-color: var(--sk-desktop);
  background-image: radial-gradient(var(--sk-desktop-dot) 1px, transparent 1.5px);
  background-size: 8px 8px;
}

a {
  color: var(--sk-link);
}
a:visited {
  color: var(--sk-visited);
}

h1,
h2,
h3 {
  line-height: 1.2;
}
h2 {
  font-family: "Arial Black", Arial, var(--sk-font);
  font-size: 1.25rem;
  margin: 1.25rem 0 0.5rem;
}
h3 {
  font-size: 1.05rem;
  margin: 1rem 0 0.4rem;
}

img {
  max-width: 100%;
}

/* ---------- Fokus: aina näkyvä ---------- */
:focus-visible {
  outline: 3px solid #000;
  outline-offset: 2px;
}
.sk-header :focus-visible,
.sk-titlebar :focus-visible,
.sk-table th :focus-visible,
.sk-marquee :focus-visible {
  outline-color: var(--sk-yellow);
}

.sk-skip {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 10;
  padding: 8px 12px;
  background: var(--sk-yellow);
  color: #000;
  font-weight: bold;
}
.sk-skip:focus {
  top: 8px;
}

.sk-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Otsake ja WordArt-logo ---------- */
.sk-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 10px 16px;
  color: var(--sk-white);
  background-color: var(--sk-night);
  background-image: radial-gradient(#ffffff 1px, transparent 1.5px),
    radial-gradient(#8080ff 1px, transparent 1.5px);
  background-size: 53px 41px, 31px 29px;
  background-position: 0 0, 13px 17px;
  border-bottom: 3px ridge var(--sk-silver);
}

.sk-logo {
  display: inline-block;
  text-decoration: none;
  font-family: Impact, "Arial Black", "Haettenschweiler", sans-serif;
  font-size: clamp(1.6rem, 6vw, 2.6rem);
  font-style: italic;
  letter-spacing: 0.04em;
  line-height: 1;
  transform: perspective(300px) rotateX(12deg) skewX(-8deg);
  transform-origin: left bottom;
}
.sk-logo span {
  color: var(--sk-yellow);
  background: linear-gradient(180deg, #ffff66 0%, #ffd000 40%, #ff8c00 65%, #ff4040 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(2px 2px 0 #800000) drop-shadow(1px 1px 0 #000);
}
.sk-logo:visited {
  color: inherit;
}

.sk-instances {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sk-userbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-left: auto;
}
.sk-user {
  font-family: var(--sk-mono);
  font-size: 0.9rem;
  word-break: break-all;
}
.sk-inline-form {
  display: inline;
  margin: 0;
}

/* ---------- Marquee ---------- */
.sk-marquee {
  overflow: hidden;
  white-space: nowrap;
  background: #000;
  color: var(--sk-yellow);
  font: bold 0.95rem/1.9 var(--sk-mono);
  border-bottom: 2px solid var(--sk-red);
}
.sk-marquee > span {
  display: inline-block;
  padding-left: 100%;
  animation: sk-marquee 40s linear infinite;
}
@keyframes sk-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

/* ---------- Runko: sivupalkki + ikkuna ---------- */
.sk-shell {
  display: grid;
  grid-template-columns: minmax(180px, 210px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  max-width: 1400px;
  margin: 16px auto;
  padding: 0 16px;
}
.sk-shell-single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1000px;
}

/* ---------- Win95-ikkuna ---------- */
.sk-window {
  background: var(--sk-silver);
  padding: 3px;
  box-shadow: var(--sk-bevel-out);
  min-width: 0;
}
.sk-window + .sk-window {
  margin-top: 16px;
}
.sk-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  padding: 3px 4px 3px 8px;
  color: var(--sk-white);
  background: linear-gradient(90deg, var(--sk-navy), var(--sk-title-end));
  font-weight: bold;
}
.sk-titlebar h1,
.sk-titlebar h2 {
  margin: 0;
  font: bold 1rem/1.3 var(--sk-font);
  overflow-wrap: anywhere;
}
.sk-titlebar-buttons {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.sk-titlebar-buttons span {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 18px;
  font: bold 12px/1 var(--sk-font);
  color: #000;
  background: var(--sk-silver);
  box-shadow: var(--sk-bevel-out);
}
.sk-body {
  padding: 12px 14px 16px;
}
.sk-body > :first-child {
  margin-top: 0;
}
.sk-main:focus {
  outline: none;
}

/* ---------- Painikkeet ---------- */
.sk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 14px;
  font: 15px/1.2 var(--sk-font);
  color: #000;
  text-decoration: none;
  text-align: center;
  background: var(--sk-silver);
  border: 0;
  border-radius: 0;
  box-shadow: var(--sk-bevel-out);
  cursor: pointer;
}
a.sk-btn:visited {
  color: #000;
}
.sk-btn:hover {
  background: #cfcfcf;
}
.sk-btn:active,
.sk-btn[aria-current="page"],
.sk-btn[aria-pressed="true"] {
  box-shadow: var(--sk-bevel-in);
  padding: 6px 13px 4px 15px;
}
.sk-btn[aria-current="page"] {
  font-weight: bold;
  background: #e8e8e8;
  background-image: repeating-conic-gradient(#e8e8e8 0% 25%, #d6d6d6 0% 50%);
  background-size: 4px 4px;
}
.sk-btn:disabled,
.sk-btn[aria-disabled="true"] {
  color: #595959;
  text-shadow: 1px 1px 0 var(--sk-white);
  cursor: not-allowed;
}
.sk-btn-primary {
  font-weight: bold;
  background: var(--sk-yellow);
}
.sk-btn-primary:hover {
  background: #ffff80;
}
.sk-btn-danger {
  font-weight: bold;
  color: var(--sk-white);
  background: var(--sk-red);
  box-shadow: inset -1px -1px var(--sk-dark), inset 1px 1px #ff8080,
    inset -2px -2px #700000, inset 2px 2px #e04040;
}
a.sk-btn-danger:visited {
  color: var(--sk-white);
}
.sk-btn-danger:hover {
  background: #a80000;
}
.sk-btn-danger:active {
  box-shadow: inset 1px 1px var(--sk-dark), inset -1px -1px #ff8080;
}

.sk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0 4px;
}

/* ---------- Sivupalkin navigaatio ---------- */
.sk-nav {
  background: var(--sk-silver);
  padding: 6px;
  box-shadow: var(--sk-bevel-out);
}
.sk-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.sk-nav .sk-btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

/* ---------- NEW! ja LCD-laskuri ---------- */
.sk-new {
  display: inline-block;
  margin: 0 0.3em;
  padding: 0 5px;
  font: bold 0.75rem/1.5 "Arial Black", Arial, sans-serif;
  color: var(--sk-white);
  background: #d00000;
  border: 1px solid #000;
  transform: rotate(-6deg);
  animation: sk-blink 1s steps(1, end) infinite;
  vertical-align: middle;
}
@keyframes sk-blink {
  50% {
    visibility: hidden;
  }
}

.sk-counter {
  display: inline-block;
  padding: 4px 10px;
  font: bold 2rem/1.1 var(--sk-mono);
  letter-spacing: 0.2em;
  font-variant-numeric: tabular-nums;
  color: var(--sk-lcd);
  background: #000;
  text-shadow: 0 0 6px rgba(51, 255, 51, 0.7);
  box-shadow: var(--sk-field);
  border: 3px solid #000;
}
.sk-counter-label {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
}

/* ---------- Ilmoitukset ---------- */
.sk-flash {
  margin: 0 0 12px;
  padding: 8px 12px;
  color: #000;
  background: #ffff99;
  border: 2px dashed var(--sk-navy);
  font-weight: bold;
}
.sk-flash::before {
  content: "\2605  ";
}
.sk-flash-error {
  color: #800000;
  background: #ffdddd;
  border: 2px solid var(--sk-red);
}
.sk-flash-error::before {
  content: "\26A0  ";
}

/* ---------- Tilastolaatikot (etusivu) ---------- */
.sk-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 10px 0;
}
.sk-stat {
  padding: 10px;
  background: var(--sk-white);
  box-shadow: var(--sk-field);
}
.sk-stat strong {
  display: block;
  font: bold 1.6rem/1.1 var(--sk-mono);
  overflow-wrap: anywhere;
}

/* ---------- Taulukko ---------- */
.sk-table-wrap {
  overflow-x: auto;
  background: var(--sk-white);
  box-shadow: var(--sk-field);
  padding: 2px;
}
.sk-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--sk-white);
  font-size: 0.95rem;
}
.sk-table th,
.sk-table td {
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
  border: 1px solid #a0a0a0;
}
.sk-table th {
  color: var(--sk-white);
  background: var(--sk-navy);
  white-space: nowrap;
}
.sk-table th a,
.sk-table th a:visited {
  color: var(--sk-white);
}
.sk-table tbody tr:nth-child(even) {
  background: #f0f0f0;
}
.sk-table tbody tr:hover {
  background: #ffffcc;
}
.sk-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.sk-empty {
  padding: 16px;
  text-align: center;
  font-style: italic;
}

.sk-tag {
  display: inline-block;
  padding: 0 6px;
  font-size: 0.85rem;
  line-height: 1.5;
  border: 1px solid #000;
  background: #e0e0e0;
  white-space: nowrap;
}
.sk-tag-ok {
  background: #c8f7c8;
}
.sk-tag-warn {
  background: #ffe8a0;
}
.sk-tag-bad {
  background: #ffd0d0;
}

.sk-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

/* ---------- Lomakkeet ---------- */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="password"],
input:not([type]),
select,
textarea {
  min-height: 32px;
  max-width: 100%;
  padding: 4px 6px;
  font: 15px/1.3 var(--sk-font);
  color: #000;
  background: var(--sk-white);
  border: 0;
  border-radius: 0;
  box-shadow: var(--sk-field);
}
textarea {
  width: 100%;
  min-height: 7em;
  resize: vertical;
}
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--sk-navy);
  vertical-align: middle;
}
fieldset {
  margin: 12px 0;
  padding: 8px 12px 12px;
  border: 2px groove var(--sk-white);
}
legend {
  padding: 0 4px;
  font-weight: bold;
}
label {
  cursor: pointer;
}

.sk-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 12px;
  margin: 0 0 12px;
  padding: 8px 12px 12px;
  border: 2px groove var(--sk-white);
}
.sk-filters label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.9rem;
  font-weight: bold;
}
.sk-filters select,
.sk-filters input {
  min-width: 9em;
}

.sk-form-grid {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  gap: 10px 14px;
  align-items: start;
  margin: 8px 0;
}
.sk-form-grid > label {
  padding-top: 6px;
  font-weight: bold;
}
.sk-form-grid input[type="text"],
.sk-form-grid input[type="email"],
.sk-form-grid input[type="url"],
.sk-form-grid input:not([type]),
.sk-form-grid select {
  width: 100%;
  max-width: 32em;
}
.sk-hint {
  display: block;
  font-size: 0.85rem;
  color: #333;
}
.sk-error {
  display: block;
  color: #800000;
  font-weight: bold;
}
.sk-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

/* Tahon kortin perustiedot */
.sk-dl {
  display: grid;
  grid-template-columns: minmax(120px, 200px) minmax(0, 1fr);
  gap: 4px 14px;
  margin: 0;
}
.sk-dl dt {
  font-weight: bold;
}
.sk-dl dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.sk-table td {
  overflow-wrap: break-word;
}
.sk-row-errors {
  margin: 4px 0 0;
  padding-left: 1.2em;
  min-width: 14em;
  font-size: 0.85rem;
  color: #800000;
}
.sk-table td input[type="text"],
.sk-table td input[type="email"],
.sk-table td textarea {
  width: 100%;
  min-width: 10em;
}
.sk-table td textarea {
  min-height: 3.2em;
}
.sk-table tr.sk-row-error td {
  background: #fff0f0;
}
.sk-table tr.sk-row-muted td {
  color: #444;
}
.sk-actions .sk-inline-form {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
@media (max-width: 560px) {
  .sk-dl {
    grid-template-columns: 1fr;
  }
  .sk-dl dd {
    margin-bottom: 6px;
  }
}

/* ---------- Alatunniste ---------- */
.sk-footer {
  margin: 24px 16px 16px;
  text-align: center;
  color: var(--sk-white);
  font-size: 0.85rem;
}
.sk-footer p {
  margin: 4px 0;
  text-shadow: 1px 1px 0 #003a3a;
}
.sk-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.sk-badge {
  display: inline-grid;
  place-items: center;
  width: 88px;
  height: 31px;
  font: bold 10px/1 Verdana, sans-serif;
  color: var(--sk-yellow);
  background: linear-gradient(#202080, #000040);
  border: 2px outset #8080ff;
}

hr.sk-rainbow {
  height: 4px;
  border: 0;
  background: linear-gradient(90deg, red, orange, yellow, lime, cyan, blue, magenta);
}

/* ---------- Mobiili (≥ 360 px) ---------- */
@media (max-width: 860px) {
  .sk-shell {
    grid-template-columns: minmax(0, 1fr);
    padding: 0 8px;
    margin: 8px auto;
    gap: 8px;
  }
  .sk-nav ul {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
  .sk-userbar {
    margin-left: 0;
  }
}
@media (max-width: 560px) {
  .sk-header {
    padding: 8px;
  }
  .sk-body {
    padding: 10px 8px 12px;
  }
  .sk-form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  .sk-form-grid > label {
    padding-top: 8px;
  }
  .sk-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sk-filters select,
  .sk-filters input {
    min-width: 0;
    width: 100%;
  }
  .sk-counter {
    font-size: 1.5rem;
  }
}

/* ---------- Boss mode ja vähennetty liike: ei liikettä eikä vilkkumista ---------- */
body.boss *,
body.boss *::before,
body.boss *::after {
  animation: none !important;
  transition: none !important;
}
body.boss .sk-marquee {
  white-space: normal;
}
body.boss .sk-marquee > span {
  display: block;
  padding: 0 16px;
  transform: none;
}
body.boss .sk-new {
  visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .sk-marquee {
    white-space: normal;
  }
  .sk-marquee > span {
    display: block;
    padding: 0 16px;
    transform: none;
  }
  .sk-new {
    visibility: visible;
  }
}

/* Message previews (templates, review queue): exactly as sent, wrapped. */
.sk-preview {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "Courier New", Courier, monospace;
  background: #fff;
  color: #000;
  border: 2px inset #808080;
  padding: 8px;
  margin: 0 0 8px;
}

/* Review queue card */
.sk-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px 16px;
}
.sk-kbd {
  font-family: "Courier New", Courier, monospace;
  border: 1px solid #808080;
  padding: 0 4px;
  background: #fff;
  color: #000;
}

@media print {
  body {
    background: #fff;
  }
  .sk-header,
  .sk-marquee,
  .sk-nav,
  .sk-footer,
  .sk-actions {
    display: none;
  }
  .sk-shell {
    display: block;
    margin: 0;
  }
}

/* ---------- CONGRATULATIONS-ponnahdusikkuna (etusivu, uudet julkaisut) ---------- */
.sk-popup {
  max-width: 560px;
  margin: 0 auto 16px;
  border: 3px double var(--sk-red);
}
.sk-popup .sk-titlebar {
  background: linear-gradient(90deg, #800000, var(--sk-red));
}
.sk-popup-close {
  margin: 0;
}
.sk-popup-close .sk-btn {
  min-width: 0;
  min-height: 0;
  padding: 0 6px;
  line-height: 1.3;
}
.sk-popup .sk-body {
  text-align: center;
  background: var(--sk-yellow);
}
.sk-popup-shout {
  margin: 0 0 8px;
  font: bold 1.6rem/1.2 "Arial Black", Arial, var(--sk-font);
  color: var(--sk-red);
  text-shadow: 2px 2px 0 #000;
}
.sk-popup .sk-actions {
  justify-content: center;
}

/* Entity card: links found in a channel description (evidence, attached only by hand). */
.sk-linked {
  margin: 0.25rem 0 0;
  padding-left: 1.2rem;
}
.sk-linked li {
  margin: 0.2rem 0;
}

/* Tietokanta: tabs (Tahot / Puuttuu sähköposti / Hylätyt) and the open duplicate notice. */
.sk-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 12px 0 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--sk-shadow);
}
.sk-dup-notice,
a.sk-dup-notice:visited {
  background: var(--sk-yellow);
  color: #000;
  font-weight: bold;
}

/* Missing-email view: one small form per row. */
.sk-email-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.sk-table td .sk-email-form input[type="email"] {
  flex: 1 1 14em;
  width: auto;
  min-width: 12em;
}
.sk-email-form .sk-error {
  flex-basis: 100%;
}
.sk-email-fill .sk-linked {
  margin: 0;
}

/* Julkaisut grouped per entity: the details row belongs to the group row above it. */
.sk-pub-groups > tbody > tr.sk-pub-group > td {
  background: var(--sk-white);
  border-top: 2px solid var(--sk-shadow);
}
.sk-pub-groups > tbody > tr.sk-pub-details > td {
  background: var(--sk-white);
  padding-top: 0;
}
.sk-pub-details summary {
  cursor: pointer;
  color: var(--sk-link);
  text-decoration: underline;
  padding: 2px 0;
}
.sk-pub-details summary:focus-visible {
  outline: 2px dotted #000;
  outline-offset: 2px;
}
.sk-pub-details details[open] > summary {
  margin-bottom: 6px;
}

/* Campaign page: recipient rows with a hard block, collapsible previews. */
.sk-row-disabled td {
  color: #444;
  background: #e4e4e4;
}
.sk-details {
  margin: 8px 0;
}
.sk-details > summary {
  cursor: pointer;
  font-weight: bold;
}
.sk-details > summary:focus-visible {
  outline: 2px dotted #000;
  outline-offset: 2px;
}

/* Message editor (campaign texts, shared texts): stacked labels, full-width fields. */
.sk-text-form label {
  display: block;
  margin: 10px 0 4px;
  font-weight: bold;
}
.sk-text-form input[type="text"],
.sk-text-form textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
}
.sk-text-form textarea {
  font-family: inherit;
}
.sk-filters input[type="checkbox"] {
  width: auto;
  min-width: 0;
  margin-right: 6px;
}
.sk-filters .sk-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  align-self: end;
  font-weight: normal;
}
