.team-ui {
  --team-violet: #7655e8;
  --team-violet-2: #9e7cff;
  --team-green: #25b97b;
  --team-green-soft: #ddf6eb;
  --team-red: #e65e67;
  position: relative;
  min-height: calc(100dvh - 118px - var(--dnevio-safe-top) - var(--dnevio-safe-bottom));
  -webkit-text-size-adjust: 100%;
}
:root[data-theme="dark"] .team-ui { --team-green-soft: #153c30; }
.team-ui button, .team-ui input, .team-ui textarea { font: inherit; }
.team-ui button, .team-ui label { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.team-header { display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; align-items: center; min-height: 54px; }
.team-title-button { border: 0; background: transparent; }
.team-title-button { display: grid; min-width: 0; justify-items: center; padding: 5px 7px; color: var(--text); }
.team-title-button strong { width: 100%; overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 800; }
.team-title-button small { min-height: 14px; color: var(--muted); font-size: 12px; }
.team-page-error { margin: 8px 0; padding: 11px 13px; border-radius: 14px; background: color-mix(in srgb, var(--team-red) 14%, var(--surface)); color: var(--team-red); font-size: 12px; }
.team-empty-state { display: grid; justify-items: center; padding: 42px 12px 20px; text-align: center; }
.team-vio-orbit { display: grid; width: 112px; height: 112px; place-items: center; margin-bottom: 20px; border-radius: 50%; background: radial-gradient(circle, rgba(118, 85, 232, .24), rgba(118, 85, 232, .03) 68%, transparent 69%); }
.team-empty-state h1 { max-width: 320px; margin: 0; font-size: 26px; line-height: 1.12; }
.team-empty-state p { max-width: 390px; margin: 12px 0 26px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.team-ui .primary, .team-ui .secondary, .team-ui .danger-button, .team-primary, .team-secondary { width: 100%; min-height: 50px; border-radius: 16px; font-weight: 750; }
.team-ui .primary, .team-primary { border: 0; background: linear-gradient(135deg, var(--team-violet), var(--team-violet-2)); color: #fff; box-shadow: 0 11px 24px rgba(118, 85, 232, .24); }
.team-ui .secondary, .team-secondary { margin-top: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.team-ui .danger-button { border: 1px solid color-mix(in srgb, var(--team-red) 35%, var(--line)); background: transparent; color: var(--team-red); }
.team-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 4px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 72%, var(--page)); }
.team-tabs button { min-height: 38px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; }
.team-tabs button[aria-selected="true"] { background: var(--surface); color: var(--violet-text); box-shadow: 0 5px 14px rgba(22, 31, 32, .08); }
.team-ui [data-team-panel] { display: grid; gap: 11px; padding-top: 12px; }
.team-ui .card { padding: 16px; border: 1px solid var(--line); border-radius: 21px; background: var(--surface); box-shadow: 0 8px 26px color-mix(in srgb, var(--shadow) 30%, transparent); }
.team-ui .streak-card { background: linear-gradient(140deg, color-mix(in srgb, var(--violet-soft) 78%, var(--surface)), var(--surface)); }
.team-ui .streak-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.team-ui .streak-head strong { font-size: 19px; }
.team-ui .streak-head span { color: var(--violet-text); font-size: 13px; font-weight: 750; }
.team-ui .streak-card p, .team-ui .card-note { margin: 6px 0 10px; color: var(--muted); font-size: 12.5px; }
.team-ui .streak-state { display: block; margin: 8px 0 0; color: var(--violet-text); font-size: 12px; font-weight: 700; }
.team-ui .streak-state.saved { color: var(--team-green); }
.team-ui .streak-card.at-risk { border-color: color-mix(in srgb, var(--violet) 32%, var(--line)); }
.team-ui .solo-team-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.team-ui .solo-team-card strong { font-size: 14px; }
.team-ui .solo-team-card p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.team-ui .solo-team-card button { width: auto; min-height: 40px; margin: 0; padding: 8px 11px; font-size: 12px; }
.team-ui .empty-note { margin: 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.team-ui .progress-track { display: block; height: 8px; overflow: hidden; border-radius: 8px; background: color-mix(in srgb, var(--violet) 13%, var(--surface)); }
.team-ui .progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--team-violet), var(--team-violet-2)); }
.team-ui .streak-card .progress-track { margin-top: 18px; }
.team-ui .streak-card { padding: 22px; }
.team-ui .team-status-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.team-ui .team-status-badges span { padding: 5px 9px; border-radius: 9px; background: var(--surface); color: var(--muted); font-size: 12px; }
.team-ui .team-status-badges .is-complete { color: var(--text); background: var(--violet-soft); }
.team-week-person { margin-top: 16px; }
.team-week-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 8px; }
.team-week-days span { text-align: center; padding: 8px 0; border-radius: 8px; background: var(--surface); color: var(--muted); }
.team-week-days .is-complete { color: var(--violet); background: var(--violet-soft); }
.team-week-days small { display: block; margin-top: 4px; font-size: 10px; color: var(--muted); }
.team-ui .member-list, .team-ui .activity-list, .team-ui .goal-list, .team-ui .menu-list { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--line); }
.team-ui .member-row, .team-ui .activity-row, .team-ui .menu-row, .team-ui .switch-row { display: grid; align-items: center; background: var(--surface); }
.team-ui .member-row { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; min-height: 67px; padding: 10px 12px; }
.team-ui .avatar { display: grid; width: 42px; height: 42px; place-items: center; overflow: hidden; border-radius: 50%; background: var(--violet-soft); color: var(--violet-text); font-size: 12px; font-weight: 800; }
.team-ui .avatar img { width: 100%; height: 100%; object-fit: cover; }
.team-ui .member-copy { min-width: 0; }
.team-ui .member-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.team-ui .member-copy small { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.team-ui .goal-score { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; background: var(--page); color: var(--muted); font-size: 12px; font-weight: 800; }
.team-ui .goal-score.complete { background: var(--team-green-soft); color: var(--team-green); }
.team-ui .goal-score.partial { background: var(--violet-soft); color: var(--violet-text); }
.team-ui .section-label { display: flex; align-items: center; justify-content: space-between; padding: 8px 3px 1px; }
.team-ui .section-label h2 { margin: 0; font-size: 16px; }
.team-ui .section-label small { color: var(--muted); font-size: 12px; }
.team-ui .vio-line { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; align-items: center; padding: 12px 14px; border-radius: 18px; background: var(--violet-soft); }
.team-ui .vio-line p { margin: 0; font-size: 12.5px; line-height: 1.45; }
.team-vio-mini { display: block; width: 38px; height: 38px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--violet) 20%, var(--line)); border-radius: 11px; background-color: color-mix(in srgb, var(--violet) 11%, var(--surface)); background-image: url('/assets/vio/vio-mini-v3.png'); background-position: center; background-size: 95%; background-repeat: no-repeat; box-shadow: 0 6px 16px rgba(89, 57, 190, .18); }
.team-vio-mini-face { display: none; }
.team-ui .week-score { display: grid; grid-template-columns: 86px 1fr; gap: 16px; align-items: center; }
.team-ui .ring { position: relative; display: grid; width: 86px; height: 86px; place-items: center; border-radius: 50%; background: conic-gradient(var(--team-green) var(--score), color-mix(in srgb, var(--surface) 70%, var(--page)) 0); }
.team-ui .ring::before { position: absolute; width: 64px; height: 64px; border-radius: 50%; background: var(--surface); content: ""; }
.team-ui .ring b { position: relative; font-size: 19px; }
.team-ui .week-score h2 { margin: 0 0 5px; font-size: 17px; }
.team-ui .week-score p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.team-ui .week-comparison { display: block; margin-top: 6px; color: var(--muted); font-size: 11.5px; font-weight: 700; }
.team-ui .week-comparison.positive { color: var(--team-green); }
.team-ui .goal-item { padding: 12px 14px; background: var(--surface); }
.team-ui .goal-item div { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 12px; }
.team-ui .goal-item b { color: var(--violet-text); }
.team-ui .activity-row { grid-template-columns: 42px minmax(0, 1fr); gap: 10px; padding: 12px; }
.team-ui .activity-row p { margin: 2px 0; font-size: 13px; line-height: 1.4; }
.team-ui .activity-row small { color: var(--muted); font-size: 11px; }
.team-ui .system-event { padding: 13px 14px; background: color-mix(in srgb, var(--violet) 8%, var(--surface)); color: var(--text); font-size: 12px; font-weight: 650; line-height: 1.45; }
.team-ui .activity-empty { padding: 22px 16px; background: var(--surface); text-align: center; }
.team-ui .activity-empty strong { font-size: 13px; }
.team-ui .activity-empty p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.team-ui .reactions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.team-ui .reaction { min-width: 34px; height: 27px; border: 1px solid var(--line); border-radius: 14px; background: var(--page); font-size: 11px; }
.team-ui .reaction.selected { border-color: var(--violet); background: var(--violet-soft); }
.team-sheet-backdrop { position: fixed; z-index: 40; inset: 0; background: rgba(8, 13, 14, .52); backdrop-filter: blur(3px); }
.team-sheet { position: fixed; z-index: 41; left: 50%; bottom: 0; width: min(100%, 520px); max-height: min(91dvh, calc(var(--dnevio-screen-height) - var(--dnevio-safe-top))); overflow-y: auto; overscroll-behavior: contain; transform: translateX(-50%); padding: 8px 16px calc(22px + var(--dnevio-safe-bottom)); border-radius: 28px 28px 0 0; background: var(--page); box-shadow: 0 -20px 70px rgba(0, 0, 0, .22); -webkit-overflow-scrolling: touch; }
.team-sheet-handle { width: 40px; height: 4px; margin: 1px auto 7px; border-radius: 4px; background: var(--line); }
.team-sheet header { position: sticky; z-index: 2; top: -8px; display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; min-height: 48px; background: color-mix(in srgb, var(--page) 94%, transparent); backdrop-filter: blur(12px); }
.team-sheet h2 { margin: 0; text-align: center; font-size: 17px; }
.team-sheet header button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--surface); color: var(--text); font-size: 22px; }
.team-sheet-content { display: grid; gap: 10px; }
.team-sheet-content form { display: grid; gap: 12px; }
.team-sheet-content label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.team-sheet-content input[type="text"], .team-sheet-content input[type="number"], .team-sheet-content input[type="url"], .team-sheet-content input:not([type]), .team-sheet-content textarea { width: 100%; min-height: 48px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 14px; outline: 0; background: var(--surface); color: var(--text); font-size: 16px; }
.team-sheet-content input:focus, .team-sheet-content textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 2px color-mix(in srgb, var(--violet) 12%, transparent); }
.team-ui .toggle-row, .team-ui .choice-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 56px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.team-ui .toggle-row strong, .team-ui .choice-row strong { display: block; color: var(--text); font-size: 13px; }
.team-ui .toggle-row small, .team-ui .choice-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 11.5px; }
.team-ui .toggle-row input, .team-ui .choice-row input { width: 22px; height: 22px; margin: 0; accent-color: var(--violet); }
.team-ui .disabled-row { opacity: .62; }
.team-ui .goal-readonly { color: var(--violet-text); font-size: 14px; }
.team-ui .training-target { grid-template-columns: minmax(0, 1fr) 76px; align-items: center; min-height: 56px; margin: -5px 0 2px; padding: 8px 10px 8px 14px; border: 1px solid color-mix(in srgb, var(--violet) 28%, var(--line)); border-radius: 15px; background: color-mix(in srgb, var(--violet) 7%, var(--surface)); color: var(--text); font-size: 13px; font-weight: 650; }
.team-ui .training-target input[name="trainingTarget"] { min-height: 40px; padding: 6px 9px; text-align: center; font-size: 16px; font-weight: 750; }
.team-ui .switch-row, .team-ui .menu-row { width: 100%; min-height: 58px; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; padding: 9px 12px; border: 0; color: var(--text); text-align: left; }
.team-ui .switch-row span, .team-ui .menu-row span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 13px; background: var(--violet-soft); }
.team-ui .switch-row strong, .team-ui .menu-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.team-ui .switch-row small { color: var(--muted); font-size: 11px; }
.team-ui .menu-row i { color: var(--muted); font-style: normal; }
.team-ui .invite-qr { display: grid; justify-items: center; padding: 15px; border-radius: 20px; background: #fff; }
.team-ui .invite-qr img { width: min(62vw, 250px); height: auto; }
.team-ui .invite-code { text-align: center; font-size: 25px; letter-spacing: .14em; }
.team-ui .invite-link { overflow-wrap: anywhere; padding: 12px; border-radius: 14px; background: var(--surface); color: var(--muted); font-size: 11px; }
.team-ui .invite-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: color-mix(in srgb, var(--surface) 72%, var(--page)); }
.team-ui .invite-tabs button { min-height: 38px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 750; }
.team-ui .invite-tabs button.active { background: var(--surface); color: var(--violet-text); }
.team-ui .invite-panel { display: grid; gap: 8px; }
.team-ui .member-manage { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.team-ui .member-manage strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.team-ui .member-manage button { border: 0; background: transparent; color: var(--violet-text); font-size: 11.5px; font-weight: 750; }
.team-loading { position: absolute; z-index: 15; inset: 0; min-height: 360px; display: grid; place-content: center; justify-items: center; gap: 12px; background: var(--page); }
.team-loading p { margin: 0; color: var(--muted); font-size: 12px; }
.team-ui [hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { .team-ui * { scroll-behavior: auto !important; transition: none !important; } }
@media (max-width: 390px) { .team-ui .solo-team-card { grid-template-columns: 1fr; } .team-ui .solo-team-card button { width: 100%; } }
.team-invite-content { display: grid; gap: 16px; }
.team-invite-content .invite-panel { min-height: 244px; align-content: center; gap: 16px; }
.team-invite-content .invite-qr { justify-self: center; padding: 16px; }
.team-invite-content .invite-qr img { display: block; width: min(52vw, 210px); height: auto; }
.team-invite-content .invite-link { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin: 0; }
.team-invite-content .invite-caption { text-align: center; color: var(--muted); }
.team-invite-content .secondary { margin-top: 0; }
