:root {
  --ink: #16201d;
  --muted: #5d6863;
  --paper: #fbfaf6;
  --white: #ffffff;
  --green: #245b45;
  --green-dark: #173f31;
  --soft: #edf3ef;
  --line: #d9e2dd;
  --gold: #c79a47;
  --danger: #9a2f22;
  --warn: #9b5d00;
  --shadow: 0 18px 50px rgba(21, 40, 33, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

section[id] {
  scroll-margin-top: 96px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 4vw, 56px);
  background: rgba(251, 250, 246, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.site-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.86rem;
}

.site-stats span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-height: 28px;
  padding: 3px 9px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.site-stats strong {
  color: var(--green);
}

.editor-stats {
  justify-content: flex-end;
}

.brand,
nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  font-weight: 900;
  text-decoration: none;
}

.brand span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--white);
  background: var(--green);
  border-radius: 8px;
}

nav {
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted);
  gap: 8px;
}

nav a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid rgba(36, 91, 69, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

nav a:hover,
nav a:focus-visible {
  color: var(--green-dark);
  background: var(--soft);
  border-color: rgba(36, 91, 69, 0.34);
  box-shadow: 0 4px 14px rgba(21, 40, 33, 0.08);
  outline: none;
}

nav a.nav-cta {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  color: var(--white);
  background: var(--green);
  border-color: var(--green);
  border-radius: 999px;
  font-weight: 900;
}

nav a.nav-cta:hover,
nav a.nav-cta:focus-visible {
  color: var(--white);
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.hero {
  min-height: 640px;
  display: grid;
  align-items: center;
  padding: 84px clamp(18px, 5vw, 76px);
  background:
    linear-gradient(90deg, rgba(251, 250, 246, 0.98) 0%, rgba(251, 250, 246, 0.9) 42%, rgba(251, 250, 246, 0.08) 74%),
    url("/assets/hero-kindlustus-uus.png") center right / cover no-repeat;
}

.hero-text {
  max-width: 720px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 620px;
  margin-top: 28px;
}

.hero-stats article {
  padding: 14px 16px;
  background: rgba(255, 254, 250, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.hero-stats strong {
  display: block;
  color: var(--green);
  font-size: 1.8rem;
  line-height: 1;
}

.hero-stats span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 1.04;
}

h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.4rem);
  line-height: 1.12;
}

h3 {
  margin: 0;
}

.hero-text p:not(.eyebrow),
.section-copy p {
  max-width: 700px;
  color: var(--muted);
  font-size: 1.05rem;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border: 1px solid rgba(21, 40, 33, 0.12);
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(21, 40, 33, 0.1);
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(21, 40, 33, 0.16);
  outline: none;
}

.button:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(21, 40, 33, 0.12);
}

.button.primary {
  color: var(--white);
  background: var(--green);
  border-color: var(--green);
}

.button.secondary {
  color: var(--green);
  background: var(--white);
  border-color: rgba(36, 91, 69, 0.25);
}

.button.danger {
  color: var(--white);
  background: var(--danger);
  border-color: var(--danger);
}

.button.small {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 0.88rem;
}

.full {
  width: 100%;
}

.form-actions,
.event-builder-head,
.event-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.event-builder-head {
  display: block;
}

.helper-text {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.5;
}

.form-top-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.draft-notice {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 16px;
  margin-bottom: 18px;
  border: 1px solid #d6e5dc;
  border-radius: 8px;
  background: #f0f8f3;
}

.draft-notice[hidden] {
  display: none;
}

.draft-notice p {
  margin: 6px 0 0;
  color: var(--muted);
}

