:root {
  --c-accent: #2f7d6d;
  --c-soft: #f3f8f6;
  --c-text: #25302d;
  --c-ok: #2e8b4f;
  --c-warn: #d9791a;
  --c-period: #f08fa8;
  --c-fert: #4cc3c0;
}

[data-tool] {
  color: var(--c-text);
  max-width: 100%;
  box-sizing: border-box;
}
[data-tool] *, [data-tool] *::before, [data-tool] *::after { box-sizing: border-box; }

.t-form {
  background: var(--c-soft);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 12px;
  padding: 16px;
  margin: 0 0 16px;
}
.t-fieldset { border: 0; margin: 0 0 12px; padding: 0; min-width: 0; }
.t-fieldset legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.t-radio { display: block; margin: 4px 0; cursor: pointer; line-height: 1.35; }
.t-radio input { margin-right: 8px; accent-color: var(--c-accent); }
.t-panel { margin-bottom: 4px; }
.t-panel[hidden] { display: none; }

.t-row { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; }
.t-row label { font-weight: 600; font-size: .95em; }
.t-row input[type="date"],
.t-row input[type="number"],
.t-row input[type="text"] {
  width: 100%;
  max-width: 320px;
  min-height: 44px;
  padding: 8px 12px;
  font: inherit;
  color: var(--c-text);
  background: #fff;
  border: 1px solid #b9c7c2;
  border-radius: 8px;
}
.t-row input:focus-visible,
.t-btn:focus-visible,
.t-item input:focus-visible,
.t-radio input:focus-visible {
  outline: 3px solid var(--c-accent);
  outline-offset: 2px;
}
.t-hint { color: #5b6a66; font-size: .85em; line-height: 1.35; }

.t-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 0; }
.t-btn {
  min-height: 44px;
  padding: 10px 20px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--c-accent);
  border: 2px solid var(--c-accent);
  border-radius: 8px;
  cursor: pointer;
}
.t-btn:hover { filter: brightness(.92); }
.t-btn--ghost { color: var(--c-accent); background: #fff; }

.t-res { margin: 0 0 16px; }
.t-res:empty { display: none; }
.t-err {
  margin: 0;
  padding: 12px 14px;
  color: #8a3b00;
  background: #fff3e6;
  border-left: 4px solid var(--c-warn);
  border-radius: 6px;
}
.t-big {
  margin: 0 0 12px;
  padding: 14px 16px;
  font-size: 1.25em;
  font-weight: 700;
  line-height: 1.3;
  color: var(--c-accent);
  background: var(--c-soft);
  border-radius: 10px;
  overflow-wrap: anywhere;
}
.t-sub { margin: 18px 0 8px; font-weight: 700; font-size: 1.05em; }
.t-note {
  margin: 14px 0 0;
  padding: 10px 12px;
  font-size: .9em;
  line-height: 1.45;
  color: #4a5753;
  background: var(--c-soft);
  border-radius: 8px;
}

.t-list { margin: 0 0 8px; padding: 0; }
.t-list dt { margin-top: 8px; font-size: .88em; color: #5b6a66; }
.t-list dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.t-list--ul { list-style: none; }
.t-list--ul li { margin: 6px 0; line-height: 1.45; overflow-wrap: anywhere; }

.t-metric { margin: 0 0 12px; padding: 12px 14px; border: 1px solid rgba(0, 0, 0, .1); border-radius: 10px; }
.t-mt { margin: 0 0 4px; font-weight: 600; overflow-wrap: anywhere; }
.t-mn { margin: 0; font-size: .9em; color: #4a5753; line-height: 1.4; }
.t-ok { color: var(--c-ok); font-weight: 700; }
.t-warn { color: var(--c-warn); font-weight: 700; }

/* календарь */
.t-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 0 0 12px; padding: 0; font-size: .9em; }
.t-legend li { display: flex; align-items: center; gap: 6px; }
.t-sw { display: inline-block; width: 16px; height: 16px; border-radius: 4px; flex: none; }
.t-sw--period { background: var(--c-period); }
.t-sw--fert { background: var(--c-fert); }
.t-sw--ovul { background: var(--c-fert); box-shadow: inset 0 0 0 3px #fff, 0 0 0 2px var(--c-accent); }
.t-sw--today { background: #fff; border: 2px solid var(--c-text); }

.t-cals { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 0 0 8px; }
.t-cal { min-width: 0; padding: 10px; border: 1px solid rgba(0, 0, 0, .1); border-radius: 10px; }
.t-cal-title { margin: 0 0 6px; font-weight: 700; text-align: center; }
.t-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.t-wd { text-align: center; font-size: .72em; color: #5b6a66; padding: 2px 0; }
.t-day {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  min-width: 0;
  font-size: .85em;
  border-radius: 6px;
}
.t-day--empty { visibility: hidden; }
.t-day--period { background: var(--c-period); color: #4a1224; }
.t-day--fert { background: var(--c-fert); color: #04302f; }
.t-day--ovul { background: var(--c-fert); color: #04302f; font-weight: 800; box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px var(--c-accent); }
.t-day--today { outline: 2px solid var(--c-text); outline-offset: -2px; font-weight: 700; }

.t-cycle { margin: 0 0 10px; padding: 10px 14px; border: 1px solid rgba(0, 0, 0, .1); border-radius: 10px; }
.t-ct { margin: 0 0 4px; font-weight: 700; }

/* чек-лист */
.t-top { margin: 0 0 12px; }
.t-count { margin: 0 0 6px; font-weight: 700; }
.t-bar { height: 12px; background: #dfe9e5; border-radius: 6px; overflow: hidden; }
.t-bar-fill { height: 100%; width: 0; background: var(--c-ok); transition: width .25s ease; }
.t-check { margin-top: 16px; }
.t-group { margin: 0 0 18px; }
.t-gt { margin: 0 0 6px; font-weight: 700; font-size: 1.1em; color: var(--c-accent); }
.t-items { list-style: none; margin: 0; padding: 0; }
.t-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 4px; border-bottom: 1px solid rgba(0, 0, 0, .07); }
.t-item input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--c-ok); cursor: pointer; }
.t-item label { flex: 1 1 auto; min-width: 0; line-height: 1.4; cursor: pointer; overflow-wrap: anywhere; }
.t-done label { color: #7b8985; text-decoration: line-through; }

@media (max-width: 480px) {
  .t-form { padding: 12px; }
  .t-row input[type="date"],
  .t-row input[type="number"],
  .t-row input[type="text"] { max-width: 100%; }
  .t-btn { width: 100%; }
  .t-cals { grid-template-columns: 1fr; }
  .t-big { font-size: 1.1em; }
}

@media print {
  .t-noprint, .t-btn { display: none !important; }
  .t-item { break-inside: avoid; }
  .t-group { break-inside: avoid; }
  .t-bar { border: 1px solid #999; }
}
