/* Дела — внешний вид по мотивам Todoist */
:root {
  --red: #dc4c3e; --red-hover: #c3392c; --red-soft: #fcefec;
  --text: #202020; --text2: #666; --text3: #808080; --line: #f0f0f0; --line2: #e6e6e6;
  --side: #fcfaf8; --hover: #f2efed; --hover2: #eeeae6; --bg: #fff; --sel: #ffefe5;
  --p1: #d1453b; --p2: #eb8909; --p3: #246fe0; --p4: #b8b8b8;
  --today: #058527; --tomorrow: #ad6200; --week: #692ec2; --overdue: #d1453b; --later: #808080;
  --meet: #e9f0fe; --meet-b: #4073ff; --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 4px 24px rgba(0,0,0,.12), 0 1px 4px rgba(0,0,0,.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.4 var(--font); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { flex-shrink: 0; }
.hidden { display: none !important; }

/* ---------- раскладка ---------- */
#app { display: flex; height: 100%; }
#side { width: 280px; flex-shrink: 0; background: var(--side); height: 100%; overflow-y: auto; padding: 12px 12px 40px; transition: margin .2s; }
#side.closed { margin-left: -280px; }
#main { flex: 1; min-width: 0; height: 100%; overflow-y: auto; position: relative; }
.topbar { position: sticky; top: 0; z-index: 5; background: var(--bg); display: flex; align-items: center; gap: 4px; height: 52px; padding: 0 16px; }
.topbar .sp { flex: 1; }
.icon-btn { width: 32px; height: 32px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: var(--text2); }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.view { max-width: 800px; margin: 0 auto; padding: 0 40px 120px; }
.view.wide { max-width: none; padding: 0 24px 40px; }
.view h1 { font-size: 26px; font-weight: 700; margin: 8px 0 4px; display: flex; align-items: center; gap: 10px; }
.view .subtitle { color: var(--text2); font-size: 13px; display: flex; align-items: center; gap: 6px; margin-bottom: 18px; }

/* ---------- сайдбар ---------- */
.side-head { display: flex; align-items: center; gap: 4px; padding: 0 4px 8px; }
.side-head .me { flex: 1; display: flex; align-items: center; gap: 8px; font-weight: 600; padding: 4px; border-radius: 6px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: #b8255f; color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.add-main { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border-radius: 6px; color: var(--red); font-weight: 600; }
.add-main:hover { background: var(--hover); }
.add-main .plus { width: 24px; height: 24px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; color: var(--text); cursor: pointer; min-height: 34px; }
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--sel); color: #c3392c; }
.nav-item.active svg { color: var(--red); }
.nav-item svg { color: var(--text2); }
.nav-item .cnt { margin-left: auto; color: var(--text3); font-size: 12px; }
.nav-item .hash { width: 24px; text-align: center; font-size: 16px; font-weight: 300; }
.nav-item .more { margin-left: auto; opacity: 0; }
.nav-item:hover .more { opacity: 1; }
.nav-item:hover .more ~ .cnt, .nav-item:hover .cnt:has(~ .more) { display: none; }
.side-group { margin-top: 16px; }
.side-group-head { display: flex; align-items: center; padding: 6px 8px; color: var(--text2); font-weight: 600; font-size: 13px; border-radius: 6px; }
.side-group-head:hover { background: var(--hover); }
.side-group-head .sp { flex: 1; }
.side-group-head .icon-btn { width: 24px; height: 24px; opacity: 0; }
.side-group-head:hover .icon-btn { opacity: 1; }
.side-foot { margin-top: 20px; }

/* ---------- задачи ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: flex-start; gap: 6px; padding: 8px 0 8px; border-bottom: 1px solid var(--line); position: relative; cursor: pointer; }
.task .grip { position: absolute; left: -28px; top: 9px; opacity: 0; color: var(--text3); }
.task:hover .grip { opacity: 1; }
.task .twisty { position: absolute; left: -22px; top: 9px; color: var(--text3); width: 18px; height: 18px; display: grid; place-items: center; border-radius: 4px; }
.task .twisty:hover { background: var(--hover); }
.task .twisty.closed svg { transform: rotate(-90deg); }
.check { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--p4); margin-top: 2px; flex-shrink: 0; display: grid; place-items: center; color: transparent; transition: background .15s; position: relative; }
.check svg { opacity: 0; transition: opacity .1s; }
.check:hover svg { opacity: 1; color: var(--text3); }
.check.p1 { border: 2px solid var(--p1); background: rgba(209,69,59,.1); }
.check.p2 { border: 2px solid var(--p2); background: rgba(235,137,9,.1); }
.check.p3 { border: 2px solid var(--p3); background: rgba(36,111,224,.1); }
.check.p1:hover svg { color: var(--p1); } .check.p2:hover svg { color: var(--p2); } .check.p3:hover svg { color: var(--p3); }
.check.done { background: var(--p4); border-color: var(--p4); }
.check.done svg { opacity: 1; color: #fff; }
.check.p1.done { background: var(--p1); } .check.p2.done { background: var(--p2); } .check.p3.done { background: var(--p3); }
.check.meeting { border-radius: 5px; }
.task-body { flex: 1; min-width: 0; }
.task-content { font-size: 14px; line-height: 21px; word-wrap: break-word; }
.task.completed .task-content { text-decoration: line-through; color: var(--text3); }
.task-desc { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 3px; font-size: 12px; color: var(--text2); }
.task-meta .m { display: inline-flex; align-items: center; gap: 3px; }
.task-meta .label-chip { color: var(--text2); }
.task .proj { position: absolute; right: 0; bottom: 8px; font-size: 12px; color: var(--text3); display: flex; align-items: center; gap: 4px; max-width: 160px; overflow: hidden; white-space: nowrap; }
.task .actions { position: absolute; right: 0; top: 4px; display: none; gap: 2px; background: var(--bg); }
.task:hover .actions { display: flex; }
.task .actions .icon-btn { width: 28px; height: 28px; }
.d-today { color: var(--today) !important; } .d-tomorrow { color: var(--tomorrow) !important; } .d-week { color: var(--week) !important; }
.d-overdue { color: var(--overdue) !important; } .d-later { color: var(--later) !important; }
.kind-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; padding: 0 6px; border-radius: 4px; background: var(--meet); color: #2754c5; height: 18px; }
.kind-badge.unclear { background: #fff4e5; color: #ad6200; }
.sub { padding-left: 28px; }
.sub .task { padding-left: 0; }

.section-head { display: flex; align-items: center; gap: 6px; margin: 22px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--line2); font-weight: 700; font-size: 14px; }
.section-head .cnt { color: var(--text3); font-weight: 400; font-size: 13px; }
.section-head .sp { flex: 1; }
.section-head .act { color: var(--red); font-weight: 500; font-size: 13px; }
.section-head .act:hover { text-decoration: underline; }
.section-head .icon-btn { width: 26px; height: 26px; opacity: 0; } .section-head:hover .icon-btn { opacity: 1; }
.add-task-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; color: var(--text3); cursor: pointer; width: 100%; }
.add-task-row .plus { width: 18px; height: 18px; border-radius: 50%; color: var(--red); display: grid; place-items: center; }
.add-task-row:hover { color: var(--red); }
.add-task-row:hover .plus { background: var(--red); color: #fff; }
.add-section-row { display: flex; align-items: center; gap: 8px; color: var(--red); font-weight: 600; font-size: 13px; padding: 10px 0; opacity: 0; transition: opacity .1s; width: 100%; }
.add-section-row::before, .add-section-row::after { content: ""; flex: 1; height: 1px; background: var(--red); }
.add-section-row:hover { opacity: 1; }
.empty { text-align: center; color: var(--text2); padding: 60px 20px; }
.empty .big { font-size: 15px; font-weight: 600; color: var(--text); margin: 14px 0 6px; }

/* ---------- редактор задачи ---------- */
.editor { border: 1px solid var(--line2); border-radius: var(--radius); margin: 8px 0; background: var(--bg); }
.editor:focus-within { border-color: #c8c8c8; }
.editor .ed-main { padding: 10px 10px 0; }
.editor .ed-title { width: 100%; border: 0; outline: 0; font-size: 15px; font-weight: 600; padding: 0; }
.editor .ed-desc { width: 100%; border: 0; outline: 0; font-size: 13px; resize: none; padding: 4px 0 0; color: var(--text2); min-height: 22px; }
.editor .ed-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 10px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 8px; border: 1px solid var(--line2); border-radius: 6px; font-size: 13px; color: var(--text2); background: var(--bg); white-space: nowrap; }
.chip:hover { background: var(--hover); }
.chip.on { color: var(--text); }
.chip .x { margin-left: 2px; opacity: .6; border-radius: 3px; display: grid; place-items: center; }
.chip .x:hover { opacity: 1; background: var(--hover2); }
.ed-parsed { display: flex; flex-wrap: wrap; gap: 5px; padding: 6px 0 0; }
.ed-parsed .tok { font-size: 12px; background: #fff0e6; color: #b5501a; border-radius: 4px; padding: 1px 6px; }
.ed-kind { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fff8ec; border-top: 1px solid #f6e3c3; font-size: 13px; }
.ed-kind.need { animation: pulse 1s 2; }
@keyframes pulse { 50% { background: #ffe8c2; } }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 6px; overflow: hidden; background: var(--bg); }
.seg button { padding: 4px 10px; font-size: 13px; color: var(--text2); display: inline-flex; align-items: center; gap: 5px; }
.seg button + button { border-left: 1px solid var(--line2); }
.seg button.on { background: var(--text); color: #fff; }
.editor .ed-foot { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); }
.editor .ed-foot .sp { flex: 1; }
.btn { height: 32px; padding: 0 12px; border-radius: 6px; font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-hover); }
.btn.primary:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: #f5f5f5; color: var(--text); }
.btn.ghost:hover { background: #ebebeb; }
.btn.danger { color: var(--p1); }
.btn.danger:hover { background: #fdecea; }
.proj-pick { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border-radius: 6px; font-size: 13px; color: var(--text2); }
.proj-pick:hover { background: var(--hover); }

/* ---------- всплывашки ---------- */
.pop { position: fixed; z-index: 60; background: var(--bg); border-radius: 10px; box-shadow: var(--shadow); min-width: 220px; max-width: 320px; max-height: 80vh; overflow-y: auto; padding: 6px 0; font-size: 13px; }
.pop .pi { display: flex; align-items: center; gap: 10px; padding: 7px 12px; cursor: pointer; width: 100%; text-align: left; }
.pop .pi:hover, .pop .pi.hl { background: var(--hover); }
.pop .pi .r { margin-left: auto; color: var(--text3); font-size: 12px; }
.pop .pi.sel::after { content: "✓"; margin-left: auto; color: var(--red); }
.pop .sep { height: 1px; background: var(--line); margin: 5px 0; }
.pop .hdr { padding: 6px 12px 2px; font-size: 11px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.pop input.pin { margin: 4px 10px 6px; width: calc(100% - 20px); padding: 7px 9px; border: 1px solid var(--line2); border-radius: 6px; outline: 0; }
.pop input.pin:focus { border-color: #bbb; }
.dp-cal { padding: 4px 10px 6px; }
.dp-cal .mh { display: flex; align-items: center; justify-content: space-between; font-weight: 600; padding: 2px 2px 6px; }
.dp-cal .grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.dp-cal .wd { font-size: 11px; color: var(--text3); padding: 2px 0; }
.dp-cal .dd { height: 28px; border-radius: 50%; font-size: 13px; display: grid; place-items: center; }
.dp-cal .dd:hover { background: var(--hover); }
.dp-cal .dd.past { color: #c8c8c8; }
.dp-cal .dd.today { color: var(--red); font-weight: 700; }
.dp-cal .dd.sel { background: var(--red); color: #fff; }
.dp-row { display: flex; gap: 6px; align-items: center; padding: 6px 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.dp-row label { font-size: 12px; color: var(--text2); }
.dp-row input[type=time], .dp-row select { border: 1px solid var(--line2); border-radius: 6px; padding: 4px 6px; outline: 0; background: var(--bg); }

/* ---------- модальные окна ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; }
.modal { background: var(--bg); border-radius: 12px; box-shadow: var(--shadow); width: 100%; max-width: 560px; overflow: hidden; }
.modal.qa { max-width: 560px; }
.modal.qa .editor { border: 0; margin: 0; }
.modal.detail { max-width: 860px; height: min(80vh, 720px); display: flex; flex-direction: column; }
.detail-head { display: flex; align-items: center; gap: 6px; height: 48px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--text2); }
.detail-head .sp { flex: 1; }
.detail-body { flex: 1; display: flex; min-height: 0; }
.detail-left { flex: 1; overflow-y: auto; padding: 16px 20px 30px; }
.detail-right { width: 260px; background: var(--side); overflow-y: auto; padding: 12px 16px; border-left: 1px solid var(--line); }
.detail-title-row { display: flex; gap: 10px; align-items: flex-start; }
.detail-title-row .check { margin-top: 5px; }
.d-title { flex: 1; font-size: 20px; font-weight: 700; border: 0; outline: 0; resize: none; padding: 2px 0; line-height: 1.35; overflow: hidden; }
.d-desc { width: 100%; border: 0; outline: 0; resize: none; font-size: 14px; color: var(--text2); padding: 6px 0 6px 28px; min-height: 40px; }
.d-desc:focus { color: var(--text); }
.d-sub-head { margin: 16px 0 4px 28px; font-weight: 600; font-size: 13px; padding-bottom: 6px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; }
.d-sub-head .cnt { color: var(--text3); font-weight: 400; }
.d-subs { margin-left: 28px; }
.d-field { padding: 10px 0; border-bottom: 1px solid var(--line2); }
.d-field .k { font-size: 12px; color: var(--text2); font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; justify-content: space-between; }
.d-field .v { display: flex; align-items: center; gap: 6px; padding: 4px 6px; margin: 0 -6px; border-radius: 6px; cursor: pointer; font-size: 13px; min-height: 28px; flex-wrap: wrap; }
.d-field .v:hover { background: var(--hover2); }
.d-field .v.muted { color: var(--text3); }
.d-field .lbl { background: var(--hover2); border-radius: 4px; padding: 1px 6px; font-size: 12px; }

/* ---------- календарь ---------- */
.cal-bar { display: flex; align-items: center; gap: 8px; margin: 8px 0 14px; flex-wrap: wrap; }
.cal-bar h1 { margin: 0 8px 0 0 !important; font-size: 22px !important; }
.cal-bar .sp { flex: 1; }
.cal-nav { display: inline-flex; border: 1px solid var(--line2); border-radius: 6px; overflow: hidden; }
.cal-nav button { height: 30px; padding: 0 10px; font-size: 13px; color: var(--text2); display: grid; place-items: center; }
.cal-nav button:hover { background: var(--hover); }
.cal-nav button + button { border-left: 1px solid var(--line2); }
.cal-stats { color: var(--text2); font-size: 13px; }
.cal { border: 1px solid var(--line2); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 420px; }
.cal-head { display: flex; border-bottom: 1px solid var(--line2); background: var(--bg); }
.cal-head .gut { width: 52px; flex-shrink: 0; }
.cal-head .dh { flex: 1; text-align: center; padding: 6px 2px; font-size: 12px; color: var(--text2); border-left: 1px solid var(--line); cursor: pointer; }
.cal-head .dh b { display: block; font-size: 20px; font-weight: 500; color: var(--text); line-height: 1.2; }
.cal-head .dh.today b { color: #fff; background: var(--red); border-radius: 50%; width: 32px; height: 32px; line-height: 32px; margin: 0 auto; font-size: 16px; }
.cal-head .dh .load { display: block; font-size: 11px; color: var(--text3); }
.cal-allday { display: flex; border-bottom: 1px solid var(--line2); max-height: 150px; overflow-y: auto; }
.cal-allday .gut { width: 52px; flex-shrink: 0; font-size: 10px; color: var(--text3); padding: 6px 4px; text-align: right; }
.cal-allday .ad { flex: 1; border-left: 1px solid var(--line); padding: 3px; min-height: 30px; min-width: 0; }
.cal-chip { display: flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 5px; border-radius: 4px; cursor: pointer; margin-bottom: 2px; background: #f5f5f5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip:hover { background: #ececec; }
.cal-chip .check { width: 13px; height: 13px; margin: 0; border-width: 1px !important; }
.cal-chip span { overflow: hidden; text-overflow: ellipsis; }
.cal-chip.overdue { background: #fdecea; }
.cal-scroll { flex: 1; overflow-y: auto; position: relative; }
.cal-grid { display: flex; position: relative; }
.cal-hours { width: 52px; flex-shrink: 0; }
.cal-hours div { height: 48px; font-size: 11px; color: var(--text3); text-align: right; padding-right: 8px; transform: translateY(-7px); }
.cal-col { flex: 1; position: relative; border-left: 1px solid var(--line); min-width: 0; }
.cal-col .slot { height: 48px; border-top: 1px solid var(--line); }
.cal-col .slot:hover { background: #fafafa; }
.cal-col.today { background: #fffdfc; }
.cal-ev { position: absolute; left: 2px; right: 2px; border-radius: 5px; padding: 2px 6px; font-size: 12px; overflow: hidden; cursor: grab; z-index: 2; line-height: 1.3; user-select: none; touch-action: none; }
.cal-ev.meeting { background: var(--meet); border-left: 3px solid var(--meet-b); color: #1b3d9b; }
.cal-ev.task { background: #fff; border: 1px solid var(--line2); border-left: 3px solid var(--p4); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.cal-ev.task.p1 { border-left-color: var(--p1); } .cal-ev.task.p2 { border-left-color: var(--p2); } .cal-ev.task.p3 { border-left-color: var(--p3); }
.cal-ev.unclear { background: #fff8ec; border-left-color: #eb8909; }
.cal-ev .t { font-weight: 600; font-size: 11px; opacity: .8; }
.cal-ev .n { font-weight: 500; }
.cal-ev .row { display: flex; gap: 5px; align-items: flex-start; }
.cal-ev .check { width: 13px; height: 13px; margin-top: 1px; border-width: 1px !important; }
.cal-ev.dragging { opacity: .85; box-shadow: var(--shadow); z-index: 10; cursor: grabbing; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 3; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.month { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line2); border-radius: var(--radius); overflow: hidden; }
.month .mwd { text-align: center; font-size: 12px; color: var(--text2); padding: 6px; border-bottom: 1px solid var(--line2); background: var(--side); }
.month .mc { min-height: 110px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); padding: 4px; cursor: pointer; min-width: 0; }
.month .mc:nth-child(7n+1) { border-left: 0; }
.month .mc:hover { background: #fcfcfc; }
.month .mc.other { background: #fafafa; color: var(--text3); }
.month .mc .num { font-size: 12px; font-weight: 600; margin-bottom: 3px; display: flex; justify-content: space-between; }
.month .mc.today .num b { background: var(--red); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: inline-grid; place-items: center; }
.month .mc .num .load { font-weight: 400; color: var(--text3); font-size: 11px; }
.month .mi { font-size: 11px; padding: 1px 4px; border-radius: 3px; margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.month .mi.meeting { background: var(--meet); color: #1b3d9b; }
.month .mi.timed { background: #f3f3f3; }
.month .mi .tm { font-weight: 600; margin-right: 3px; }
.month .more { font-size: 11px; color: var(--text3); padding-left: 4px; }

/* ---------- предстоящее ---------- */
.week-strip { display: flex; gap: 4px; margin: 0 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.week-strip button { flex: 1; text-align: center; padding: 6px 0; border-radius: 6px; font-size: 12px; color: var(--text2); }
.week-strip button b { display: block; font-size: 15px; color: var(--text); }
.week-strip button:hover { background: var(--hover); }
.week-strip button.today b { color: var(--red); }
.week-strip button.past { opacity: .4; }
.day-head { font-weight: 700; font-size: 14px; margin: 24px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--line2); display: flex; gap: 6px; align-items: baseline; }
.day-head .wd { color: var(--text2); font-weight: 400; font-size: 13px; }

/* ---------- прочее ---------- */
.toast { position: fixed; left: 24px; bottom: 24px; z-index: 70; background: #202020; color: #fff; border-radius: 8px; padding: 10px 14px; display: flex; gap: 16px; align-items: center; font-size: 13px; box-shadow: var(--shadow); animation: up .2s; }
.toast button { color: #ff8d85; font-weight: 600; }
@keyframes up { from { transform: translateY(20px); opacity: 0; } }
.fab { display: none; position: fixed; right: 20px; bottom: 24px; width: 56px; height: 56px; border-radius: 50%; background: var(--red); color: #fff; box-shadow: 0 4px 14px rgba(220,76,62,.45); z-index: 20; place-items: center; }
.login { max-width: 340px; margin: 18vh auto 0; padding: 0 20px; text-align: center; }
.login h1 { font-size: 28px; margin: 14px 0 22px; }
.login input { width: 100%; padding: 11px 12px; border: 1px solid var(--line2); border-radius: 8px; margin-bottom: 10px; outline: 0; font-size: 15px; }
.login input:focus { border-color: #aaa; }
.login .btn { width: 100%; justify-content: center; height: 42px; font-size: 15px; }
.login .err { color: var(--p1); font-size: 13px; min-height: 20px; }
.overdue-head .act { color: var(--red); }
.search-input { width: 100%; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 8px; outline: 0; margin-bottom: 12px; font-size: 15px; }
.settings-list .row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); gap: 12px; }
.settings-list select, .settings-list input { border: 1px solid var(--line2); border-radius: 6px; padding: 5px 8px; outline: 0; }
.modal .mh { display: flex; align-items: center; padding: 14px 16px 6px; font-weight: 700; font-size: 16px; }
.modal .mh .sp { flex: 1; }
.modal .mb { padding: 0 16px 16px; }
.modal .mf { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); }
.field-input { width: 100%; padding: 8px 10px; border: 1px solid var(--line2); border-radius: 6px; outline: 0; margin: 4px 0 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.colors { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin: 6px 0 12px; }
.colors button { width: 22px; height: 22px; border-radius: 50%; }
.colors button.sel { outline: 2px solid var(--text); outline-offset: 2px; }

/* ---------- телефон ---------- */
@media (max-width: 750px) {
  #side { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; box-shadow: var(--shadow); width: 290px; }
  #side.closed { margin-left: -300px; box-shadow: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 39; }
  .view { padding: 0 16px 120px; }
  .view.wide { padding: 0 8px 20px; }
  .fab { display: grid; }
  .task .proj { position: static; display: inline-flex; }
  .task .actions { display: none !important; }
  .task .grip, .task .twisty { display: none; }
  .overlay { padding: 0; align-items: flex-end; }
  .modal { border-radius: 14px 14px 0 0; max-height: 92vh; }
  .modal.detail { height: 92vh; }
  .detail-body { flex-direction: column; overflow-y: auto; }
  .detail-left { overflow: visible; }
  .detail-right { width: auto; border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .cal { height: calc(100vh - 170px); }
  .cal-head .gut, .cal-allday .gut, .cal-hours { width: 38px; }
  .cal-head .dh b { font-size: 15px; }
  .cal-head .dh.today b { width: 26px; height: 26px; line-height: 26px; font-size: 14px; }
  .cal-ev { padding: 1px 3px; font-size: 11px; }
  .month .mc { min-height: 64px; padding: 2px; }
  .month .mi { font-size: 10px; padding: 0 2px; }
  .month .mi .tm { display: none; }
  .toast { left: 12px; right: 12px; bottom: 90px; }
  .pop { max-width: calc(100vw - 24px); }
}

.ghost { opacity: .5; }
.task.ghost .actions { display: none !important; }
.cal-ev.ghost { cursor: pointer; }
.cal-ev .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 750px) { .cal-allday { max-height: 96px; } .cal-bar h1 { font-size: 19px !important; } .cal-stats { width: 100%; order: 5; } }