.draft-notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.inline-form {
  display: inline-block;
  margin: 0 0 18px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-actions form {
  margin: 0;
}

.notice {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  padding: 28px clamp(18px, 5vw, 76px);
  background: #fff4df;
  border-top: 1px solid #ead7b8;
  border-bottom: 1px solid #ead7b8;
}

.notice strong {
  color: var(--warn);
}

.contacts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.story-gateway {
  background: var(--white);
}

.lessons {
  background: var(--soft);
}

.privacy-path {
  background: var(--white);
}

.contribution {
  background: var(--paper);
}

.lesson-grid,
.process-steps,
.contribution-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.lesson-grid article,
.process-steps article,
.contribution-steps article {
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.privacy-path .process-steps article {
  background: var(--paper);
}

.lesson-grid p,
.process-steps p,
.contribution-steps p {
  color: var(--muted);
}

.process-steps span,
.contribution-steps span {
  display: inline-grid;
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  place-items: center;
  color: var(--white);
  background: var(--green);
  border-radius: 999px;
  font-weight: 900;
}

.contribution-steps {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.contacts article {
  min-height: 116px;
  padding: 26px clamp(18px, 5vw, 76px);
  background: var(--white);
}

.contacts strong,
.contacts a {
  display: block;
}

.contacts a {
  margin-top: 8px;
  color: var(--green);
  font-weight: 900;
}

.contacts span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.split,
.section,
.admin-edit {
  padding: 84px clamp(18px, 5vw, 76px);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1.15fr);
  gap: 28px;
  align-items: start;
  background: var(--soft);
}

#saada.split {
  grid-template-columns: 1fr;
}

#saada .section-copy {
  max-width: 980px;
}

