.top { text-align: center; margin-top: 18px; }
.top .emoji { font-size: 64px; line-height: 1; animation: float 3.4s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-10px) rotate(4deg); } }
.top .script { font-size: 54px; color: var(--accent); margin-top: 8px; }
.top h1 { margin: 6px 0 0; font-size: 28px; font-weight: 900; line-height: 1.15; }
.top p { margin: 8px 0 0; color: var(--muted); font-size: 16px; line-height: 1.45; }

.stats { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.stat { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: #fff; box-shadow: var(--shadow-sm);
        font-weight: 800; font-size: 14.5px; color: var(--ink); text-decoration: none; }
a.stat { color: var(--accent); }

.add-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 20px; min-height: 58px; border: 0; border-radius: 999px;
           background: var(--accent); color: #fff; font: inherit; font-size: 18px; font-weight: 900; cursor: pointer;
           box-shadow: 0 18px 36px -16px rgba(225, 29, 99, .8), inset 0 -3px 0 rgba(0, 0, 0, .12); }
.add-btn:active { transform: scale(.98); }

.list { display: grid; gap: 12px; margin-top: 20px; }
.idea { position: relative; background: #fff; border-radius: 22px; padding: 16px 16px 14px; box-shadow: var(--shadow-sm); border: 1px solid rgba(225, 29, 99, .08);
        animation: pop .45s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
.idea.new { box-shadow: 0 0 0 3px rgba(225, 29, 99, .35), var(--shadow-sm); }
.idea .row { display: flex; gap: 12px; align-items: flex-start; }
.idea .ico { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: #fff0f5; }
.idea h3 { margin: 0; font-size: 18px; line-height: 1.25; font-weight: 900; word-break: break-word; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: #f4f0f2; color: var(--muted); }
.chip.date { background: #fff0f5; color: var(--accent); }
.chip.done { background: #e7f8ee; color: #0f7a43; }
.note { margin: 10px 0 0; font-size: 15px; line-height: 1.45; color: var(--ink); white-space: pre-line; word-break: break-word; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.links a { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; text-decoration: none; font-size: 13.5px; font-weight: 800; padding: 8px 12px;
           border-radius: 999px; background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(120, 20, 60, .14); }
.links a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty { text-align: center; padding: 34px 20px; border-radius: 22px; border: 2px dashed rgba(225, 29, 99, .25); color: var(--muted); font-weight: 700; line-height: 1.5; }
.empty b { display: block; font-size: 40px; margin-bottom: 6px; }
.hint { margin-top: 18px; text-align: center; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.hint a { font-weight: 800; }
.loading { text-align: center; color: var(--muted); padding: 30px; font-weight: 700; }

/* ---------- форма (нижняя шторка) ---------- */
dialog.sheet { width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; margin: auto auto 0; padding: 0; border: 0; border-radius: 28px 28px 0 0;
               background: #fff7f9; color: var(--ink); box-shadow: 0 -20px 50px -20px rgba(120, 20, 60, .5); overflow: auto; }
dialog.sheet[open] { animation: up .35s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
dialog.sheet::backdrop { background: rgba(60, 10, 30, .38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
@media (min-width: 620px) { dialog.sheet { margin: auto; border-radius: 28px; } }
.sheet form { padding: 20px 18px calc(var(--safe-b) + 20px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h2 { margin: 0; font-size: 24px; font-weight: 900; }
.x { border: 0; background: #fff; width: 40px; height: 40px; border-radius: 50%; font-size: 20px; cursor: pointer; box-shadow: var(--shadow-sm); color: var(--ink); }
label.field { display: block; margin-bottom: 14px; }
label.field > span, .field-label { display: block; margin: 0 0 6px 4px; font-size: 13px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
label.field > span i { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 700; opacity: .8; }
.sheet input, .sheet textarea {
  width: 100%; display: block; font: inherit; font-size: 16px; font-weight: 700; color: var(--ink); background: #fff;
  border: 1.5px solid rgba(225, 29, 99, .12); border-radius: 16px; padding: 13px 14px; min-height: 52px;
  -webkit-appearance: none; appearance: none; outline: none; transition: border-color .2s, box-shadow .2s;
}
.sheet textarea { resize: none; min-height: 80px; font-weight: 600; line-height: 1.4; }
.sheet input:focus, .sheet textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(225, 29, 99, .15); }
.sheet input.bad { border-color: #dc2626; }
.date-row { display: flex; gap: 8px; }
.date-row input { flex: 1; }
.date-row button { flex: 0 0 auto; border: 0; border-radius: 16px; padding: 0 14px; background: #fff; font: inherit; font-weight: 800; color: var(--muted); cursor: pointer; box-shadow: var(--shadow-sm); }
.cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.cats label { cursor: pointer; }
.cats input { position: absolute; opacity: 0; pointer-events: none; }
.cats span { display: inline-block; padding: 9px 13px; border-radius: 999px; background: #fff; font-size: 14px; font-weight: 800; box-shadow: 0 2px 8px rgba(120, 20, 60, .12); transition: background .2s, color .2s; }
.cats input:checked + span { background: var(--accent); color: #fff; }
.cats input:focus-visible + span { outline: 3px solid rgba(225, 29, 99, .4); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.err { min-height: 20px; margin: 0 4px 8px; font-size: 14.5px; font-weight: 800; color: #dc2626; }
.submit { width: 100%; min-height: 56px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: inherit; font-size: 18px; font-weight: 900; cursor: pointer;
          box-shadow: 0 16px 30px -14px rgba(225, 29, 99, .8); }
.submit:disabled { opacity: .6; }

.toast { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 22px); transform: translate(-50%, 30px); opacity: 0; z-index: 100; pointer-events: none;
         background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 800; font-size: 15px; box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
         transition: opacity .3s, transform .3s; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { .top .emoji, .idea, dialog.sheet[open] { animation: none; } }
