:root {
      --ink: #183b4e;
      --muted: #536d7c;
      --blue: #258cff;
      --cyan: #30c1e1;
      --mint: #52ddb0;
      --line: #dce9ef;
      --soft: #f5fbfd;
      --accent: #0d6f8c;
      --accent-soft: #e7f5fa;
      --accent-border: #b6dce8;
      --gradient: linear-gradient(115deg, #2994ff 0%, #30bfdf 52%, #51ddb0 100%);
      --shadow: 0 8px 28px rgba(42, 119, 155, .08);
    }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: #dff4fa; overflow-anchor: none; }
body {
      margin: 0; color: var(--ink);
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
      font-size: 14px; line-height: 1.55;
      background: radial-gradient(ellipse at 12% 15%, #c5eaff, transparent 50%),
        radial-gradient(ellipse at 86% 80%, #d2f9e9, transparent 50%), #e7f7fc;
      min-height: 100vh; padding: 36px 16px;
      -webkit-tap-highlight-color: transparent;
    }
body.modal-open { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; color: inherit; transition: background-color .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease; }
button, input, textarea, select { touch-action: manipulation; }
button { border: 0; transition: background-color .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease; }
button:disabled { cursor: default; opacity: 1; color: #71838e; background: #edf2f5; border-color: #d8e3e9; box-shadow: none; filter: none; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
      outline: 3px solid #1489c8; outline-offset: 3px;
    }
input, textarea, select { color: var(--ink); font-size: 16px; }
input::placeholder, textarea::placeholder { color: #647d8b; opacity: 1; }
input[type="checkbox"] { accent-color: #169ab6; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.app { max-width: 540px; margin: 0 auto; min-height: 840px; padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); background: #f7fbfd; border-radius: 30px; overflow: clip; box-shadow: 0 24px 80px #458fb525; position: relative; }
.hero { padding: 23px 24px 44px; height: var(--hero-expanded-height, auto); background: var(--gradient); color: white; position: relative; top: 0; z-index: 1; border-radius: 30px 30px 0 0; isolation: isolate; overflow: hidden; transition: height .22s ease, padding .22s ease; }
.hero::before { content: ""; position: absolute; width: 290px; height: 290px; border-radius: 50%; right: -118px; top: -155px; background: #ffffff16; z-index: -1; }
.hero::after { content: ""; position: absolute; width: 200px; height: 200px; border-radius: 44%; right: -50px; bottom: -105px; background: #65edbd4d; transform: rotate(25deg); z-index: -1; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 750; letter-spacing: -.5px; }
.brand-symbol { display: grid; place-items: center; width: 36px; height: 36px; background: #ffffff24; border: 1px solid #ffffff4d; border-radius: 12px; }
.brand-symbol .icon { width: 24px; height: 24px; stroke-width: 2; }
.edition { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 55%; min-height: 44px; color: white; border: 1px solid #ffffff70; background: #ffffff20; border-radius: 99px; padding: 8px 10px; font-size: 12px; font-weight: 700; }
.edition .icon { width: 15px; height: 15px; }
#hero-group-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#groups-dialog { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
.group-back { margin-bottom: 10px; }
.greeting { font-size: 12px; margin: 23px 0 2px; color: #fff; }
h1 { font-size: 28px; line-height: 1.25; letter-spacing: -.85px; margin: 0 0 7px; font-weight: 750; }
.hero-description { font-size: 13px; margin: 0; color: #fff; font-weight: 500; }
.hero-stats { display: flex; align-items: center; margin-top: 23px; gap: 17px; }
.hero-stat { display: flex; align-items: baseline; gap: 7px; font-size: 12px; font-weight: 500; }
.hero-stat strong { font-size: 23px; line-height: 1; letter-spacing: -.6px; }
.stats-divider { height: 21px; width: 1px; background: #ffffff66; }
.hero.is-collapsed { position: sticky; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: calc(78px + env(safe-area-inset-top, 0px)); padding: max(12px, env(safe-area-inset-top)) 18px 12px; border-radius: 0; }
.hero.is-collapsed .brand { font-size: 17px; gap: 7px; }
.hero.is-collapsed .brand-symbol { width: 31px; height: 31px; border-radius: 10px; }
.hero.is-collapsed .brand-symbol .icon { width: 22px; height: 22px; }
.hero.is-collapsed .brand-row { flex-shrink: 0; }
.hero.is-collapsed .greeting, .hero.is-collapsed h1, .hero.is-collapsed .hero-description, .hero.is-collapsed .edition, .hero.is-collapsed .stats-divider { display: none; }
.hero.is-collapsed .hero-stats { margin: 0; flex-direction: column; align-items: flex-start; gap: 5px; }
.hero.is-collapsed .hero-stat { font-size: 11px; gap: 6px; white-space: nowrap; }
.hero.is-collapsed .hero-stat strong { font-size: 16px; min-width: 17px; }
.content { padding: 0 20px 96px; position: relative; }
h2 { margin: 0; font-size: 17px; line-height: 1.4; letter-spacing: -.35px; }
.card-top { display: flex; align-items: flex-start; gap: 8px; justify-content: space-between; }
.card-preview { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.card-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 7px; }
.card-bottom .avatar { width: 23px; height: 23px; font-size: 9px; }
.card-footer { display: flex; align-items: center; gap: 12px; margin-top: 8px; min-width: 0; }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 750; background: #e8f3ff; color: #297bb4; flex: 0 0 auto; }
.avatar-default { display: grid; place-items: center; width: 100%; height: 100%; min-width: 0; border-radius: inherit; background: var(--avatar-color, #1675dd); color: #fff; font-size: inherit; font-weight: 750; line-height: 1; letter-spacing: -.02em; user-select: none; }
.call-person-avatar { width: 60px; height: 60px; border-radius: 50%; overflow: hidden; }
.card-meta { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); }
.unread { display: inline-grid; place-items: center; min-width: 19px; height: 19px; border-radius: 7px; background: #2589e7; color: white; font-size: 10px; font-weight: 700; }
.card-progress { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 65px; }
.empty { text-align: center; padding: 35px 14px; background: white; border: 1px dashed #cee5ee; border-radius: 18px; }
.empty-icon { width: 50px; height: 50px; display: grid; place-items: center; background: #edf8fc; color: #49afcb; border-radius: 17px; margin: 0 auto 13px; }
.empty strong { display: block; font-size: 15px; }
.empty p { color: var(--muted); font-size: 12px; margin: 7px 0 0; }
.desktop-workspace { display: none; }
dialog { color: var(--ink); width: 520px; max-width: calc(100% - 32px); padding: 0; border: 0; border-radius: 27px; box-shadow: 0 30px 90px #16425840; background: #f7fbfd; opacity: 0; transform: translateY(14px) scale(.94); transform-origin: center; transition: opacity .22s ease, transform .28s cubic-bezier(.2,.8,.2,1), display .28s allow-discrete, overlay .28s allow-discrete; }
dialog[open] { opacity: 1; transform: translateY(0) scale(1); }
dialog::backdrop { background: #173f5252; backdrop-filter: blur(5px); opacity: 0; transition: opacity .22s ease, display .28s allow-discrete, overlay .28s allow-discrete; }
dialog[open]::backdrop { opacity: 1; }
@starting-style {
      dialog[open] { opacity: 0; transform: translateY(18px) scale(.9); }
      dialog[open]::backdrop { opacity: 0; }
    }
.dialog-bar { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 18px; background: white; border-bottom: 1px solid var(--line); }
.back-button { display: inline-flex; align-items: center; gap: 5px; background: #f1f8fb; color: var(--accent); padding: 8px 5px; min-height: 42px; border-radius: 10px; font-size: 13px; font-weight: 650; }
.dialog-brand { font-size: 13px; font-weight: 750; color: var(--accent); display: flex; align-items: center; gap: 6px; }
.dialog-brand .icon { width: 17px; height: 17px; }
.dialog-bar-actions { display: flex; align-items: center; gap: 10px; }
.role-label { font-size: 9px; font-weight: 650; color: #238366; background: #e0f4e9; border-radius: 5px; padding: 2px 5px; white-space: nowrap; }
.role-label.deputy { color: #277fa1; background: #e1f1fa; }
.access-note { padding: 13px; border: 1px solid #dbeaf0; border-radius: 12px; background: white; color: var(--muted); font-size: 12px; }
.history-entry { font-size: 12px; margin: 0 0 10px; overflow-wrap: anywhere; }
.history-entry time { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.tab-count { font-size: 11px; background: #e8f0f4; color: #496777; border-radius: 6px; padding: 1px 5px; font-weight: 700; min-width: 20px; text-align: center; }
.panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.message { display: flex; align-items: flex-end; gap: 7px; margin-bottom: 17px; }
.message .avatar { width: 27px; height: 27px; margin-bottom: 3px; }
.message.mine { justify-content: flex-end; }
.image-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-top: 7px; }
.image-grid.single { grid-template-columns: minmax(0, 1fr); }
.image-tile { min-width: 0; width: 100%; aspect-ratio: 1; padding: 0; border-radius: 12px; overflow: hidden; background: #e4f2f7; position: relative; color: #4a8aa5; }
.image-grid.single .image-tile { aspect-ratio: 4 / 3; }
.image-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-placeholder { position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; justify-items: center; padding: 8px; font-size: 10px; text-align: center; }
.image-placeholder .icon { width: 25px; height: 25px; }
.file-icon { flex: 0 0 auto; width: 34px; height: 39px; display: grid; place-items: center; color: #238cab; background: #e8f6fc; border-radius: 9px; }
.file-info { flex: 1; min-width: 0; }
.file-name { display: block; font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.file-size { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.mark-paid-button { min-height: 49px; padding: 10px; border-radius: 13px; background: #e4f7ed; color: #176f52; display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; border: 1px solid #b8dfcc; }
.avatar { overflow: hidden; }
.consent-field { display: flex; align-items: flex-start; gap: 9px; margin: 12px 0 18px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.consent-field input { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; accent-color: #209fc0; }
.security-note { background: #eaf7fb; border: 1px solid #d5edf5; padding: 12px; border-radius: 12px; margin-bottom: 14px; font-size: 13px; line-height: 1.7; color: #416678; overflow-wrap: anywhere; }
.danger-button { color: #98412e !important; background: #fff0e9 !important; border-color: #ebc6b8 !important; box-shadow: none; }
.new-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.close-button { width: 42px; height: 42px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border-radius: 12px; flex-shrink: 0; border: 1px solid var(--accent-border); }
.field { display: block; margin: 0 0 15px; min-width: 0; }
.field-label { display: block; font-size: 13px; font-weight: 650; color: #35596d; margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; min-width: 0; border: 1px solid #c3d8e3; background: white; border-radius: 11px; padding: 11px 12px; min-height: 45px; }
.field textarea { resize: vertical; min-height: 75px; }
.field-help { font-size: 12px; font-weight: 400; color: var(--muted); }
.form-error { margin: 7px 0 0; font-size: 12px; color: #ad4c37; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.primary-button { width: 100%; min-height: 49px; border-radius: 13px; font-size: 15px; font-weight: 700; color: white; background: var(--gradient); display: flex; align-items: center; justify-content: center; gap: 7px; box-shadow: 0 4px 12px #176e9620; }
.toast { position: fixed; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; transform: translate(-50%, 12px); padding: 12px 18px; background: #244d60; color: white; box-shadow: 0 8px 25px #123d5226; font-size: 12px; border-radius: 13px; z-index: 10; width: max-content; max-width: calc(100% - 32px); text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (hover: hover) {
  button:not(:disabled):not(.task-card):not(.board-card):hover { filter: brightness(.96); }
  .primary-button:not(:disabled):hover { box-shadow: 0 6px 16px #176e962e; }
  .field input:hover, .field textarea:hover, .field select:hover { border-color: #90b8cb; }
}
button:not(:disabled):active { box-shadow: inset 0 0 0 1px #173f5212; }