.panel {
  display: grid;
  gap: 16px;
  padding: clamp(24px, 4vw, 42px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 13px;
  color: var(--ink);
  background: #fffefa;
  border: 1px solid #cbd7d1;
  border-radius: 8px;
  font: inherit;
  font-weight: 400;
}

input::placeholder,
textarea::placeholder {
  color: #6f7874;
  font-weight: 400;
  opacity: 1;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(199, 154, 71, 0.25);
  border-color: var(--gold);
}

.checks {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 16px;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.checks legend {
  padding: 0 8px;
  color: var(--green);
  font-weight: 900;
}

.check {
  grid-template-columns: 20px 1fr;
  align-items: start;
  color: var(--muted);
  font-weight: 700;
}

.check input {
  min-height: 18px;
  margin-top: 4px;
}

.danger-check {
  padding: 10px 12px;
  color: var(--danger);
  background: #fff7f5;
  border: 1px solid #e9c7c1;
  border-radius: 8px;
}

.event-builder {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.events-list {
  display: grid;
  gap: 14px;
}

.event-form {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 7px solid var(--green);
  border-radius: 8px;
}

.event-form.event-actor-client {
  border-left-color: var(--green);
  background: #fbfdfb;
}

.event-form.event-actor-insurer {
  border-left-color: #d89a2b;
  background: #fffaf0;
}

.event-form.event-actor-other {
  border-left-color: #607184;
  background: #f8fafc;
}

.event-head-title {
  display: grid;
  gap: 6px;
}

.actor-badge {
  display: inline-flex;
  width: fit-content;
  padding: 5px 10px;
  color: var(--green-dark);
  background: #eaf2ed;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 900;
}

.event-actor-insurer .actor-badge {
  color: #6d4300;
  background: #fff0cf;
}

.event-actor-other .actor-badge {
  color: #324254;
  background: #e9eef4;
}

.event-date-field input:required:invalid,
.event-missing-date .event-date-field input {
  border-color: #a8332a;
  background: #fff8f6;
}

.event-editor {
  display: grid;
  gap: 14px;
  margin: 18px 0 26px;
}

.event-edit-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-left: 7px solid var(--green);
  border-radius: 8px;
  scroll-margin-top: 92px;
}

.event-edit-card.event-actor-client {
  border-left-color: var(--green);
  background: #fbfdfb;
}

.event-edit-card.event-actor-insurer {
  border-left-color: #d89a2b;
  background: #fffaf0;
}

.event-edit-card.event-actor-other {
  border-left-color: #607184;
  background: #f8fafc;
}

.event-fields {
  display: grid;
  grid-template-columns: minmax(230px, 1.1fr) minmax(260px, 1.25fr) minmax(190px, 0.85fr);
  gap: 14px;
  align-items: end;
}

.custom-title {
  grid-column: 1 / -1;
}

.field-help {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 400;
}

.event-date-field .date-warning {
  color: #8a2c24;
  font-weight: 700;
}

.format-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.format-toolbar button {
  min-height: 34px;
  padding: 6px 10px;
  color: var(--green);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.rich-source {
  display: none;
}

.rich-editor {
  min-height: 132px;
  width: 100%;
  padding: 16px;
  overflow: auto;
  color: var(--ink);
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  line-height: 1.55;
  outline: none;
  white-space: pre-wrap;
}

.rich-editor:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(213, 158, 52, 0.16);
}

.event-save-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.file-basket {
  display: grid;
  gap: 8px;
  margin: -4px 0 0;
  padding: 0;
  list-style: none;
}

.file-basket li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.file-basket .empty {
  color: var(--muted);
}

.file-basket small {
  color: var(--muted);
}

.link-button {
  padding: 0;
  color: var(--danger);
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

input[type="file"] {
  min-height: auto;
  padding: 14px;
}

.event-number-label {
  font-size: 1.05rem;
}

.custom-title[hidden],
.insurance-type-other[hidden],
.preview-section[hidden] {
  display: none;
}

.wide {
  max-width: 960px;
}

.about {
  background: var(--white);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.about-grid article {
  padding: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.about-grid p {
  color: var(--muted);
}

.terms {
  background: var(--soft);
}

.terms-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.terms-list article {
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.terms-list p {
  color: var(--muted);
}

.terms-list a {
  color: var(--green);
  font-weight: 900;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
}

.case-browser {
  display: grid;
  gap: 18px;
  margin: 26px 0;
}

.case-filter {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  align-items: end;
  padding: 20px;
  box-shadow: none;
}

.filter-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.browse-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.browse-card {
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.browse-card h3 {
  margin-bottom: 12px;
}

.tree-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.topic-list {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--muted);
}

.tree-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  color: var(--ink);
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}

.tree-list span {
  min-width: 28px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  color: var(--green-dark);
  background: #eaf2ed;
  border-radius: 999px;
  font-weight: 900;
}

.stat-lines {
  display: grid;
  gap: 10px;
}

.stat-lines p {
  margin: 0;
  display: grid;
  gap: 3px;
}

.stat-lines strong {
  color: var(--green);
  font-size: 2rem;
  line-height: 1;
}

.stat-lines span,
.active-filter {
  color: var(--muted);
}

.stat-box-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.stat-box {
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat-box strong {
  display: block;
  color: var(--green);
  font-size: 2rem;
  line-height: 1;
}

.stat-box span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.active-filter {
  margin: 0;
}

.active-filter span {
  display: inline-flex;
  margin-left: 6px;
  padding: 3px 9px;
  color: var(--green-dark);
  background: #eaf2ed;
  border-radius: 999px;
  font-weight: 900;
}

.case-card,
.admin-card {
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel,
.browse-card,
.stat-box,
.about-grid article,
.terms-list article,
.contribution-steps article,
.process-steps article,
.lesson-grid article,
.contacts > div {
  border-color: rgba(31, 99, 71, 0.18);
  box-shadow: 0 10px 28px rgba(21, 40, 33, 0.06);
}

.browse-card,
.stat-box,
.about-grid article,
.terms-list article,
.contribution-steps article,
.process-steps article,
.lesson-grid article,
.contacts > div {
  border-top: 4px solid rgba(31, 99, 71, 0.52);
}

.browse-card:hover,
.stat-box:hover,
.about-grid article:hover,
.terms-list article:hover,
.contribution-steps article:hover,
.process-steps article:hover,
.lesson-grid article:hover {
  border-color: rgba(31, 99, 71, 0.32);
  box-shadow: 0 14px 34px rgba(21, 40, 33, 0.1);
  transform: translateY(-1px);
}

.button,
.nav-cta,
button.button {
  box-shadow: 0 8px 18px rgba(31, 99, 71, 0.12);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.button:hover,
.nav-cta:hover,
button.button:hover {
  box-shadow: 0 12px 24px rgba(31, 99, 71, 0.18);
  transform: translateY(-1px);
}

.button.primary,
.nav-cta,
button.button.primary {
  box-shadow: 0 10px 24px rgba(31, 99, 71, 0.2);
}

.case-filter.panel {
  border-left: 5px solid rgba(31, 99, 71, 0.45);
}

.editor-visit-stats {
  display: grid;
  gap: 22px;
  margin: 26px 0;
  padding: 24px;
  border-left: 5px solid rgba(31, 99, 71, 0.55);
}

.stat-box-grid.compact {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.visit-top-list {
  padding: 18px;
  background: #f7faf8;
  border: 1px solid rgba(31, 99, 71, 0.14);
  border-radius: 8px;
}

.visit-top-list h3 {
  margin-bottom: 12px;
}

.visit-top-list ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
}

.visit-top-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.visit-top-list li span {
  padding: 5px 10px;
  color: var(--green);
  font-weight: 800;
  background: var(--mint);
  border-radius: 999px;
}

@media (max-width: 900px) {
  .stat-box-grid.compact,
  .visit-top-list li {
    grid-template-columns: 1fr;
  }
}

.case-summary-card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 26px 26px 22px 32px;
  background: linear-gradient(90deg, #fffefa 0%, #fffefa 74%, #f7faf8 100%);
  border: 2px solid rgba(31, 99, 71, 0.28);
  box-shadow: 0 18px 42px rgba(21, 40, 33, 0.14);
}

.case-summary-card::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 0;
  width: 7px;
  background: var(--green);
  border-radius: 0 999px 999px 0;
}

.case-summary-card:hover {
  border-color: rgba(31, 99, 71, 0.58);
  box-shadow: 0 22px 52px rgba(21, 40, 33, 0.18);
}

.case-summary-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.case-summary-card h3 {
  font-size: 1.4rem;
}

.case-summary-meta {
  justify-content: flex-end;
  max-width: 720px;
}

.case-company {
  margin: -6px 0 0;
  color: var(--green);
  font-weight: 900;
}

.case-intro.compact {
  margin: 8px 0;
  padding: 16px 18px;
  background: #f2f8f4;
  border: 1px solid rgba(31, 99, 71, 0.12);
  border-left: 4px solid var(--green);
  font-weight: 500;
}

.case-summary-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0;
}

.case-summary-footer .button {
  min-height: 44px;
  padding: 11px 18px;
  font-size: 0.95rem;
  box-shadow: 0 10px 22px rgba(31, 99, 71, 0.2);
}

.case-summary-footer .button::after {
  content: " ->";
}

/* Public dashboard contrast pass */
#avalikud .case-filter.panel {
  padding: 22px;
  background: #f4faf6;
  border: 2px solid rgba(31, 99, 71, 0.22);
  border-left: 8px solid var(--green);
  box-shadow: 0 16px 34px rgba(21, 40, 33, 0.1);
}

#avalikud .case-filter label {
  color: var(--green);
  font-weight: 900;
}

#avalikud .case-filter select,
#avalikud .case-filter input {
  background: #fff;
  border: 2px solid rgba(31, 99, 71, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

#avalikud .browse-card {
  min-height: 230px;
  padding: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbf8 100%);
  border: 2px solid rgba(31, 99, 71, 0.22);
  border-top: 7px solid var(--green);
  box-shadow: 0 16px 34px rgba(21, 40, 33, 0.1);
}

#avalikud .browse-card h3 {
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(31, 99, 71, 0.16);
}

#avalikud .browse-list li,
#avalikud .stat-list li {
  padding: 12px 14px;
  margin-bottom: 8px;
  background: #eef7f1;
  border: 1px solid rgba(31, 99, 71, 0.14);
  border-radius: 8px;
}

#avalikud .stat-box {
  padding: 22px;
  background: #fffefa;
  border: 2px solid rgba(31, 99, 71, 0.2);
  border-top: 7px solid #d69b2d;
  box-shadow: 0 14px 30px rgba(21, 40, 33, 0.08);
}

