/* Шторки: снизу на телефоне, окно по центру на десктопе. */

.scrim {
  position: fixed; inset: 0; background: rgba(6, 8, 10, .5); opacity: 0; pointer-events: none;
  transition: opacity .25s; z-index: 5;
}
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  background: var(--panel); color: var(--ink); box-shadow: var(--shadow);
  border-top: 1px solid var(--line); border-radius: 22px 22px 0 0;
  padding: 8px var(--gut) calc(24px + env(safe-area-inset-bottom));
  max-height: 90dvh; overflow-y: auto;
  /* скрытая шторка невидима и для мыши, и для табуляции: иначе она перекрывает
     экран и соседние шторки (на десктопе все они лежат в одной точке) */
  visibility: hidden; pointer-events: none;
  transform: translateY(103%);
  transition: transform .34s var(--ease), visibility 0s .34s;
}
.sheet.on { transform: none; visibility: visible; pointer-events: auto; transition-delay: 0s; }
.grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 18px; }
.sheet h2 { margin: 0 0 6px; padding-right: 36px; font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1.12; letter-spacing: -.03em; display: flex; align-items: center; gap: 10px; }
.sheet h2 span { min-width: 0; overflow-wrap: anywhere; }
.sheet .sub { font-size: 13.5px; color: var(--dim); margin-bottom: 6px; line-height: 1.45; }
.sheet h4 { margin: 24px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; }
.sheet .x {
  position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; color: var(--dim);
}
.sheet .x:hover { background: var(--press); color: var(--ink); }
.sheet .cardrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
/* две колонки настроек; на узком экране — одна под другой (три подписи переключателя в полширины не влезают) */
.sheet .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 539px) { .sheet .two { grid-template-columns: 1fr; } }

/* список выбора */
.pick {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 10px; margin: 0 -10px; width: calc(100% + 20px);
  border-bottom: 1px solid var(--line2); font-size: 16px; border-radius: 9px;
}
.pick:hover { background: var(--press); }
.pick:last-child { border-bottom: 0; }
.pick small { margin-left: auto; font-size: 13px; color: var(--dim); text-align: right; }
.pick .ic { color: var(--dim); }
.pick[aria-selected='true'] { font-weight: 600; }
.pick[aria-selected='true'] .ic, .pick[aria-selected='true'] small { color: var(--accent); font-weight: 600; }

/* плитки: работа, «куда положить» */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.tile {
  display: flex; flex-direction: column; gap: 4px; padding: 11px 12px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--bg); font-size: 14.5px; font-weight: 500;
}
.tile small { font-size: 12px; color: var(--dim); font-weight: 400; }
.tile .ic { color: var(--dim); margin-bottom: 2px; }
.tile:hover { border-color: var(--dim); transform: translateY(-1px); }
.tile[aria-selected='true'] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--panel)); box-shadow: inset 0 0 0 1px var(--accent); }
.tile[aria-selected='true'] .ic { color: var(--accent); }

/* список с галочками: выбор задач в план */
.check { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 11px 0; font-size: 16px; border-bottom: 1px solid var(--line2); }
.check i {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line);
  display: grid; place-items: center; margin-top: 1px; color: transparent; transition: background .2s, border-color .2s;
}
.check i .ic { width: 13px; height: 13px; stroke-width: 3; }
.check:hover i { border-color: var(--accent); }
.check[aria-checked='true'] i { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.check[aria-checked='true'] span { color: var(--dim); text-decoration: line-through; }
.check span { transition: color .2s; }

@media (min-width: 720px) {
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%;
    width: min(520px, 92vw); transform: translate(-50%, calc(-50% + 10px));
    border: 1px solid var(--line); border-radius: 18px;
    padding: 24px 26px 26px; max-height: 84dvh; opacity: 0;
    transition: opacity .2s ease, transform .26s var(--ease), visibility 0s .26s;
  }
  .sheet.on { transform: translate(-50%, -50%); opacity: 1; transition-delay: 0s; }
  .grab { display: none; }
}

/* ─── шаги: нумерованный список в рамке, галочка слева, «убрать» справа ─── */
.sheet h4 .count { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--dim); margin-left: 6px; }
.steps { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); overflow: hidden; }
.step { display: flex; align-items: center; gap: 10px; padding: 9px 8px 9px 10px; border-top: 1px solid var(--line2); }
.step:first-child { border-top: 0; }
.step .tick {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line);
  display: grid; place-items: center; color: transparent; background: var(--panel);
  transition: background .2s, border-color .2s, transform .12s;
}
.step .tick:hover { border-color: var(--accent); }
.step .tick:active { transform: scale(.9); }
.step .tick .ic { width: 13px; height: 13px; stroke-width: 3; }
.step[data-done='1'] .tick { background: var(--st-active); border-color: var(--st-active); color: #fff; }
.step .num { flex: 0 0 18px; font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; text-align: right; }
.step .name { flex: 1; min-width: 0; font-size: 15.5px; line-height: 1.35; overflow-wrap: anywhere; transition: color .2s; }
.step[data-done='1'] .name { color: var(--dim); text-decoration: line-through; text-decoration-color: var(--line); }
.step[data-done='1'] .num { opacity: .5; }
.step .del { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; color: var(--dim); opacity: .55; }
.step .del:hover { opacity: 1; background: var(--press); color: var(--warn); }
.nosteps { padding: 12px 14px; font-size: 13.5px; color: var(--dim); border: 1px dashed var(--line); border-radius: 12px; }
.stepadd { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.stepadd .field { margin: 0; flex: 1; }
.stepadd .stepgo {
  flex: 0 0 auto; display: flex; align-items: center; gap: 5px; padding: 0 14px 0 10px; height: 46px;
  border-radius: 10px; border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--ink); background: var(--panel);
}
.stepadd .stepgo:hover { border-color: var(--accent); color: var(--accent); }
.stepadd .stepgo:active { transform: scale(.97); }

/* подкраска группы: пипетка и три пресета палитры */
.tintrow { display: flex; align-items: center; gap: 14px; }
.colorpick { position: relative; cursor: pointer; }
.colorpick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatch.big { width: 44px; height: 44px; display: block; }
.swatch[aria-selected='true'] { border-color: var(--bg); box-shadow: 0 0 0 2px var(--ink); }
.swatches { display: flex; gap: 10px; }
