/* ================================================================== */
/*  Дерево добрых дел — оформление                                     */
/* ================================================================== */

:root {
  --ink: #22321f;
  --ink-soft: #43543b;
  --ink-faint: #6d7a62;
  --cream: #fbf6e7;
  --cream-2: #f2e9d2;
  --green: #2f5d3a;
  --green-deep: #22452c;
  --green-soft: #7da55c;
  --gold: #d7a64a;
  --gold-soft: #efd79a;
  --line: rgba(46, 64, 35, 0.14);
  --glass: rgba(252, 247, 233, 0.62);
  --glass-strong: rgba(252, 247, 233, 0.86);
  --shadow-soft: 0 16px 42px rgba(31, 47, 26, 0.16);
  --shadow-card: 0 40px 100px rgba(17, 28, 14, 0.36);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  overflow: hidden;
  background: #dfe9d7;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overscroll-behavior: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

svg {
  display: block;
}

::selection {
  background: rgba(125, 165, 92, 0.35);
  color: var(--ink);
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  z-index: 1;
}

#scene.can-pan {
  cursor: grab;
}

#scene.is-panning {
  cursor: grabbing;
}

/* ------------------------------------------------------------------ */
/*  Атмосфера                                                          */
/* ------------------------------------------------------------------ */

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(130% 95% at 50% 42%, transparent 52%, rgba(35, 53, 28, 0.2) 100%),
    linear-gradient(180deg, rgba(255, 248, 226, 0.08), transparent 30%);
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------ */
/*  Интерфейс                                                          */
/* ------------------------------------------------------------------ */

.ui {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.ui > * {
  pointer-events: none;
}

.ui button,
.ui a,
.ui .counter {
  pointer-events: auto;
}

.hero,
.topbar,
.bottom {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1s cubic-bezier(0.2, 0.75, 0.25, 1), transform 1s cubic-bezier(0.2, 0.75, 0.25, 1);
}

body.is-ready .hero,
body.is-ready .topbar,
body.is-ready .bottom {
  opacity: 1;
  transform: translateY(0);
}

body.is-ready .topbar {
  transition-delay: 0.18s;
}

body.is-ready .bottom {
  transition-delay: 0.34s;
}

/* Заголовок -------------------------------------------------------- */

.hero {
  position: fixed;
  top: clamp(28px, 5.2vh, 62px);
  left: clamp(20px, 5vw, 74px);
  width: min(470px, 42vw);
  z-index: 11;
  text-shadow: 0 2px 28px rgba(255, 251, 234, 0.72), 0 1px 2px rgba(255, 255, 255, 0.25);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -56px -70px -40px -60px;
  z-index: -1;
  background: radial-gradient(70% 75% at 34% 38%, rgba(255, 249, 232, 0.76), rgba(255, 247, 224, 0.28) 55%, transparent 80%);
  filter: blur(10px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #38502f;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.eyebrow svg {
  width: 17px;
  height: 17px;
  color: #4f7a43;
  flex: none;
}

.eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(215, 166, 74, 0.16);
}

.hero h1 {
  margin: 20px 0 0;
  font-family: var(--serif);
  font-size: clamp(58px, 6.3vw, 92px);
  font-weight: 600;
  line-height: 0.86;
  letter-spacing: -0.022em;
  color: #25371f;
}

.hero h1 span {
  display: inline-block;
  position: relative;
  margin-top: 0.08em;
  padding-left: 0.12em;
  font-style: italic;
  font-weight: 500;
  color: #345f3c;
}

.hero h1 span::after {
  content: "";
  position: absolute;
  left: 0.08em;
  right: 0.02em;
  bottom: 0.02em;
  height: 0.12em;
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(215, 166, 74, 0), rgba(215, 166, 74, 0.48), rgba(125, 165, 92, 0));
  filter: blur(1px);
  z-index: -1;
}

.lede {
  max-width: 370px;
  margin: 24px 0 0;
  color: #24391f;
  font-size: 14px;
  text-shadow: 0 1px 12px rgba(255, 252, 240, 0.85);
  font-weight: 500;
  line-height: 1.68;
  letter-spacing: 0.002em;
}

.is-night .hero {
  text-shadow: 0 2px 18px rgba(4, 12, 26, 0.64);
}

.is-night .hero::before {
  background: radial-gradient(70% 75% at 34% 38%, rgba(9, 21, 36, 0.56), transparent 80%);
}

.is-night .hero h1 {
  color: #e7eedf;
}

.is-night .hero h1 span,
.is-night .eyebrow,
.is-night .eyebrow svg {
  color: #a8caab;
}

.is-night .lede {
  color: #d8e3dc;
  text-shadow: 0 1px 9px rgba(4, 12, 26, 0.78);
}

/* Верхняя панель ---------------------------------------------------- */

.topbar {
  position: fixed;
  top: clamp(22px, 4.5vh, 46px);
  right: clamp(18px, 4vw, 58px);
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 13px;
}