#avalikud .stat-box strong {
  display: block;
  margin-bottom: 6px;
  color: var(--green);
  font-size: 2.15rem;
}

#avalikud .case-summary-card {
  margin-top: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f6faf7 100%);
  border: 2px solid rgba(31, 99, 71, 0.28);
  box-shadow: 0 18px 44px rgba(21, 40, 33, 0.13);
}

#avalikud .case-summary-card::before {
  width: 8px;
  background: var(--green);
}

#avalikud .case-summary-head {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(31, 99, 71, 0.13);
}

#avalikud .case-intro.compact {
  margin-top: 14px;
  padding: 18px 20px;
  background: #eef7f1;
  border: 1px solid rgba(31, 99, 71, 0.18);
  border-left: 6px solid var(--green);
}

#avalikud .case-summary-footer {
  padding-top: 8px;
}

#avalikud .case-summary-footer .button {
  min-width: 150px;
}

/* Stronger separation for the public case/statistics area */
#avalikud .case-filter.panel {
  margin-bottom: 22px;
  background: #e7f3ec;
  border-color: #93b9a4;
}

#avalikud .browse-grid {
  padding: 18px;
  margin: 18px 0;
  background: #edf3ef;
  border: 1px solid #c6d8cd;
  border-radius: 10px;
}

