:root {
  --ink: #1c2416;
  --muted: #5e6758;
  --paper: #f3f1ea;
  --card: #fffcf7;
  --line: #e0d9cc;
  --pine: #1e4d3a;
  --pine-dark: #143328;
  --gold: #8a6232;
  --bad: #8f2d2d;
  --warn: #8a5a12;
  --soft: #e7f0ea;
  --soft-bad: #f8e8e6;
  --soft-warn: #f8efd8;
  --sidebar: 232px;
  font-family: "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: "Palatino Linotype", Palatino, Georgia, serif; font-weight: 600; margin: 0; }
p { margin: 0; }

.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--pine-dark);
  color: #e7f0ea;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.brand { padding: 0 8px 18px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 14px; }
.brand strong { display: block; font-family: Palatino, Georgia, serif; font-size: 22px; letter-spacing: -.02em; }
.brand span { display: block; margin-top: 4px; color: #b7c9bf; font-size: 13px; }
.nav-label { margin: 16px 8px 6px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #8eaa9c; }
.nav a {
  display: flex; justify-content: space-between; align-items: center;
  color: #e7f0ea; text-decoration: none; padding: 8px 10px; border-radius: 8px; margin-bottom: 2px;
}
.nav a:hover { background: rgba(255,255,255,.06); }
.nav a[aria-current="page"] { background: rgba(255,255,255,.1); box-shadow: inset 3px 0 0 var(--gold); }
.sidebar .nav button {
  display: flex; width: 100%; justify-content: flex-start; align-items: center;
  background: transparent; color: #e7f0ea; border: 0; text-align: left;
  padding: 8px 10px; border-radius: 8px; margin-bottom: 2px; cursor: pointer;
}
.sidebar .nav button:hover { background: rgba(255,255,255,.06); }
.nav em {
  background: var(--bad); color: white; font-style: normal; font-size: 12px;
  min-width: 18px; text-align: center; border-radius: 99px; padding: 0 6px;
}
.main { padding: 28px 32px 64px; max-width: 1180px; }
.main.wide { max-width: 1560px; }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 18px; }
.page-head p, .lead { color: var(--muted); max-width: 68ch; line-height: 1.45; }
.kicker { color: var(--gold); letter-spacing: .14em; text-transform: uppercase; font-size: 12px; margin-bottom: 6px; }
.save-state { color: var(--muted); font-size: 13px; }

.hero, .card, .month, .modal {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.hero { display: flex; justify-content: space-between; gap: 20px; padding: 22px; margin-bottom: 16px; }
.hero h1 { font-size: 34px; letter-spacing: -.03em; }
.cert-line { margin-top: 8px; }
.flag { display: inline-block; padding: 4px 10px; border-radius: 99px; font-size: 14px; }
.flag.ok { background: var(--soft); color: var(--pine); }
.flag.warn { background: var(--soft-warn); color: var(--warn); }
.flag.bad { background: var(--soft-bad); color: var(--bad); }
.ring {
  width: 96px; height: 96px; border-radius: 50%;
  background: conic-gradient(var(--pine) calc(var(--p) * 1%), #e4ddd0 0);
  display: grid; place-items: center; flex: none;
}
.ring b {
  width: 72px; height: 72px; border-radius: 50%; background: var(--card);
  display: grid; place-items: center; font-family: Palatino, Georgia, serif; font-size: 18px;
}
.ring small { display: block; text-align: center; margin-top: 6px; color: var(--muted); font-size: 12px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1.2fr .8fr; gap: 12px; margin-bottom: 16px; }
.card { padding: 16px; }
.card h2 { font-size: 20px; margin-bottom: 8px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: block; width: 100%; text-align: left; background: transparent; border: 0;
  border-bottom: 1px solid var(--line); padding: 8px 0; cursor: pointer;
}
.item:last-child { border-bottom: 0; }
.item strong, .row-title { display: block; }
.meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.gap { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.gap i { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--bad); }
.gap.ok i { background: var(--pine); }
.wheel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.month { padding: 10px; min-height: 120px; }
.month h3 { font-size: 16px; margin-bottom: 8px; }
.chip {
  display: block; width: 100%; text-align: left; border: 0; background: #f6f3ec; color: var(--ink);
  border-left: 3px solid var(--pine); border-radius: 6px; padding: 6px 8px; margin-bottom: 6px; cursor: pointer;
}
.chip.done { border-left-color: var(--pine); opacity: .65; }
.chip.warn { border-left-color: var(--gold); }
.chip.bad { border-left-color: var(--bad); background: var(--soft-bad); }
.chip small { display: block; color: var(--muted); }

.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filters button, .btn, .btn-ghost {
  border-radius: 8px; padding: 8px 12px; cursor: pointer;
}
.filters button { background: transparent; border: 1px solid var(--line); }
.filters button.on { background: var(--pine); color: white; border-color: var(--pine); }
.btn { background: var(--pine); color: white; border: 0; }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
th, td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.click { cursor: pointer; }
tr.click:hover { background: #f7f3ea; }
.table-wrap { overflow: auto; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; background: #efeae0; font-size: 12px; }
.pill.ok { background: var(--soft); color: var(--pine); }
.pill.warn { background: var(--soft-warn); color: var(--warn); }
.pill.bad { background: var(--soft-bad); color: var(--bad); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field.wide { grid-column: 1 / -1; }
.field span { font-size: 13px; color: var(--muted); }
input, select, textarea {
  background: white; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #c9ddd3; border-color: var(--pine); }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; }
.check input { width: auto; margin-top: 3px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.note { background: var(--soft); padding: 10px 12px; border-radius: 8px; margin: 8px 0; }
.doc-text { white-space: pre-wrap; background: white; border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-top: 8px; }
.place-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.place-grid .card p { margin: 8px 0 16px; }
@media (max-width: 800px) { .place-grid { grid-template-columns: 1fr; } }
.agreement { max-width: 820px; margin: 24px auto; padding: 8px 16px 48px; }
.agreement .doc-text { max-height: 52vh; overflow: auto; }
.doc-old { background: #f6f3ec; }
.warnbox { background: var(--soft-warn); padding: 10px 12px; border-radius: 8px; margin-bottom: 8px; }
.empty { color: var(--muted); padding: 12px 0; }

#modal[hidden] { display: none; }
.modal-back { position: fixed; inset: 0; background: rgba(20, 24, 16, .45); }
.modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; padding: 18px;
  z-index: 2;
}
.modal header { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 10px; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 5; }
.toast { background: var(--ink); color: white; padding: 10px 14px; border-radius: 8px; max-width: 320px; }

.firm { padding: 0; }
.firm summary {
  display: flex; justify-content: flex-start; gap: 14px; align-items: center;
  padding: 14px 16px; cursor: pointer; list-style: none;
}
.firm summary::-webkit-details-marker { display: none; }
.firm summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--pine); border-bottom: 2px solid var(--pine); transform: rotate(-45deg); margin-right: 12px; flex: none; }
.firm[open] summary::before { transform: rotate(45deg); }
.firm-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.firm-name b { font-size: 18px; }
.firm-name small, .firm-dates { color: var(--muted); font-size: 13px; }
.firm-dates { display: flex; gap: 16px; white-space: nowrap; }
.firm-body { padding: 0 16px 16px; }
.setup { max-width: 820px; margin: 32px auto; padding: 8px; }
.setup h1 { font-size: 40px; margin: 8px 0; }

@media (max-width: 980px) {
  .app { display: block; }
  .sidebar {
    position: sticky; top: 0; height: auto; width: auto; z-index: 3;
    display: flex; align-items: center; gap: 8px; overflow: auto; padding: 10px;
  }
  .brand { border: 0; margin: 0; padding: 0 8px; flex: none; }
  .brand span, .nav-label { display: none; }
  .nav { display: flex; gap: 6px; }
  .nav a { white-space: nowrap; }
  .grid-3, .grid-2, .wheel, .form-grid { grid-template-columns: 1fr; }
  .main { padding: 16px; }
  .hero { flex-direction: column; }
}
.sheet {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 32px;
  margin-bottom: 16px;
}
.portal { max-width: 760px; margin: 0 auto; padding: 28px 16px 64px; }
.portal h1 { font-size: 36px; margin: 8px 0; }
.scale { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.scale label { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: white; }
.sheet h2 { font-size: 28px; }
.sheet h3 { font-size: 20px; }
.sheet ul { margin: 8px 0 0; padding-left: 18px; }
.site { background: #efeae0; color: var(--ink); }
.site-top {
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
  padding: 18px 7vw; background: var(--pine-dark); color: #f4f7f2;
  position: sticky; top: 0; z-index: 4;
}
.site-top strong { font-family: Palatino, Georgia, serif; font-size: 22px; letter-spacing: -.02em; }
.site-top nav { display: flex; gap: 8px 18px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.site-top a { color: #f4f7f2; text-decoration: none; }
.site-nav-btn { border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 6px 12px; }
.site-hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(280px, .9fr);
  gap: 40px; align-items: center; padding: 56px 7vw 18px;
}
.site-hero .kicker, .site-contact .kicker, .site-price-head .kicker { color: var(--gold); letter-spacing: .08em; text-transform: uppercase; font-size: 13px; }
.site-hero h1 { font-size: 68px; line-height: .92; letter-spacing: -.045em; max-width: 11ch; margin-top: 8px; }
.site-hero .lead, .site-contact .lead { font-size: 19px; line-height: 1.45; margin-top: 18px; max-width: 42ch; }
.site-hero .closing { margin-top: 14px; max-width: 46ch; color: var(--muted); }
.site-cta { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.site-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--pine); color: #f4f7f2; text-decoration: none;
  border: 0; border-radius: 999px; padding: 12px 18px; cursor: pointer;
}
.site-btn-ghost { background: transparent; color: var(--pine); border: 1px solid var(--pine); }
.site-gallery { padding: 8px 7vw 28px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.shot {
  margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 14px; box-shadow: 0 16px 40px rgba(20, 51, 40, .08);
}
.shot figcaption { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.shot-bar { display: flex; align-items: center; gap: 6px; background: var(--pine-dark); color: #f4f7f2; border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; }
.shot-bar span { width: 8px; height: 8px; border-radius: 50%; background: #c9a06a; }
.shot-bar b { margin-left: 6px; font-weight: 600; }
.shot-months { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.shot-months div { background: var(--paper); border-radius: 10px; padding: 10px; min-height: 72px; }
.shot-months .on { background: #e7f0ea; outline: 1px solid var(--pine); }
.shot-months small { display: block; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.shot-months i { font-style: normal; display: block; margin-top: 6px; }
.shot-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.shot-list li { background: var(--paper); border-radius: 10px; padding: 10px 12px; }
.shot-list b { display: block; }
.shot-list span, .shot > p { color: var(--muted); font-size: 13px; }
.shot > p { margin-top: 10px; }
.shot-heat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.shot-heat span { height: 54px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #143328; font-size: 22px; }
.shot-heat .heat-low { background: #8fbf86; }
.shot-heat .heat-mid { background: #e0b03a; }
.shot-heat .heat-high { background: #d46a62; }
.shot-heat .on { outline: 2px solid #143328; }
.site-points, .site-prices { padding: 12px 7vw 28px; display: grid; gap: 14px; }
.site-points { grid-template-columns: repeat(3, 1fr); }
.site-prices { grid-template-columns: repeat(4, 1fr); }
.site-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.site-card h2 { font-size: 24px; margin-bottom: 8px; }
.site-card p { color: var(--muted); line-height: 1.45; }
.site-card b { display: block; margin-top: 16px; font-family: Palatino, Georgia, serif; font-size: 28px; color: var(--pine); }
.site-price-head { padding: 8px 7vw 0; }
.site-price-head h2 { font-size: 40px; margin: 6px 0 8px; }
.site-contact {
  margin: 8px 7vw 12px; padding: 28px; display: grid; grid-template-columns: .85fr 1.15fr; gap: 28px;
  background: var(--pine-dark); color: #f4f7f2; border-radius: 22px;
}
.site-contact h2 { font-size: 36px; margin-top: 8px; max-width: 14ch; }
.site-contact .lead { color: #d7e4db; }
.site-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.site-form label { display: grid; gap: 6px; font-size: 13px; color: #d7e4db; }
.site-form .wide { grid-column: 1 / -1; }
.site-form input, .site-form textarea {
  width: 100%; border: 0; border-radius: 10px; padding: 11px 12px; background: #fffcf7; color: var(--ink);
}
.site-form-note { grid-column: 1 / -1; min-height: 1.2em; }
.site-foot { padding: 22px 7vw 40px; color: var(--muted); }
.seller-only[hidden] { display: none; }
@media (max-width: 980px) {
  .site-top { flex-direction: column; align-items: flex-start; }
  .site-top nav { justify-content: flex-start; }
  .site-hero, .site-contact, .site-form { grid-template-columns: 1fr; }
  .site-hero h1 { font-size: 46px; max-width: none; }
  .site-gallery, .site-points, .site-prices { grid-template-columns: 1fr; }
  .site-top, .site-hero, .site-price-head, .site-foot, .site-gallery { padding-left: 18px; padding-right: 18px; }
  .site-points, .site-prices { padding-left: 18px; padding-right: 18px; }
  .site-contact { margin-left: 18px; margin-right: 18px; }
}

.analyse { background: #fff; border: 1px solid #1a3d22; margin-bottom: 16px; }
.analyse-title {
  background: #143328; color: #f4f7f2; text-align: center;
  font-family: Palatino, Georgia, serif; font-size: 22px; padding: 8px 12px;
}
.analyse-table { min-width: 1100px; }
.analyse-table th {
  background: #1e4d3a; color: #f4f7f2; text-transform: none; letter-spacing: 0;
  font-size: 13px; font-weight: 600; border: 1px solid #143328;
}
.analyse-table td { border: 1px solid #cfc6b6; white-space: pre-wrap; font-size: 13px; line-height: 1.35; background: #fff; }
.analyse-table td.proc { font-family: Palatino, Georgia, serif; font-style: italic; font-weight: 700; }
.heat { display: grid; grid-template-columns: auto 16px; justify-content: center; gap: 4px 6px; }
.heat-grid, .matrix-grid { display: grid; grid-template-columns: repeat(3, 22px); gap: 2px; }
.heat-cell {
  width: 22px; height: 16px; padding: 0; border: 1px solid rgba(0,0,0,.35);
  font: 700 13px Georgia, serif; line-height: 1; cursor: pointer; color: #1c2416; background: #ddd;
}
.heat-low { background: #3f8f4a; }
.heat-mid { background: #e0b03a; }
.heat-high { background: #c4453a; }
.heat-cell.on { box-shadow: inset 0 0 0 2px #111; }
.heat-x { grid-column: 1; text-align: center; font-size: 10px; line-height: 1.15; color: #1c2416; }
.heat-y { grid-column: 2; grid-row: 1; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; letter-spacing: .04em; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chart-card { padding: 16px; }
.chart-card h2 { font-size: 22px; margin-bottom: 4px; }
.chart { width: 100%; height: auto; display: block; }
.pie-wrap { display: flex; gap: 16px; align-items: center; }
.chart.pie { width: 180px; flex: none; }
.pie-legend { display: grid; gap: 6px; font-size: 13px; }
.pie-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; }
.matrix-chart { display: grid; grid-template-columns: auto 18px; gap: 6px 8px; justify-content: start; }
.matrix-grid { grid-template-columns: repeat(3, minmax(90px, 1fr)); }
.matrix-cell { min-height: 64px; padding: 6px; border: 1px solid rgba(0,0,0,.3); font-size: 12px; line-height: 1.3; }
@media (max-width: 900px) { .chart-grid { grid-template-columns: 1fr; } }

@media print {
  .sidebar, .btn, .btn-ghost, .filters, .no-print, .page-head .btn-row { display: none !important; }
  .app { display: block; }
  .main { max-width: none; padding: 0; }
  .wheel { grid-template-columns: repeat(3, 1fr); }
  body { background: white; }
  .sheet { border: 0; border-radius: 0; page-break-after: always; }
}