.glass {
  background: linear-gradient(140deg, rgba(255, 251, 240, 0.78), rgba(247, 238, 215, 0.52));
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: 0 14px 38px rgba(46, 63, 34, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
  backdrop-filter: blur(18px) saturate(1.18);
}

.counter {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 138px;
  padding: 9px 18px 10px;
  border-radius: 17px;
  color: var(--ink);
}

.counter-label {
  color: #68755c;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.counter-value {
  margin-top: 1px;
  color: #3b5334;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.counter-value strong {
  display: inline-block;
  margin-right: 3px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  color: #2d4b30;
  font-variant-numeric: tabular-nums;
}

/* Кнопки ------------------------------------------------------------ */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  padding: 15px 24px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.012em;
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.28s, background 0.28s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn svg {
  width: 19px;
  height: 19px;
  flex: none;
}

.btn-primary {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(138deg, #487a4f 0%, #315c39 48%, #254a2e 100%);
  color: #faf3df;
  box-shadow: 0 16px 34px rgba(37, 72, 45, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 120% at 18% 0%, rgba(255, 247, 213, 0.24), transparent 55%);
  opacity: 0.9;
  pointer-events: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 21px 40px rgba(37, 72, 45, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn:focus-visible,
.icon-btn:focus-visible,
.swatch:focus-visible {
  outline: 3px solid rgba(125, 165, 92, 0.65);
  outline-offset: 3px;
}

.btn-ghost {
  padding: 11px 17px;
  border: 1px solid rgba(47, 93, 58, 0.24);
  background: rgba(255, 255, 255, 0.4);
  color: #2f5537;
  font-size: 12px;
  box-shadow: none;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.75);
  transform: translateY(-1px);
}

.btn-wide {
  width: 100%;
  min-height: 51px;
  margin-top: 4px;
}

.btn[disabled] {
  cursor: default;
  opacity: 0.65;
  transform: none;
}

.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(250, 243, 223, 0.35);
  border-top-color: #faf3df;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn.is-loading .btn-label {
  display: none;
}

.btn.is-loading .btn-spinner {
  display: block;
}

/* Нижняя строка ----------------------------------------------------- */

.bottom {
  position: fixed;
  left: clamp(18px, 4vw, 54px);
  right: clamp(18px, 4vw, 54px);
  bottom: clamp(18px, 3.4vh, 34px);
  z-index: 11;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 17px 11px 13px;
  border-radius: 999px;
  color: #46543c;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: opacity 0.7s, transform 0.7s;
}

.hint.is-hidden {
  opacity: 0;
  transform: translateY(8px);
}

.hint-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(74, 108, 63, 0.1);
  color: #3f613a;
}

.hint-icon svg {
  width: 16px;
  height: 16px;
}

.credit {
  color: rgba(250, 245, 228, 0.82);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 14px rgba(29, 45, 24, 0.45);
}

/* ------------------------------------------------------------------ */
/*  Подсказка у листочка                                               */
/* ------------------------------------------------------------------ */

.leaf-tooltip {
  position: fixed;
  z-index: 40;
  display: flex;
  gap: 10px;
  max-width: 292px;
  padding: 12px 15px 13px;
  border: 1px solid rgba(255, 248, 225, 0.16);
  border-radius: 16px;
  background: rgba(31, 48, 28, 0.92);
  box-shadow: 0 18px 44px rgba(15, 25, 12, 0.3);
  color: #f9f2dd;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition: opacity 0.18s, transform 0.18s;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.leaf-tooltip.visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.tt-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  flex: none;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--leaf-mid, #7da55c);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.tt-body {
  min-width: 0;
}

.tt-body strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.tt-body p {
  display: -webkit-box;
  overflow: hidden;
  margin: 4px 0 0;
  color: rgba(249, 242, 221, 0.76);
  font-size: 11.5px;
  line-height: 1.5;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* ------------------------------------------------------------------ */
/*  Тост                                                               */
/* ------------------------------------------------------------------ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 70;
  padding: 12px 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(35, 58, 35, 0.94);
  box-shadow: 0 18px 44px rgba(15, 25, 12, 0.28);
  color: #f9f2dd;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.015em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity 0.35s, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ------------------------------------------------------------------ */
/*  Модальные окна                                                     */
/* ------------------------------------------------------------------ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 30, 16, 0.44);
  -webkit-backdrop-filter: blur(7px) saturate(0.9);
  backdrop-filter: blur(7px) saturate(0.9);
}

.modal-card {
  position: relative;
  width: min(500px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 38px 40px 32px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 30px;
  background:
    radial-gradient(90% 60% at 8% 0%, rgba(255, 253, 244, 0.94), transparent 55%),
    linear-gradient(155deg, #fdf9ec 0%, #f7efdc 58%, #f1e7d0 100%);
  box-shadow: var(--shadow-card), inset 0 1px 0 #fffdf6;
  transform: translateY(18px) scale(0.97);
  transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(83, 104, 66, 0.35) transparent;
}

.modal.open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-card::-webkit-scrollbar {
  width: 6px;
}

.modal-card::-webkit-scrollbar-thumb {
  background: rgba(83, 104, 66, 0.3);
  border-radius: 99px;
}

.icon-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(46, 64, 35, 0.07);
  color: #3b5133;
  cursor: pointer;
  transition: background 0.2s, transform 0.25s;
}

.icon-btn:hover {
  background: rgba(46, 64, 35, 0.13);
  transform: rotate(90deg);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

/* Карточка дела ----------------------------------------------------- */

.deed-card {
  display: grid;
  grid-template-columns: 152px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  width: min(590px, calc(100vw - 32px));
  padding: 40px 42px 34px;
}

.deed-leaf {
  position: relative;
  filter: drop-shadow(0 18px 20px rgba(61, 66, 30, 0.18));
}

.deed-leaf svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.deed-leaf .leaf-body {
  fill: url(#deedLeafGradient);
  stroke: var(--leaf-edge, #214b2a);
  stroke-width: 2;
  stroke-linejoin: round;
}

.leaf-stop-base {
  stop-color: var(--leaf-base, #2f6b3a);
}

.leaf-stop-mid {
  stop-color: var(--leaf-mid, #569c4d);
}

.leaf-stop-light {
  stop-color: var(--leaf-light, #8ac45f);
}

.deed-leaf .leaf-stem {
  fill: none;
  stroke: var(--leaf-edge, #214b2a);
  stroke-width: 3;
  stroke-linecap: round;
}

.deed-leaf .leaf-shadow {
  fill: var(--leaf-base, #2f6b3a);
  opacity: 0.32;
  transform: translate(6px, 5px);
}

.deed-leaf .leaf-vein-main {
  fill: none;
  stroke: var(--leaf-vein, #dcebb4);
  stroke-width: 2.4;
  stroke-linecap: round;
  opacity: 0.8;
}

.deed-leaf .leaf-vein {
  fill: none;
  stroke: var(--leaf-vein, #dcebb4);
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: 0.48;
}

.deed-copy {
  min-width: 0;
}

.deed-card h2 {
  margin: 9px 0 0;
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  color: #273b22;
}

.deed-color-name {
  margin: 7px 0 0;
  color: #6d7a5e;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.deed-card blockquote {
  margin: 20px 0 0;
  padding-left: 17px;
  border-left: 2px solid rgba(215, 166, 74, 0.5);
  color: #3a4b32;
  font-family: var(--serif);
  font-size: 21px;
  font-style: italic;
  font-weight: 500;
  line-height: 1.38;
}

.deed-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 26px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}

.thankyou {
  color: #8a763f;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Форма ------------------------------------------------------------- */

.add-card {
  width: min(520px, calc(100vw - 32px));
}

.add-card h2 {
  margin: 13px 0 25px;
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.012em;
  color: #273b22;
}

.field {
  display: block;
  margin: 0 0 17px;
}

.field > span:first-child,
.colors legend {
  display: block;
  margin-bottom: 8px;
  color: #5c694f;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid rgba(60, 77, 45, 0.17);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  padding: 13px 15px;
  color: #2a3a24;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #a0a892;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  background: rgba(255, 255, 255, 0.72);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(104, 145, 78, 0.7);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(125, 165, 92, 0.14);
}

.field textarea {
  min-height: 94px;
  max-height: 190px;
  resize: vertical;
}

.field-meta {
  display: block;
  margin-top: 4px;
  color: #8d977f;
  font-size: 10px;
  text-align: right;
}

.field-note {
  display: block;
  margin-top: 5px;
  color: #8d977f;
  font-size: 10.5px;
  line-height: 1.4;
}

.colors {
  margin: 4px 0 18px;
  padding: 0;
  border: 0;
}

.colors legend {
  margin-bottom: 10px;
}

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

.swatch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 10px;
  border: 1px solid rgba(60, 77, 45, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  color: #4b5a42;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.2s;
}

.swatch:hover {
  background: rgba(255, 255, 255, 0.7);
  transform: translateY(-1px);
}

.swatch[aria-pressed="true"] {
  border-color: rgba(74, 102, 60, 0.52);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 5px 14px rgba(55, 75, 40, 0.11), inset 0 0 0 1px rgba(74, 102, 60, 0.12);
}

.swatch-dot {
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: linear-gradient(135deg, var(--swatch-light), var(--swatch));
  box-shadow: inset 0 0 0 1px rgba(45, 58, 30, 0.14);
}

.form-error {
  min-height: 17px;
  margin: 0 0 10px;
  color: #a3482d;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.45;
  opacity: 0;
  transition: opacity 0.2s;
}

.form-error.show {
  opacity: 1;
}

.modal-note {
  margin: 13px 4px 0;
  color: #7c876f;
  font-size: 10.5px;
  line-height: 1.55;
  text-align: center;
}

/* ------------------------------------------------------------------ */
/*  Загрузка                                                           */
/* ------------------------------------------------------------------ */

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background:
    radial-gradient(70% 60% at 50% 36%, #f7f0dc 0%, #e9eddc 45%, #d7e5d2 100%);
  color: #3c5937;
  transition: opacity 0.9s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.9s;
}

.loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  text-align: center;
}

.loader-leaf {
  width: 66px;
  height: auto;
  margin-bottom: 20px;
  color: #4f7c46;
  animation: leaf-float 3.2s ease-in-out infinite;
  filter: drop-shadow(0 10px 16px rgba(60, 84, 45, 0.18));
}

.loader-inner p {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.01em;
  color: #38532f;
}

.loader-line {
  width: 156px;
  height: 2px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(64, 92, 54, 0.14);
}

.loader-line i {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(125, 165, 92, 0), #6e9855, rgba(215, 166, 74, 0.65));
  animation: loader-slide 1.8s ease-in-out infinite;
}

.noscript {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  margin: 0;
  color: #6d3a24;
  font-size: 13px;
  text-align: center;
}

/* ------------------------------------------------------------------ */
/*  Анимации                                                           */
/* ------------------------------------------------------------------ */

@keyframes leaf-float {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-9px) rotate(3deg);
  }
}

@keyframes loader-slide {
  0% {
    transform: translateX(-110%);
  }
  50% {
    transform: translateX(120%);
  }
  100% {
    transform: translateX(250%);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------------ */
/*  Адаптивность                                                       */
/* ------------------------------------------------------------------ */

@media (max-width: 1100px) {
  .hero {
    width: min(430px, 46vw);
  }

  .hero h1 {
    font-size: clamp(52px, 7vw, 74px);
  }

  .lede {
    max-width: 320px;
    font-size: 13px;
  }

  .topbar {
    gap: 10px;
  }

  .counter {
    min-width: 124px;
    padding: 8px 15px 9px;
  }
}

@media (max-width: 820px) {
  .hero {
    top: 22px;
    left: 20px;
    width: auto;
    right: 20px;
  }

  .hero h1 {
    margin-top: 15px;
    font-size: clamp(46px, 10.5vw, 68px);
  }

  .lede {
    max-width: 280px;
    margin-top: 17px;
    font-size: 12px;
    line-height: 1.55;
  }

  .topbar {
    top: auto;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    left: 14px;
    gap: 9px;
  }

  .topbar .btn {
    flex: 1.35;
    padding: 14px 16px;
    font-size: 12.5px;
  }

  .counter {
    flex: 1;
    min-width: 0;
    padding: 8px 14px 9px;
  }

  .counter-value {
    font-size: 10.5px;
  }

  .counter-value strong {
    font-size: 24px;
  }

  .bottom {
    display: none;
  }

  .toast {
    bottom: calc(92px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 28px);
    white-space: normal;
    text-align: center;
    line-height: 1.4;
  }

  .modal {
    padding: 16px;
    place-items: start center;
  }

  .modal-card {
    margin: auto 0;
  }

  .deed-card {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 18px;
    width: min(520px, calc(100vw - 32px));
    padding: 34px 24px 28px;
  }

  .deed-card h2 {
    font-size: 30px;
  }

  .deed-card blockquote {
    margin-top: 16px;
    font-size: 18px;
  }

  .deed-footer {
    grid-column: 1 / -1;
  }

  .add-card {
    padding: 32px 24px 26px;
  }

  .add-card h2 {
    font-size: 32px;
  }

  .field input,
  .field select,
  .field textarea {
    font-size: 16px;
  }
}

@media (max-width: 520px) {
  .hero h1 {
    font-size: clamp(41px, 12vw, 58px);
  }

  .lede {
    display: none;
  }

  .eyebrow {
    font-size: 9px;
    letter-spacing: 0.14em;
  }

  .counter-label {
    font-size: 8px;
  }

  .counter-value {
    font-size: 10px;
  }

  .topbar .btn span {
    white-space: nowrap;
  }

  .topbar .btn svg {
    width: 17px;
    height: 17px;
  }

  .deed-card {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 6px;
    padding: 32px 22px 26px;
  }

  .deed-leaf {
    width: 84px;
    margin-bottom: 6px;
  }

  .deed-card h2 {
    font-size: 29px;
  }

  .deed-footer {
    width: 100%;
  }

  .deed-footer .btn {
    width: 100%;
  }

  .add-card h2 {
    font-size: 29px;
  }

  .swatch {
    flex: 1 1 calc(50% - 8px);
    justify-content: flex-start;
  }
}

@media (hover: none) {
  .leaf-tooltip {
    display: none;
  }
}

@media (max-height: 660px) and (min-width: 821px) {
  .hero h1 {
    font-size: clamp(46px, 5vw, 62px);
  }

  .lede {
    display: none;
  }

  .hero::before {
    inset: -40px -60px -20px -50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ------------------------------------------------------------------ */
/*  Панель природы: время, сезон, погода, масштаб                      */
/* ------------------------------------------------------------------ */

.nature-dock {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 13;
  width: min(700px, calc(100vw - 32px));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}

.nature-toggle {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 15px 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 18px;
  background: linear-gradient(140deg, rgba(255, 251, 240, 0.82), rgba(247, 238, 215, 0.58));
  box-shadow: 0 14px 38px rgba(46, 63, 34, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  color: #31492c;
  text-align: left;
  cursor: pointer;
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
  backdrop-filter: blur(18px) saturate(1.18);
  transition: transform 0.25s, box-shadow 0.25s;
}

.nature-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(46, 63, 34, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.nature-toggle-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: rgba(69, 105, 61, 0.12);
  color: #42633b;
}

.nature-toggle-icon svg {
  width: 18px;
  height: 18px;
}

.nature-toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.nature-toggle-copy strong {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nature-toggle-copy small {
  color: #65745a;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nature-chevron {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  color: #66775a;
  transition: transform 0.3s;
}

.nature-chevron svg {
  width: 17px;
  height: 17px;
  transform: rotate(180deg);
}

.nature-dock.open .nature-chevron svg {
  transform: rotate(0deg);
}

.nature-panel {
  pointer-events: none;
  visibility: hidden;
  overflow: hidden;
  max-height: 0;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 23px;
  background: linear-gradient(145deg, rgba(255, 251, 240, 0.9), rgba(244, 235, 211, 0.72));
  box-shadow: 0 24px 60px rgba(40, 56, 30, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transform-origin: bottom center;
  transition: opacity 0.32s, transform 0.32s, max-height 0.4s, padding 0.32s, visibility 0.32s;
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  backdrop-filter: blur(20px) saturate(1.15);
}

.nature-dock.open .nature-panel {
  pointer-events: auto;
  visibility: visible;
  max-height: 500px;
  padding: 15px 18px 15px;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.nature-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nature-panel-head .eyebrow {
  font-size: 9px;
  letter-spacing: 0.14em;
}

.time-value {
  color: #3b5734;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.time-slider-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  color: #77826c;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.time-slider-row input {
  flex: 1;
  height: 5px;
  margin: 0;
  border-radius: 99px;
  outline: none;
  background: linear-gradient(90deg, #15253c 0%, #587c9f 16%, #f4d59d 38%, #dce9e7 55%, #d79a72 78%, #18243a 100%);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.time-slider-row input::-webkit-slider-thumb {
  width: 17px;
  height: 17px;
  border: 2px solid #fff9e9;
  border-radius: 50%;
  background: #4f7046;
  box-shadow: 0 2px 8px rgba(35, 53, 29, 0.35);
  -webkit-appearance: none;
  appearance: none;
}

.time-slider-row input::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid #fff9e9;
  border-radius: 50%;
  background: #4f7046;
  box-shadow: 0 2px 8px rgba(35, 53, 29, 0.35);
}

body[data-place]:not([data-place="meadow"]):not(.is-night):not(.is-storm) .hero::before {
  background: radial-gradient(70% 75% at 34% 45%, rgba(255, 251, 240, 0.82), rgba(255, 251, 240, 0.45) 45%, transparent 78%);
}

body[data-place]:not([data-place="meadow"]):not(.is-night):not(.is-storm) .lede {
  color: #1f2f1c;
  text-shadow: 0 0 6px rgba(255, 251, 238, 0.95), 0 0 14px rgba(255, 251, 238, 0.9), 0 0 24px rgba(255, 251, 238, 0.8);
}

body[data-place]:not([data-place="meadow"]).is-night .hero::before {
  background: radial-gradient(70% 75% at 34% 40%, rgba(6, 12, 24, 0.78), rgba(6, 12, 24, 0.4) 50%, transparent 80%);
}

body[data-place]:not([data-place="meadow"]).is-night .hero {
  text-shadow: 0 2px 14px rgba(4, 8, 18, 0.95);
}

.nature-group-place {
  margin-top: 13px;
}

/* Дымка на время смены локации. */
.place-veil {
  position: fixed;
  inset: 0;
  z-index: 3;
  background: radial-gradient(circle at 50% 45%, #f4f0e2, #b9ccc0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.place-veil.show {
  opacity: 1;
}

.is-night .place-veil {
  background: radial-gradient(circle at 50% 45%, #22344f, #0a1220);
}

.nature-groups {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-top: 13px;
}

.nature-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.nature-group-zoom {
  margin-left: auto;
}

.nature-label {
  color: #6c7960;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chip {
  padding: 6px 10px;
  border: 1px solid rgba(62, 81, 48, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  color: #526247;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, color 0.14s, transform 0.14s;
  -webkit-tap-highlight-color: transparent;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.78);
  transform: translateY(-1px);
}

.chip.active {
  border-color: rgba(48, 82, 45, 0.55);
  background: #3d633e;
  color: #faf4de;
  box-shadow: 0 4px 12px rgba(44, 76, 42, 0.2);
}

.zoom-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.zoom-btn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(62, 81, 48, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.52);
  color: #405a39;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.zoom-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: scale(1.05);
}

.zoom-value {
  min-width: 35px;
  color: #4b6041;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.zoom-reset {
  margin-left: 2px;
  padding: 5px 8px;
  border: 0;
  background: transparent;
  color: #77846c;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
}

.zoom-reset:hover {
  color: #35502e;
}

.weather-flash {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: #e7f2ff;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}

.weather-flash.flash {
  animation: lightning-flash 0.5s ease-out;
}

@keyframes lightning-flash {
  0% { opacity: 0; }
  10% { opacity: 0.55; }
  24% { opacity: 0.08; }
  38% { opacity: 0.35; }
  100% { opacity: 0; }
}

@media (max-width: 1500px) {
  .hint {
    display: none;
  }
}

@media (max-width: 1300px) {
  .credit {
    display: none;
  }
}

@media (max-width: 820px) {
  .nature-dock {
    bottom: calc(86px + env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
  }

  .nature-toggle {
    padding: 9px 12px;
    border-radius: 16px;
  }

  .nature-panel {
    padding-left: 13px;
    padding-right: 13px;
  }

  .nature-groups {
    flex-wrap: wrap;
    gap: 11px 16px;
  }

  .nature-group-zoom {
    margin-left: 0;
  }

  .nature-dock.open .nature-panel {
    max-height: min(62vh, 430px);
    overflow-y: auto;
  }

  .chip {
    padding: 5px 9px;
  }

  .time-value {
    font-size: 19px;
  }
}

@media (max-width: 520px) {
  .nature-dock {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .nature-toggle-copy small {
    font-size: 9.5px;
  }

  .nature-toggle-copy strong {
    font-size: 10px;
  }
}

/* ------------------------------------------------------------------ */
/*  Стекло, меняющееся вместе со временем суток                        */
/* ------------------------------------------------------------------ */

.glass,
.nature-toggle,
.nature-panel,
.btn-primary {
  transition-property: background-color, border-color, box-shadow, color, opacity, transform, max-height, padding, visibility;
}

.is-night .glass,
.is-night .nature-toggle,
.is-night .nature-panel {
  border-color: rgba(176, 202, 255, 0.18);
  background: linear-gradient(145deg, rgba(28, 44, 62, 0.74), rgba(13, 24, 40, 0.6));
  box-shadow: 0 18px 46px rgba(1, 6, 16, 0.46), inset 0 1px 0 rgba(190, 214, 255, 0.12);
  color: #e6eee0;
}

.is-night .counter,
.is-night .counter-value,
.is-night .counter-value strong,
.is-night .counter-label,
.is-night .hint,
.is-night .nature-toggle strong,
.is-night .nature-toggle small,
.is-night .nature-panel :is(.eyebrow, .time-value, .nature-label, .time-slider-row, .zoom-value) {
  color: #dfe9da;
}

.is-night .nature-toggle-icon,
.is-night .hint-icon {
  background: rgba(214, 230, 255, 0.12);
  color: #f2d995;
}

.is-night .nature-chevron {
  color: #dfe9da;
}

.is-night .nature-panel :is(.chip:not(.active), .zoom-btn, .zoom-reset) {
  border-color: rgba(190, 214, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
  color: #e6eee0;
}

.is-night .btn-primary {
  background: linear-gradient(138deg, #f3d58c 0%, #e0b45c 55%, #c9953f 100%);
  color: #26200f;
  box-shadow: 0 0 34px rgba(240, 196, 100, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

/* Компактная панель природы не закрывает луг. */
@media (min-width: 821px) {
  .nature-toggle {
    align-self: center;
    width: min(330px, 100%);
    border-radius: 999px;
  }

  .nature-dock.open .nature-toggle {
    width: 100%;
  }
}

/* В грозу сцена тёмная — заголовок становится светлым. */
.is-storm .hero {
  text-shadow: 0 2px 18px rgba(8, 14, 20, 0.72);
}

.is-storm .hero::before {
  background: radial-gradient(70% 75% at 34% 38%, rgba(10, 18, 26, 0.5), transparent 80%);
}

.is-storm .hero h1 {
  color: #eef3e8;
}

.is-storm .hero h1 span,
.is-storm .hero .eyebrow,
.is-storm .hero .eyebrow svg {
  color: #bcd8bc;
}

.is-storm .lede {
  color: #e2ebe4;
}

/* Настройки сцены ---------------------------------------------------- */

.topbar { transition-property: opacity, transform, right; }

.settings-toggle {
  pointer-events: auto;
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #2f4a30;
  cursor: pointer;
}

.settings-toggle svg { width: 22px; height: 22px; }
.settings-toggle:focus-visible { outline: 3px solid rgba(125, 165, 92, 0.65); outline-offset: 3px; }
.is-night .settings-toggle { color: #e6eee0; }

.settings-panel {
  --panel-width: 340px;
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: var(--panel-width);
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 22px;
  background: rgba(250, 246, 233, 0.92);
  box-shadow: 0 24px 60px rgba(20, 32, 16, 0.28);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
  visibility: hidden;
  transform: translateX(calc(100% + 20px));
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.32s;
}

.settings-panel.open { visibility: visible; transform: none; }

.settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px 20px;
  border-bottom: 1px solid var(--line);
}

.settings-head h2 { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 600; line-height: 1.1; }
.settings-head p { margin: 4px 0 0; color: var(--ink-faint); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.settings-head .icon-btn { position: static; flex: none; }

.settings-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 14px 12px 20px; }

.settings-section { border-bottom: 1px solid var(--line); }
.settings-section summary { padding: 13px 0; font-size: 13px; font-weight: 700; cursor: pointer; }
.settings-section summary::marker { color: var(--green-soft); }
.settings-list { display: grid; gap: 11px; padding: 0 4px 15px 0; }

.setting {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 10px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.setting output { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.setting input[type="range"] { grid-column: 1 / -1; width: 100%; margin: 0; accent-color: var(--green); }
.setting input[type="checkbox"] { width: 17px; height: 17px; margin: 0; accent-color: var(--green); }
.setting input[type="color"] { width: 42px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: none; cursor: pointer; }

.setting select {
  max-width: 172px;
  padding: 6px 8px;
  border: 1px solid rgba(47, 93, 58, 0.24);
  border-radius: 9px;
  background: #fffdf5;
  color: var(--ink);
  font: inherit;
}

.settings-foot { padding: 11px 14px 15px; border-top: 1px solid var(--line); }
.settings-status { margin: 0 6px 9px; color: var(--ink-faint); font-size: 11.5px; font-weight: 600; }
.settings-status.dirty { color: #8a5a12; }
.settings-actions { display: flex; gap: 7px; }
.settings-actions .btn { flex: 1 1 auto; padding: 10px 11px; font-size: 12px; white-space: nowrap; }

@media (min-width: 761px) {
  body.has-settings .topbar { right: 372px; }
  body.has-settings .nature-dock { left: calc((100vw - 352px) / 2); width: min(700px, calc(100vw - 384px)); }
  body.has-settings .bottom .credit { display: none; }
}

@media (min-width: 761px) and (max-width: 1200px) {
  body.has-settings .hero,
  body.has-settings .bottom { visibility: hidden; }
}

/* На телефоне панель выезжает снизу, дерево остаётся над ней. */
@media (max-width: 760px) {
  .settings-panel {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    height: 52vh;
    transform: translateY(calc(100% + 20px));
  }

  body.has-settings .nature-dock,
  body.has-settings .topbar .counter,
  body.has-settings .topbar #addLeafBtn,
  body.has-settings .bottom { visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .settings-panel { transition: none; }
}

/* ================================================================== */
/*  Организация, вход и карточка дела                                  */
/* ================================================================== */

.hero-org {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 251, 240, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #3c5735;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 26px rgba(46, 63, 34, 0.1);
}

.hero-org .dot { width: 6px; height: 6px; }

.org-toggle,
.topbar-login {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 48px;
  padding: 0 15px;
  border: 0;
  border-radius: 15px;
  color: #3b5334;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.24s, background 0.24s, box-shadow 0.24s;
}

.org-toggle:hover,
.topbar-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(46, 63, 34, 0.16);
}

.org-toggle:focus-visible,
.topbar-login:focus-visible {
  outline: 3px solid rgba(125, 165, 92, 0.65);
  outline-offset: 3px;
}

.org-toggle svg,
.topbar-login svg {
  width: 19px;
  height: 19px;
  flex: none;
  opacity: 0.82;
}

.org-toggle-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  max-width: 190px;
}

.org-toggle-copy small {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6c7a60;
}

.org-toggle-copy strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 700;
}

.topbar-login {
  font-size: 12.5px;
  font-weight: 700;
}

/* ── Выбор организации ───────────────────────────────────────────── */

.org-picker {
  width: min(760px, calc(100vw - 32px));
  padding-bottom: 24px;
}

.org-picker h2 {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
}

.org-picker-lede {
  max-width: 540px;
  margin-top: 10px;
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1.55;
}

.org-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 0 14px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.68);
  border: 1.5px solid rgba(46, 64, 35, 0.14);
}

.org-search:focus-within {
  border-color: #7da55c;
  box-shadow: 0 0 0 4px rgba(125, 165, 92, 0.14);
}

.org-search svg { width: 18px; height: 18px; color: #7a8672; flex: none; }

.org-search input {
  width: 100%;
  padding: 12px 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 13.5px;
}

.org-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: min(46vh, 430px);
  margin-top: 14px;
  padding: 2px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(83, 104, 66, 0.3) transparent;
}

.org-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(46, 64, 35, 0.12);
  background: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.org-card:hover {
  transform: translateY(-2px);
  border-color: rgba(125, 165, 92, 0.55);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 30px rgba(46, 63, 34, 0.12);
}

.org-card:focus-visible {
  outline: 3px solid rgba(125, 165, 92, 0.6);
  outline-offset: 2px;
}

.org-card-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 11px;
  background: rgba(125, 165, 92, 0.17);
  color: #3c6a40;
}

.org-card-mark svg { width: 20px; height: 20px; }

.org-card-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.org-card-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
}

.org-card-copy small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 10.5px;
}

.org-card-count {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(46, 64, 35, 0.07);
  color: #5d6b53;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.org-card-general {
  background: linear-gradient(145deg, rgba(47, 93, 58, 0.08), rgba(255, 255, 255, 0.7));
  border-color: rgba(47, 93, 58, 0.22);
}

.org-empty {
  margin-top: 18px;
  padding: 24px;
  border-radius: 14px;
  background: rgba(46, 64, 35, 0.05);
  color: var(--ink-faint);
  text-align: center;
  font-size: 13px;
}

.org-picker-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(46, 64, 35, 0.12);
}

.org-picker-foot span {
  max-width: 380px;
  color: var(--ink-faint);
  font-size: 11.5px;
  line-height: 1.5;
}

/* ── Карточка дела: подробности и фотографии ─────────────────────── */

.deed-org-name {
  margin-top: 4px;
  color: #6d7a62;
  font-size: 11.5px;
  font-weight: 700;
}

.deed-extra {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(46, 64, 35, 0.13);
}

.deed-full {
  margin: 0;
  color: #485741;
  font-size: 12.5px;
  line-height: 1.62;
  white-space: pre-line;
}

.deed-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.deed-photos a {
  display: block;
  border-radius: 11px;
  overflow: hidden;
  border: 1px solid rgba(46, 64, 35, 0.13);
  background: #ece4d1;
}

.deed-photos img {
  display: block;
  width: 100%;
  height: 92px;
  object-fit: cover;
  transition: transform 0.35s;
}

.deed-photos a:hover img { transform: scale(1.06); }

/* Настройки только для чтения */
.view-only-settings .settings-actions [data-action="save"],
.view-only-settings .settings-actions [data-action="revert"],
.view-only-settings .settings-actions [data-action="defaults"] {
  display: none;
}

@media (max-width: 1100px) {
  .org-toggle-copy { max-width: 130px; }
}

@media (max-width: 820px) {
  .org-toggle-copy { display: none; }
  .org-toggle { width: 48px; padding: 0; justify-content: center; }
  .topbar-login span { display: none; }
  .topbar-login { width: 48px; padding: 0; justify-content: center; }
  .org-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .hero-org { font-size: 10.5px; }
  .org-picker { padding: 30px 22px 22px; }
  .org-picker-foot { align-items: flex-start; }
}

@media (max-width: 820px) {
  .topbar .btn { flex: 0 0 48px; height: 48px; padding: 0; }
  .topbar .btn span { display: none; }
  .topbar .btn svg { width: 20px; height: 20px; }
  .settings-toggle { width: 48px; height: 48px; }
}

@media (max-width: 520px) {
  .topbar .counter { display: none; }
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr);
  gap: 12px;
}

@media (max-width: 520px) {
  .form-row { grid-template-columns: 1fr; }
}

.is-night .org-toggle-copy small { color: rgba(223, 233, 218, 0.58); }
.is-night .hero-org {
  background: rgba(20, 34, 48, 0.5);
  border-color: rgba(176, 202, 255, 0.2);
  color: #dfe9da;
}

@media (max-width: 1320px) {
  .org-toggle-copy { display: none; }
  .org-toggle { width: 48px; padding: 0; justify-content: center; }
  .topbar-login span { display: none; }
  .topbar-login { width: 48px; padding: 0; justify-content: center; }
}

@media (max-width: 1100px) {
  .topbar .counter { display: none; }
  .topbar .btn { width: 48px; padding: 0; }
  .topbar .btn span { display: none; }
}

@media (max-width: 820px) {
  .topbar .counter { display: flex; flex: 1; }
}

@media (max-width: 520px) {
  .topbar .counter { display: none; }
}

/* ── Поиск по добрым делам ───────────────────────────────────────── */

.search-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 15px;
  color: #3b5334;
  cursor: pointer;
  transition: transform 0.24s, background 0.24s, box-shadow 0.24s, color 0.24s;
}

.search-toggle svg { width: 21px; height: 21px; }
.search-toggle:hover { transform: translateY(-1px); box-shadow: 0 18px 40px rgba(46, 63, 34, 0.16); }
.search-toggle:focus-visible { outline: 3px solid rgba(125, 165, 92, 0.65); outline-offset: 3px; }

.search-toggle.active {
  color: #8a5a12;
  box-shadow: 0 0 0 1px rgba(215, 166, 74, 0.5), 0 14px 32px rgba(160, 111, 32, 0.2);
}

.search-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d7a64a;
  box-shadow: 0 0 0 3px rgba(247, 236, 210, 0.85);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.2s, transform 0.2s;
}
.search-toggle.active .search-dot { opacity: 1; transform: scale(1); }

.search-card {
  width: min(560px, calc(100vw - 32px));
  padding: 36px 38px 28px;
}

.search-card h2 {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 600;
  line-height: 1.04;
}

.search-lede {
  margin-top: 10px;
  color: var(--ink-faint);
  font-size: 12.5px;
  line-height: 1.6;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 0 15px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.72);
  border: 1.5px solid rgba(46, 64, 35, 0.16);
  transition: border-color 0.18s, box-shadow 0.18s;
}

.search-box:focus-within {
  border-color: #7da55c;
  box-shadow: 0 0 0 4px rgba(125, 165, 92, 0.14);
}

.search-box svg { width: 19px; height: 19px; flex: none; color: #7a8672; }

.search-box input {
  width: 100%;
  padding: 13px 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 14px;
}

.search-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 26px;
  margin-top: 12px;
}

.search-status #searchCount {
  color: #6d7a62;
  font-size: 12px;
  font-weight: 700;
}

.search-clear {
  padding: 5px 10px;
  border: 1px solid rgba(46, 64, 35, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: #5d6b53;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s, color 0.16s, border-color 0.16s;
}
.search-clear:hover { background: var(--green); border-color: var(--green); color: #fff; }

.is-night .search-toggle { color: #e6eee0; }
.is-night .search-toggle.active { color: #f3d58c; }
.is-night .search-toggle .search-dot { box-shadow: 0 0 0 3px rgba(30, 46, 58, 0.85); }

@media (max-width: 820px) {
  .search-toggle { width: 44px; height: 44px; }
}

@media (max-width: 520px) {
  .search-card { padding: 30px 22px 22px; }
}

@media (max-width: 820px) {
  .topbar { gap: 7px; }
  .org-toggle,
  .topbar-login,
  .search-toggle,
  .settings-toggle,
  .topbar .btn {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }
}