#avalikud .browse-card:nth-child(1) {
  background: #ffffff;
  border-color: #8eb89f;
  border-top-color: #1f6347;
}

#avalikud .browse-card:nth-child(2) {
  background: #fbfbff;
  border-color: #9eaec8;
  border-top-color: #3f5f8f;
}

#avalikud .browse-card:nth-child(3) {
  background: #fffaf0;
  border-color: #d9bd82;
  border-top-color: #c18118;
}

#avalikud .browse-card h3 {
  display: inline-block;
  padding: 6px 10px;
  background: rgba(31, 99, 71, 0.08);
  border-radius: 999px;
}

#avalikud .stat-box-grid {
  padding: 18px;
  margin: 22px 0;
  background: #fff7e8;
  border: 1px solid #e1c991;
  border-radius: 10px;
}

#avalikud .stat-box {
  background: #ffffff;
  border-color: #d5b56f;
}

#avalikud .case-grid {
  padding: 18px;
  margin-top: 22px;
  background: #eef4f7;
  border: 1px solid #c2d2da;
  border-radius: 10px;
}

#avalikud .case-summary-card {
  margin: 0;
  background: #ffffff;
  border-color: #7fae95;
  border-left: 8px solid var(--green);
}

#avalikud .case-summary-card + .case-summary-card {
  margin-top: 18px;
}

#avalikud .case-summary-head {
  background: #f2f8f4;
  margin: -26px -26px 16px -32px;
  padding: 20px 24px 16px 32px;
  border-radius: 7px 7px 0 0;
}

#avalikud .case-summary-meta .pill,
#avalikud .case-summary-card .pill {
  border: 1px solid rgba(31, 99, 71, 0.16);
}

.case-detail-page {
  background: var(--soft);
}

.case-detail-card {
  display: grid;
  gap: 0;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
}

