:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--tg-theme-text-color, #203031);
  background: var(--tg-theme-bg-color, #f7f9f9);
  --accent: var(--tg-theme-button-color, #007a78);
  --accent-text: var(--tg-theme-button-text-color, #fff);
  --surface: var(--tg-theme-secondary-bg-color, #fff);
  --muted: var(--tg-theme-hint-color, #6b7a7b);
  --line: color-mix(in srgb, var(--tg-theme-text-color, #203031) 12%, transparent);
  --wash: color-mix(in srgb, var(--tg-theme-text-color, #203031) 4%, var(--tg-theme-bg-color, #f7f9f9));
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button,input,select { font: inherit; }
button,a,input,select { -webkit-tap-highlight-color: transparent; }
button,a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled,select:disabled { cursor: wait; opacity: .55; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 65%, white); outline-offset: 3px; }
button { color: inherit; }
svg { width: 21px; height: 21px; flex-shrink: 0; }
h1,h2,h3,h4,p { margin: 0; }
h1 { font-size: clamp(28px, 5vw, 36px); line-height: 1.18; font-weight: 720; letter-spacing: -.9px; overflow-wrap: anywhere; }
h2 { font-size: 20px; font-weight: 650; letter-spacing: -.35px; }
h3 { font-size: 19px; font-weight: 650; }
p { line-height: 1.55; }
[hidden] { display: none !important; }
.app-header { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(22px + var(--app-safe-top, env(safe-area-inset-top, 0px))) max(28px, var(--app-safe-right, 0px)) 22px max(28px, var(--app-safe-left, 0px)); border-bottom: 1px solid var(--line); }
.brand { color: inherit; display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 18px; font-weight: 700; letter-spacing: -.5px; }
.brand-mark { background: var(--accent); color: var(--accent-text); border-radius: 11px; display: grid; place-items: center; width: 34px; height: 34px; }
.brand-mark svg { width: 23px; height: 23px; }
.identity { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 35%; }
.preview-bar { display: flex; justify-content: center; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 8px 16px; background: color-mix(in srgb, var(--accent) 9%, var(--tg-theme-bg-color, #fff)); color: var(--accent); font-size: 12px; }
.preview-bar .text-button { min-height: 28px; font-size: 12px; text-decoration: underline; }
.main { max-width: 1180px; margin: 0 auto; padding: 42px max(28px, var(--app-safe-right, 0px)) calc(50px + var(--app-safe-bottom, env(safe-area-inset-bottom, 0px))) max(28px, var(--app-safe-left, 0px)); }
.muted { color: var(--muted); }
.eyebrow { color: var(--accent); font-size: 14px; font-weight: 550; margin-bottom: 12px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 42px; gap: 16px; }
.page-heading .muted { margin-top: 12px; }
.button { min-height: 46px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 12px 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font-size: 14px; font-weight: 600; line-height: 1.3; }
.button.primary { background: var(--accent); border-color: transparent; color: var(--accent-text); }
.button.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.button.danger { color: #bc3a39; border-color: color-mix(in srgb, #bc3a39 25%, transparent); background: transparent; }
.button:not(:disabled):hover { filter: brightness(.96); }
.icon-button { width: 44px; height: 44px; background: transparent; border: 1px solid var(--line); border-radius: 12px; display: inline-grid; place-items: center; flex-shrink: 0; }
.text-button { padding: 4px 0; min-height: 36px; background: transparent; border: 0; color: var(--accent); font-size: 14px; font-weight: 550; display: inline-flex; align-items: center; gap: 8px; }
.section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-title { font-size: 17px; font-weight: 650; }
.room-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.room-card { text-align: left; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); padding: 24px; min-height: 220px; transition: border-color .15s; }
.room-card:hover { border-color: var(--accent); }
.room-card h3 { margin: 22px 0 12px; overflow-wrap: anywhere; }
.room-card-top,.room-card-bottom,.room-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.room-symbol { color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 11px; width: 42px; height: 42px; display: grid; place-items: center; }
.role-badge { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 4px 7px; }
.room-meta { justify-content: flex-start; gap: 16px; font-size: 13px; color: var(--muted); }
.room-card-bottom { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 15px; font-size: 12px; }
.room-card-bottom svg { width: 18px; color: var(--accent); }
.empty-rooms { grid-column: 1/-1; text-align: center; padding: 50px 24px 60px; border: 1px dashed var(--line); border-radius: 18px; }
.empty-rooms p { max-width: 380px; margin: 12px auto 0; font-size: 14px; }
.empty-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 22px; background: var(--wash); color: var(--accent); border-radius: 18px; }
.empty-icon svg { width: 28px; height: 28px; }
.center-state { max-width: 460px; text-align: center; padding: 72px 0; margin: 0 auto; display: flex; align-items: center; flex-direction: column; gap: 18px; }
.center-state .empty-icon { margin-bottom: 0; }
.center-state h1 { font-size: 27px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.welcome { max-width: 560px; margin: 24px auto; text-align: center; }
.welcome-icon { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 24px; background: color-mix(in srgb, var(--accent) 9%, transparent); color: var(--accent); margin: 0 auto 28px; }
.welcome-icon svg { width: 36px; height: 36px; }
.welcome-title { font-size: clamp(34px, 6vw, 48px); white-space: pre-line; line-height: 1.12; letter-spacing: -1.6px; }
.welcome-copy { color: var(--muted); max-width: 410px; margin: 22px auto 30px; font-size: 16px; }
.login-card { text-align: left; background: var(--surface); border: 1px solid var(--line); padding: 24px; border-radius: 18px; margin: 32px auto 0; }
.login-card h2 { font-size: 17px; }
.login-card p { font-size: 13px; margin: 8px 0 18px; }
.identity-choice { display: flex; align-items: center; width: 100%; gap: 13px; text-align: left; background: transparent; border: 0; border-top: 1px solid var(--line); min-height: 78px; padding: 14px 0; }
.identity-choice>svg { margin-left: auto; color: var(--accent); }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); font-size: 17px; font-weight: 600; flex-shrink: 0; }
.choice-copy { display: flex; flex-direction: column; gap: 5px; }
.choice-copy strong { font-size: 15px; font-weight: 600; }
.choice-copy .muted { font-size: 12px; }
.fine-print { font-size: 12px; color: var(--muted); margin: 18px auto; max-width: 330px; }
.back-link { background: transparent; border: 0; display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; min-height: 36px; padding: 0; margin: -16px 0 20px; }
.back-link svg { width: 17px; }
.room-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 26px; }
.room-heading h1 { margin-bottom: 9px; }
.members-link { color: var(--muted); font-size: 13px; min-height: 30px; }
.members-link svg { width: 17px; }
.room-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.quick-task { display: flex; background: var(--surface); border: 1px solid var(--line); padding: 8px; border-radius: 15px; gap: 8px; margin-bottom: 36px; }
.quick-task input { flex: 1; min-width: 0; padding: 10px 12px; background: transparent; border: 0; color: inherit; font-size: 15px; }
input::placeholder { color: var(--muted); opacity: .9; }
.board-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; }
.board-heading p { font-size: 12px; }
.board { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: start; gap: 16px; }
.column { background: var(--wash); border-radius: 15px; padding: 14px; min-height: 260px; }
.column-heading { display: flex; align-items: center; gap: 8px; padding: 4px 1px 18px; }
.column-heading h3 { font-size: 13px; font-weight: 650; }
.status-dot { width: 7px; height: 7px; background: #8d9c9e; border-radius: 50%; flex-shrink: 0; }
.column-inProgress .status-dot { background: #d1a04b; }
.column-done .status-dot { background: var(--accent); }
.column-count { margin-left: auto; color: var(--muted); font-size: 12px; }
.column-empty { font-size: 12px; color: var(--muted); text-align: center; padding: 26px 0; }
.task-card { border: 1px solid var(--line); border-radius: 11px; padding: 16px; background: var(--surface); margin-bottom: 10px; }
.task-card h4 { font-size: 14px; line-height: 1.5; font-weight: 550; overflow-wrap: anywhere; white-space: pre-wrap; }
.task-control { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; }
.task-label { color: var(--muted); font-size: 11px; }
.task-control select { flex: 1; max-width: 100%; min-width: 120px; min-height: 36px; font-size: 12px; color: var(--accent); background: var(--surface); padding: 5px 2px; border: 0; border-radius: 5px; }
.updated { text-align: right; font-size: 11px; color: var(--muted); margin-top: 18px; }
.notice { font-size: 13px; padding: 12px 14px; border-radius: 10px; background: var(--wash); margin-bottom: 16px; }
.notice.error { color: var(--tg-theme-destructive-text-color, #ad3232); background: color-mix(in srgb, #bc3a39 8%, transparent); }
.sheet { color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 0; width: min(480px,calc(100% - 32px)); max-height: min(85vh, 800px); box-shadow: 0 24px 80px #0002; }
.sheet::backdrop { background: #152b2d66; }
.sheet-header { padding: 20px 24px 14px; display: flex; justify-content: space-between; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.sheet-header h2 { font-size: 20px; }
.sheet-header .icon-button { width: 36px; height: 36px; border: 0; }
.sheet-body { padding: 24px; }
.sheet-body>.muted { font-size: 14px; margin-bottom: 22px; }
.sheet-form,.invite-controls { display: flex; flex-direction: column; gap: 12px; }
.field-label { font-size: 13px; font-weight: 600; }
.field { width: 100%; color: inherit; background: var(--tg-theme-bg-color, #f7f9f9); border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; min-height: 48px; font-size: 16px; }
.invite-link { font-size: 12px; }
.sheet-form .notice { margin: 0; }
.member-row { display: flex; gap: 13px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.member-row:last-child { border-bottom: 0; }
.member-row .role-badge { margin-left: auto; }
.member-name { font-size: 14px; overflow-wrap: anywhere; }
.invite-controls .fine-print { margin: 0; max-width: none; }
.invite-controls hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.invite-feedback { margin-top: 16px; }
.invite-preview { max-width: 480px; text-align: center; margin: 40px auto; }
.invite-preview h1 { margin-bottom: 16px; }
.invite-explanation { margin: 24px 0; }
.invite-preview .button { width: 100%; margin-bottom: 8px; }
.toast { position: fixed; z-index: 20; bottom: calc(24px + var(--app-safe-bottom, env(safe-area-inset-bottom, 0px))); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); background: var(--tg-theme-text-color, #203031); color: var(--tg-theme-bg-color, #fff); padding: 13px 20px; border-radius: 12px; font-size: 13px; box-shadow: 0 8px 30px #0002; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 900px) { .room-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .board { gap: 10px; } .column { padding: 10px; } .task-card { padding: 12px; } }
@media (max-width: 620px) {
  .app-header { padding: calc(16px + var(--app-safe-top, env(safe-area-inset-top, 0px))) max(20px,var(--app-safe-right,0px)) 16px max(20px,var(--app-safe-left,0px)); }
  .main { padding: 30px max(20px,var(--app-safe-right,0px)) calc(34px + var(--app-safe-bottom, env(safe-area-inset-bottom, 0px))) max(20px,var(--app-safe-left,0px)); }
  .brand { font-size: 17px; } .identity { font-size: 12px; } .page-heading { margin-bottom: 30px; }
  .section-toolbar { align-items: center; gap: 12px; } .section-toolbar .button { font-size: 12px; padding: 11px 12px; gap: 5px; } .section-toolbar .button svg { width: 16px; }
  .room-grid { grid-template-columns: 1fr; gap: 14px; } .room-card { min-height: 200px; padding: 20px; }
  .room-card h3 { margin-top: 16px; } .room-card-bottom { margin-top: 18px; }
  .room-heading { align-items: start; flex-wrap: wrap; margin-bottom: 20px; gap: 16px; } .room-heading>div:first-child { flex: 1; min-width: 180px; }
  .room-actions { width: 100%; justify-content: flex-end; } .room-actions .button { flex: 1; }
  .quick-task { margin-bottom: 28px; } .quick-task .button { font-size: 13px; padding: 12px; } .quick-task .button svg { display: none; } .quick-task input { padding: 10px 6px; font-size: 14px; }
  .board { grid-template-columns: 1fr; gap: 18px; } .column { min-height: 118px; padding: 14px; } .column-heading { padding-bottom: 14px; } .column-heading h3 { font-size: 14px; }
  .column-empty { padding: 12px 0 20px; } .task-card { padding: 16px; } .task-control { margin-top: 10px; } .task-control select { flex: 0; min-width: 145px; margin-left: auto; }
  .welcome { margin: 12px auto; } .welcome-title { font-size: 37px; } .welcome-copy { font-size: 15px; } .login-card { padding: 20px; }
  .sheet { margin: auto 0 0; width: 100%; max-width: none; max-height: 90dvh; border-radius: 22px 22px 0 0; padding-bottom: var(--app-safe-bottom,env(safe-area-inset-bottom,0px)); } .sheet-header { padding: 16px 20px; } .sheet-body { padding: 20px; }
  .board-heading { align-items: baseline; } .board-heading p { font-size: 11px; } .invite-preview { margin-top: 24px; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration: .01ms !important; transition: none !important; } }
