/* Кнопка периода в шапке и её окно (11.10.2026). Цвета и скругления — те же токены, что у переключателей шапки. */

.per-btn {
  height: 40px; padding: 0 10px 0 12px; display: inline-flex; align-items: center; gap: 8px; flex: none;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .2s, border-color .2s;
}
.per-btn:hover, .per-btn[aria-expanded="true"] { background: var(--surface-3); border-color: var(--line-2); }
.per-btn svg { width: 17px; height: 17px; color: var(--ink-2); flex: none; }
.per-btn .chev { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.per-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.per-btn.ranged { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }

.per-pop {
  position: fixed; z-index: 80; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow-pop);
  animation: per-in .16s var(--ease);
}
@keyframes per-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .per-pop { animation: none; } }
.per-in { padding: 12px; display: grid; gap: 14px; }
.per-sec { display: grid; gap: 8px; }
.per-h { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.per-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.per-row { display: flex; flex-wrap: wrap; gap: 6px; }
.per-chip {
  min-height: 44px; padding: 6px 12px; border-radius: 12px; border: 1px solid var(--line-2); color: var(--ink);
  display: grid; justify-items: start; align-content: center; gap: 1px; text-align: left;
  transition: background .2s, border-color .2s;
}
.per-row .per-chip { flex: 1 1 140px; }
.per-chip b { font-size: 13.5px; font-weight: 600; }
.per-chip small { font-size: 12px; color: var(--ink-3); }
.per-chip:hover:not([disabled]) { background: var(--surface-2); }
.per-chip[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border-color: var(--accent); }
.per-chip[disabled] { opacity: .45; cursor: default; }

.per-cal-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.per-cal-h b { font-size: 14px; }
.per-nav {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); color: var(--ink-2);
  font-size: 20px; line-height: 1; display: grid; place-items: center;
}
.per-nav:hover:not([disabled]) { background: var(--surface-2); color: var(--ink); }
.per-nav[disabled] { opacity: .35; cursor: default; }
.per-cal { width: 100%; border-collapse: separate; border-spacing: 0 3px; table-layout: fixed; }
.per-cal th { font-size: 11.5px; font-weight: 600; color: var(--ink-3); padding: 2px 0 4px; }
.per-cal th.we { color: color-mix(in srgb, var(--bad) 65%, var(--ink-3)); }
.per-wk-h { font-weight: 500; }
.per-cal td { padding: 0; text-align: center; }
.per-day, .per-wk { width: 100%; height: 38px; font-size: 13.5px; color: var(--ink); border-radius: 10px; }
.per-wk { font-size: 11.5px; color: var(--ink-3); border: 1px dashed var(--line-2); width: calc(100% - 6px); }
.per-wk:hover:not([disabled]) { color: var(--ink); border-style: solid; background: var(--surface-2); }
.per-day:hover:not([disabled]) { background: var(--surface-2); }
.per-day[disabled], .per-wk[disabled] { color: var(--ink-3); opacity: .38; cursor: default; }
.per-cal td.we .per-day:not([disabled]) { color: color-mix(in srgb, var(--bad) 55%, var(--ink)); }
.per-cal td.today .per-day { box-shadow: inset 0 0 0 1px var(--line-2); }
/* Выбранные дни — сплошная полоса от первого до последнего, края — залитые. */
.per-cal td.in { background: color-mix(in srgb, var(--accent) 26%, transparent); }
.per-cal td.in.a { border-radius: 10px 0 0 10px; }
.per-cal td.in.b { border-radius: 0 10px 10px 0; }
.per-cal td.in.a.b { border-radius: 10px; }
.per-cal td.a .per-day, .per-cal td.b .per-day { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.per-hint { margin: 0; font-size: 12px; color: var(--ink-3); line-height: 1.4; }
.per-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.per-sel { font-weight: 600; font-size: 13.5px; }
.per-go {
  height: 40px; padding: 0 16px; border-radius: 10px; background: var(--accent); color: var(--on-accent);
  font-weight: 600; font-size: 13.5px;
}
.per-go[disabled] { opacity: .4; cursor: default; }

/* Плашка над экраном: какой период на нём сейчас и как вернуться к месяцу. */
.per-note {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; padding: 10px 14px;
  border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface)); font-size: 13px; color: var(--ink-2);
}
.per-note b { color: var(--ink); }
.per-note .grow { flex: 1; }

@media (max-width: 760px) {
  .per-btn { height: 44px; padding: 0 8px 0 10px; font-size: 13px; gap: 6px; }
  .per-btn .lbl-icon { display: none; }
}