.case-detail-sticky {
  position: sticky;
  top: 67px;
  z-index: 4;
  padding: 22px;
  background: rgba(255, 254, 250, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.case-detail-sticky h1 {
  font-size: clamp(2rem, 4vw, 3.8rem);
}

.case-detail-scroll {
  max-height: calc(100vh - 260px);
  overflow: auto;
  padding: 28px 22px 28px;
  scroll-padding-top: 34px;
}

.sticky-labels {
  margin-top: 16px;
}

.case-card p,
.admin-card p,
.meta,
.file-list,
.consent-list {
  color: var(--muted);
}

.preview-section {
  background: var(--white);
}

body.preview-mode main > section:not(#preview-section) {
  display: none;
}

.case-preview {
  max-width: none;
  width: 100%;
}

.preview-actions {
  margin-bottom: 16px;
}

.preview-action-notice {
  margin: 16px 0;
  padding: 14px 16px;
  color: #fff !important;
  background: #c46d13;
  border-radius: 8px;
  font-weight: 900;
}

.preview-card {
  width: 100%;
}

.case-intro {
  margin: 16px 0 8px;
  padding: 16px;
  color: var(--ink);
  background: #f7faf8;
  border-left: 4px solid var(--green);
  border-radius: 8px;
  font-size: 1.02rem;
  font-weight: 700;
}

.event-files a,
.event-files span {
  display: inline-block;
  margin: 4px 8px 4px 0;
  overflow-wrap: anywhere;
}

.timeline {
  position: relative;
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding: 8px 0;
}

.timeline-labels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  margin: 22px 0 4px;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.timeline-labels span:first-child {
  text-align: right;
}

.timeline-labels span:last-child {
  text-align: left;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: var(--gold);
  transform: translateX(-50%);
}

.timeline-event {
  position: relative;
  width: calc(50% - 28px);
  padding: 16px;
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 8px;
  scroll-margin-top: 92px;
}

.timeline-event.event-recent-change,
.event-edit-card.event-recent-change {
  border-color: #d89a2b;
  box-shadow: 0 0 0 3px rgba(216, 154, 43, 0.2), 0 14px 32px rgba(40, 62, 53, 0.1);
}

.change-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  color: #6d4300;
  background: #fff0cf;
  border: 1px solid rgba(216, 154, 43, 0.45);
  border-radius: 8px;
  font-weight: 900;
}

.event-number {
  display: inline-flex;
  margin-right: 8px;
  margin-bottom: 8px;
  padding: 3px 8px;
  color: var(--green-dark);
  background: #eaf2ed;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 900;
}

.timeline-event::before {
  content: "";
  position: absolute;
  top: 22px;
  width: 16px;
  height: 16px;
  background: var(--gold);
  border: 3px solid var(--white);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(199, 154, 71, 0.45);
}

.timeline-event.client {
  justify-self: start;
}

.timeline-event.client::before {
  right: -39px;
}

.timeline-event.insurer,
.timeline-event.other {
  justify-self: end;
}

.timeline-event.insurer::before,
.timeline-event.other::before {
  left: -39px;
}

.timeline-event time {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 3px 8px;
  color: #7a4500;
  background: #fff0cf;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 900;
}

.timeline-event h4 {
  margin: 0;
  color: var(--ink);
}

.timeline-event p {
  margin-bottom: 0;
}

.event-files {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-weight: 800;
}

.event-files a,
.event-files span {
  display: inline-flex;
  max-width: 100%;
  padding: 4px 8px;
  color: var(--green-dark);
  background: #eaf2ed;
  border-radius: 999px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.notice-strong {
  border-left: 7px solid var(--green);
  box-shadow: 0 12px 28px rgba(40, 62, 53, 0.08);
}

.event-submitter {
  margin: 8px 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.materials-note {
  margin-top: 14px;
  padding: 12px 14px;
  color: var(--muted);
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mini-timeline {
  gap: 12px;
}

.mini-timeline .timeline-event {
  width: calc(50% - 18px);
  padding: 12px;
}

.admin-timeline {
  max-width: 920px;
}

.file-list.compact {
  margin-bottom: 0;
  padding-left: 18px;
  font-size: 0.92rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
  font-size: 0.9rem;
  font-weight: 800;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  color: var(--green-dark);
  background: #eaf2ed;
  border-radius: 999px;
}

.pill.warn {
  color: #7a4500;
  background: #fff0cf;
}

.pill.ok {
  color: var(--green-dark);
  background: #dff2e7;
}

.pill.checked-strong {
  color: #fff;
  background: #16734f;
}

.pill.unchecked-strong {
  color: #fff;
  background: #a83228;
}

.status-pill {
  font-weight: 900;
}

.status-pill.status-new {
  color: #fff;
  background: #a83228;
}

.status-pill.status-editing {
  color: #4f3400;
  background: #ffe49a;
}

.status-pill.status-approval {
  color: #fff;
  background: #c46d13;
}

.status-pill.status-published {
  color: #fff;
  background: #16734f;
}

.status-pill.status-archived {
  color: #fff;
  background: #315f9b;
}

.status-choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.success {
  max-width: 860px;
}

.admin-login {
  max-width: 620px;
}

.error {
  color: var(--danger);
  font-weight: 900;
}

.saved {
  padding: 12px 16px;
  color: var(--green-dark);
  background: #dff2e7;
  border-radius: 8px;
  font-weight: 900;
}

.saved-link-box {
  padding: 16px;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.saved-link-box h2 {
  font-size: 1.25rem;
}

.saved-link-box a {
  color: var(--green);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-card {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 22px;
}

.raw-story {
  max-height: 310px;
  overflow: auto;
  padding: 14px;
  background: #fffefa;
  border: 1px solid #eadfce;
  border-radius: 8px;
}

.danger-zone {
  margin-top: 28px;
  padding: 18px;
  background: #fff7f5;
  border: 1px solid #e9c7c1;
  border-radius: 8px;
}

.danger-zone h2 {
  color: var(--danger);
}

.danger-actions {
  display: grid;
  gap: 14px;
}

.file-list,
.consent-list {
  padding-left: 20px;
}

.consent-list li + li {
  margin-top: 10px;
}

.consent-list span {
  display: block;
  font-size: 0.88rem;
}

.admin-side-stats {
  padding: 14px;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-side-stats h3 {
  margin-bottom: 10px;
}

.stat-lines.compact {
  gap: 8px;
}

.stat-lines.compact strong {
  font-size: 1.35rem;
}

.event-search-box {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 10px;
  align-items: end;
  max-width: 920px;
  margin: 12px 0 18px;
  padding: 14px;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.event-search-box .field-help {
  grid-column: 1 / -1;
}

.event-search-hit {
  border-color: #d89a2b !important;
  box-shadow: 0 0 0 4px rgba(216, 154, 43, 0.18);
}

.update-page {
  display: grid;
  gap: 24px;
  background: var(--soft);
}

.update-form-wide {
  width: 100%;
  max-width: none;
}

.update-timeline-section {
  display: grid;
  gap: 12px;
}

.update-timeline .timeline-event {
  width: calc(50% - 32px);
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding: 28px clamp(18px, 5vw, 76px);
  color: var(--muted);
  background: var(--ink);
}

footer a {
  color: var(--white);
}

footer .admin-key {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

@media (max-width: 980px) {
  .hero {
    min-height: 620px;
    background:
      linear-gradient(180deg, rgba(251, 250, 246, 0.98) 0%, rgba(251, 250, 246, 0.9) 54%, rgba(251, 250, 246, 0.48) 100%),
      url("/assets/hero-kindlustus-uus.png") center / cover no-repeat;
  }

  .split,
  .case-grid,
  .case-filter,
  .browse-grid,
  .stat-box-grid,
  .lesson-grid,
  .process-steps,
  .contribution-steps,
  .about-grid,
  .terms-list,
  .event-fields,
  .admin-card,
  .contacts,
  .notice {
    grid-template-columns: 1fr;
  }

  .timeline::before {
    left: 14px;
  }

  .timeline-labels {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-left: 36px;
  }

  .timeline-labels span:first-child,
  .timeline-labels span:last-child {
    text-align: left;
  }

  .timeline-event,
  .mini-timeline .timeline-event {
    width: auto;
    margin-left: 36px;
    justify-self: stretch;
  }

  .timeline-event.client::before,
  .timeline-event.insurer::before,
  .timeline-event.other::before {
    left: -31px;
    right: auto;
  }

  .case-summary-head {
    grid-template-columns: 1fr;
  }

  .case-summary-meta,
  .case-summary-footer {
    justify-content: flex-start;
  }

  .case-detail-sticky {
    position: static;
  }

  .case-detail-scroll {
    max-height: none;
    overflow: visible;
  }

  .event-search-box {
    grid-template-columns: 1fr;
  }

  .update-timeline .timeline-event {
    width: auto;
  }
}

@media (max-width: 680px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .site-stats {
    margin-left: 0;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  nav {
    justify-content: flex-start;
  }

  .hero,
  .split,
  .section,
  .admin-edit {
    padding-top: 58px;
    padding-bottom: 58px;
  }

  .button {
    width: 100%;
  }
}

.file-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

.file-row form {
  margin: 0;
}

.file-upload-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
  padding: 12px;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.file-upload-form label {
  flex: 1 1 260px;
  margin: 0;
}

.button.small {
  font-size: 0.82rem;
  padding: 7px 10px;
}

.approval-warning {
  background: #fff4df;
  border: 1px solid #e6c47f;
  border-radius: 8px;
  color: #7a4d00;
  font-weight: 700;
  padding: 12px 14px;
}

.approval-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 24px auto 0;
  max-width: 1100px;
  padding: 24px;
}

.time-toggle {
  align-self: end;
  min-height: 46px;
}

.event-time-wrap.field-warning input,
label.field-warning input,
[data-time-wrap].field-warning input {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(168, 42, 42, 0.12);
}

.time-warning {
  color: var(--danger);
  font-weight: 700;
}

.admin-edit {
  padding-left: clamp(18px, 3vw, 48px);
  padding-right: clamp(18px, 3vw, 48px);
}

.admin-card {
  align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
}

.admin-card > .panel {
  gap: 12px;
  padding: 22px;
}

.admin-card > .panel textarea {
  min-height: 120px;
}
