/* Выбор периода — один компонент на весь сервис (static/period.js). */
:root {
  --pp-range: #eef1f4;
  --pp-edge: #17212b;
}
@media (prefers-color-scheme: dark) {
  :root {
    --pp-range: #222b35;
    --pp-edge: #e6ebf0;
  }
}

.pp { position: relative; display: inline-flex; flex-direction: column; align-items: flex-start; }
.pp-bar { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 2px; }
.pp-btn { font: inherit; font-weight: 600; border: none; background: var(--surface); border-radius: 8px;
  padding: 6px 12px; cursor: pointer; color: var(--text); box-shadow: var(--shadow); }
.pp-icon { border: none; background: none; cursor: pointer; color: var(--muted); font-size: 16px;
  width: 30px; height: 30px; border-radius: 8px; }
.pp-icon:hover { background: var(--surface); color: var(--text); }
.pp-note { font-size: 12px; color: var(--muted); margin-top: 2px; }

.pp-panel {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; display: flex;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18); padding: 8px;
}
.pp-panel.to-right { left: 0; right: auto; }
.pp-presets { display: flex; flex-direction: column; gap: 2px; padding: 4px 8px 4px 0;
  border-right: 1px solid var(--line); min-width: 140px; }
.pp-preset { text-align: left; background: none; border: 1px solid transparent; border-radius: 8px;
  padding: 6px 10px; cursor: pointer; color: var(--text); font: inherit; }
.pp-preset:hover { background: var(--surface-2); }
.pp-preset.on { border-color: var(--line); box-shadow: var(--shadow); font-weight: 600; }
.pp-cal { padding: 4px 8px 4px 16px; position: relative; }
.pp-nav { position: absolute; left: 12px; right: 12px; top: 4px; display: flex; justify-content: space-between;
  pointer-events: none; }
.pp-nav .pp-icon { pointer-events: auto; font-size: 20px; }
.pp-months { display: flex; gap: 24px; }
.pp-title { text-align: center; font-weight: 600; padding: 8px 0 12px; }
.pp-grid { display: grid; grid-template-columns: repeat(7, 34px); gap: 2px 0; }
.pp-wd { text-align: center; font-size: 12px; color: var(--muted); padding-bottom: 6px; }
.pp-day { height: 34px; border: none; background: none; cursor: pointer; border-radius: 0; color: var(--text); font: inherit; }
.pp-day.out { color: var(--muted); }
.pp-day.now { text-decoration: underline; }
.pp-day:disabled { opacity: .35; cursor: default; }
.pp-day.in { background: var(--pp-range); }
.pp-day.edge { background: var(--pp-edge); color: var(--surface); border-radius: 8px; font-weight: 700; }
.pp-day:not(:disabled):hover { outline: 1px solid var(--accent); }
.pp-hint { font-size: 12px; color: var(--muted); padding-top: 8px; }

@media (max-width: 760px) {
  .pp-panel { position: fixed; left: 8px; right: 8px; top: 64px; flex-direction: column; max-height: 80vh; overflow: auto; }
  .pp-presets { flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--line); }
  .pp-months { flex-direction: column; }
}
