:root {
  --app-bg: radial-gradient(circle at top left, rgba(81, 121, 193, .22), transparent 32%), radial-gradient(circle at top right, rgba(34, 187, 170, .18), transparent 26%), linear-gradient(180deg, #08101c 0%, #0c1523 54%, #09111c 100%);
  --app-panel: rgba(16, 28, 49, .86);
  --app-border: rgba(78, 101, 145, .42);
  --app-shadow: 0 18px 48px rgba(0, 0, 0, .28);
  --app-accent: #8db8ff;
  --app-muted: #91a5ca;
}

html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: var(--app-bg); color: var(--ui-text); font-family: var(--ui-font); }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; }

.login-shell { min-height: 100%; display: grid; place-items: center; padding: 24px; box-sizing: border-box; }
.login-card { width: min(440px, 100%); display: grid; gap: 18px; padding: 30px; border: 1px solid var(--app-border); border-radius: 22px; background: var(--app-panel); box-shadow: var(--app-shadow); }
.login-card .ui-title { margin: 0; font-size: 32px; }
.app-subtitle { margin: 0; color: var(--ui-muted); line-height: 1.5; }
.login-form { display: grid; gap: 10px; }
.login-form .ui-button { margin-top: 8px; justify-content: center; }
.form-error { margin: 0; color: #ffb4ab; }
.account-login { justify-content: center; text-decoration: none; }
.public-policy-links { position: fixed; z-index: 10000; right: 18px; bottom: 12px; display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 999px; background: rgba(8, 16, 28, .82); color: var(--app-muted); font-size: 12px; backdrop-filter: blur(12px); }
.public-policy-links a { color: #c8dcff; text-decoration: none; }
.public-policy-links a:hover, .public-policy-links a:focus-visible { color: #fff; text-decoration: underline; }
.syndicatum-account-menu-group > .ui-menu-group-heading { display: none; }
.syndicatum-account-menu-group + .syndicatum-account-menu-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--app-border); }

.app-shell { height: 100dvh; min-height: 0; min-width: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); box-sizing: border-box; overflow: hidden; }
.app-shell > .surface-chrome { grid-row: 1; }
.app-shell > .mobile-panel-switcher { grid-row: 2; }
.app-shell > .surface-host { grid-row: 3; }
.app-topbar, .mobile-panel-switcher, .app-column { backdrop-filter: blur(16px); box-shadow: var(--app-shadow); }
.app-topbar { display: grid; grid-template-columns: minmax(250px, 1fr) minmax(220px, 360px) auto; align-items: center; gap: 18px; padding: 16px 22px; border: 1px solid var(--app-border); border-radius: 20px; background: linear-gradient(135deg, rgba(13, 21, 35, .94), rgba(14, 31, 55, .9)); }
.app-brand { display: grid; gap: 4px; }
.app-brand .ui-title { margin: 0; font-size: clamp(26px, 3vw, 38px); line-height: 1; }
.app-brand .app-subtitle { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.project-switcher { min-width: 0; }
.legacy-mode .project-switcher { color: var(--app-accent); font-weight: 700; text-align: center; }
.app-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.current-user { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.current-user-name { max-width: 150px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 650; }

.mobile-panel-switcher { display: none; gap: 8px; padding: 10px; border: 1px solid var(--app-border); border-radius: 15px; background: rgba(10, 18, 31, .92); }
.mobile-panel-switcher .is-active { border-color: #5f84c9; background: rgba(33, 52, 84, .92); color: #eff5ff; }
.app-layout { min-height: 0; display: grid; grid-template-columns: minmax(260px, 310px) minmax(0, 1fr); gap: 14px; }
.app-column { min-height: 0; border: 1px solid var(--app-border); border-radius: 20px; background: linear-gradient(180deg, var(--app-panel), rgba(10, 18, 31, .9)); }
.app-column-left { overflow: auto; padding: 18px; }
.app-column-center { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; overflow: hidden; padding: 16px; }

.app-section { display: grid; gap: 12px; }
.app-section + .app-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(73, 93, 129, .35); }
.app-section-header, .message-card-header, .message-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.app-visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.app-panel-title { margin: 0; font-size: 22px; }
.project-description, .project-instructions { margin: 0; color: #bbcbe7; line-height: 1.55; white-space: pre-wrap; }
.project-instructions { padding: 12px; border: 1px solid rgba(95, 132, 201, .35); border-radius: 12px; background: rgba(34, 53, 85, .36); }

.participant-list { display: grid; gap: 8px; }
.participant-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px; }
.participant-card { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px; color: var(--ui-text); text-align: left; border: 1px solid transparent; border-radius: 12px; background: transparent; cursor: pointer; }
.participant-card:hover, .participant-card.is-active { border-color: rgba(104, 143, 211, .62); background: rgba(36, 57, 91, .65); }
.participant-edit { padding-inline: 8px; }
.ui-modal-footer .ui-dialog-footer-actions { width: 100%; }
.participant-card-copy { min-width: 0; display: grid; gap: 2px; }
.participant-card-copy strong, .participant-card-copy span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.participant-card-copy span { color: var(--app-muted); font-size: 12px; text-transform: capitalize; }

.participant-avatar { position: relative; flex: 0 0 auto; display: inline-grid; place-items: center; width: 40px; height: 40px; }
.participant-avatar.is-sm { width: 30px; height: 30px; }
.participant-avatar-fallback, .participant-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; }
.participant-avatar-fallback { display: grid; place-items: center; color: #08101c; font-size: 12px; font-weight: 800; }
.participant-avatar img { display: block; object-fit: cover; background: transparent; }
.participant-kind-mark { position: absolute; z-index: 1; right: -2px; bottom: -2px; display: grid; place-items: center; width: 16px; height: 16px; border: 2px solid #101c31; border-radius: 50%; color: #08101c; background: #c8ddff; font-size: 9px; font-weight: 900; }
.participant-kind-mark.is-agent-icon { font-size: 0; font-weight: 400; line-height: 1; }
.participant-kind-mark.is-agent-icon svg { display: block; width: 11px; height: 11px; }

.project-overview.timeline-project-overview { padding: 0 0 14px; border-bottom: 1px solid rgba(73, 93, 129, .35); }
.project-overview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0; }
.project-overview-heading h1 { min-width: 0; overflow-wrap: anywhere; }
.filter-bar { display: grid; grid-template-columns: minmax(190px, 1fr) auto; gap: 8px; align-items: center; padding: 10px 0 12px; border-top: 1px solid rgba(73, 93, 129, .3); border-bottom: 1px solid rgba(73, 93, 129, .3); }
.app-search, .app-search .ui-search-wrap, .sender-filter { min-width: 0; }
.app-search .ui-search-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.app-search .ui-search-clear { border: 1px solid var(--ui-border-strong); border-radius: var(--ui-radius-sm); background: rgba(30, 44, 70, .75); color: var(--ui-text); padding: 7px 9px; cursor: pointer; }
.filter-bar-actions { display: inline-flex; align-items: center; gap: 8px; }
.timeline-icon-action { display: inline-grid; place-items: center; width: 40px; min-width: 40px; height: 40px; padding: 0; }
.timeline-action-icon, .timeline-action-icon .ui-icon { display: block; width: 20px; height: 20px; }
.timeline-filter-trigger { position: relative; }
.timeline-filter-trigger.is-active { border-color: var(--ui-accent); background: color-mix(in srgb, var(--ui-accent) 16%, transparent); }
.timeline-filter-count { position: absolute; top: -7px; right: -7px; min-width: 20px; padding: 2px 5px; font-size: 10px; line-height: 1; }
.syndicatum-filter-popover { width: min(440px, calc(100vw - 16px)); }
.timeline-filter-panel { display: grid; gap: 16px; width: min(400px, calc(100vw - 48px)); }
.timeline-filter-section { display: grid; gap: 8px; min-width: 0; }
.timeline-filter-label { color: var(--app-muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.timeline-filter-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.timeline-filter-dates label { display: grid; gap: 5px; color: var(--app-muted); font-size: 12px; }
.date-filter { width: 100%; min-width: 0; box-sizing: border-box; }
.timeline-filter-actions { display: flex; justify-content: flex-end; min-height: 32px; padding-top: 4px; border-top: 1px solid rgba(73, 93, 129, .35); }
.timeline-notice { margin-top: 10px; padding: 9px 12px; border: 1px solid rgba(224, 169, 77, .4); border-radius: 10px; color: #ffe0a8; background: rgba(100, 67, 18, .3); }
.timeline-scroll { min-height: 0; overflow: hidden; margin: 0 -5px; padding: 8px 5px 4px; box-sizing: border-box; }
#timeline-host { height: 100%; min-height: 0; }
#timeline-host .ui-timeline { gap: 12px; }
#timeline-host .ui-timeline-group-label { position: sticky; top: 0; z-index: 3; margin-bottom: 8px; padding: 8px 11px; border: 1px solid rgba(74, 97, 138, .3); border-radius: 11px; background: rgba(10, 18, 31, .96); }
#timeline-host .ui-timeline-body { background: linear-gradient(180deg, rgba(20, 30, 48, .94), rgba(19, 33, 56, .82)); transition: border-color 140ms ease, box-shadow 140ms ease; }
#timeline-host .ui-timeline-item.is-addressed .ui-timeline-body { border-color: rgba(230, 175, 83, .56); box-shadow: inset 3px 0 rgba(230, 175, 83, .72); }
.expanded-mode #timeline-host .ui-timeline-header,
.expanded-mode #timeline-host .ui-timeline-description,
.expanded-mode #timeline-host .ui-timeline-subtitle,
.expanded-mode #timeline-host .ui-timeline-meta,
.legacy-mode #timeline-host .ui-timeline-header,
.legacy-mode #timeline-host .ui-timeline-description,
.legacy-mode #timeline-host .ui-timeline-subtitle,
.legacy-mode #timeline-host .ui-timeline-meta { display: none; }
.ui-timeline-custom-content { display: grid; gap: 11px; }
.message-card-header { align-items: flex-start; }
.message-identity { min-width: 0; flex: 1; display: grid; gap: 7px; }
.message-identity-line { min-width: 0; display: flex; align-items: center; gap: 8px; }
.message-card-header time { color: var(--app-muted); font-size: 12px; white-space: nowrap; }
.participant-kind { padding: 2px 7px; border-radius: 999px; color: #b8d3ff; background: rgba(58, 90, 143, .48); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.participant-kind.is-human { color: #aeeade; background: rgba(28, 103, 90, .46); }
.message-reply-preview { width: 100%; padding: 8px 10px; overflow: hidden; color: #a9bfdf; text-align: left; text-overflow: ellipsis; white-space: nowrap; border: 0; border-left: 3px solid #6e94d7; border-radius: 6px; background: rgba(14, 24, 40, .72); cursor: pointer; }
.message-card-body { margin: 0; color: #e3edfc; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-card-body a { color: #9fc4ff; }
.message-card-footer { align-items: flex-end; flex-wrap: wrap; }
.addressee-chips, .message-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.addressee-chip { display: inline-flex; padding: 3px 8px; border: 1px solid rgba(210, 159, 75, .36); border-radius: 999px; color: #ffd794; background: rgba(105, 69, 15, .28); font-size: 11px; }
.addressee-chip.is-acknowledged { border-color: rgba(73, 166, 143, .4); color: #a8e8d8; background: rgba(22, 92, 76, .3); }
.addressee-chip.is-broadcast { border-color: rgba(107, 135, 188, .42); color: #c8d9fb; background: rgba(41, 61, 101, .34); }
.message-action { min-height: auto; padding: 3px 6px; color: var(--app-accent); }
.revision-label { color: var(--app-muted); font-size: 11px; }

.composer-shell { display: grid; width: 100%; max-width: 100%; min-width: 0; gap: 8px; margin-bottom: 12px; padding: 10px 0 12px; overflow: hidden; border-top: 1px solid rgba(73, 93, 129, .35); border-bottom: 1px solid rgba(73, 93, 129, .35); box-sizing: border-box; }
.composer-shell > *, .addressing-row > *, #address-mode, #addressee-select, #composer-host { min-width: 0; max-width: 100%; }
.addressing-row { display: grid; width: 100%; min-width: 0; grid-template-columns: minmax(160px, 220px) minmax(220px, 1fr); gap: 8px; align-items: center; }
.broadcast-warning { grid-column: 2; margin: 0; color: #ffd795; font-size: 12px; }
.reply-context { display: flex; width: 100%; max-width: 100%; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; overflow: hidden; color: #bcd0ed; border-left: 3px solid #6e94d7; background: rgba(25, 43, 70, .48); box-sizing: border-box; }
.reply-context-copy { display: block; flex: 1 1 0; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.reply-context .ui-button { flex: 0 0 auto; }
#composer-host .ui-chat-composer-controls { align-items: flex-end; }
#composer-host .ui-chat-composer-input { max-height: 160px; }

.ui-form-modal-text { color: var(--app-accent); font-weight: 750; }
.agent-credential-copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.agent-credential-copy-text { min-width: 0; overflow-wrap: anywhere; }
.agent-credential-copy-action { align-self: center; padding: 7px; }
.agent-credential-copy-action svg { display: block; }

.syndicatum-login-modal .ui-form-modal-branding {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 168px;
  border: 0;
  background: transparent;
}

.syndicatum-login-modal .ui-form-modal-branding::after {
  background: transparent;
}

.syndicatum-login-modal .ui-form-modal-branding-content {
  min-height: 168px;
}

.syndicatum-login-modal .ui-form-modal-branding-media {
  width: min(160px, 48vw);
  max-width: 160px;
  border-radius: 0;
  box-shadow: none;
}

.syndicatum-login-modal .ui-form-modal-text {
  text-align: center;
}
.fatal-error { margin: 10vh auto; width: min(640px, calc(100% - 40px)); padding: 24px; color: #f5d7d3; border: 1px solid #854f4a; border-radius: 16px; background: #321d22; }

.surface-chrome, .surface-host, .two-column-surface, .surface-column { min-width: 0; min-height: 0; }
.surface-chrome { overflow-x: auto; overflow-y: hidden; border-bottom: 1px solid var(--app-border); background: rgba(10, 18, 31, .97); scrollbar-width: thin; }
.helper-nav-host { min-width: max-content; }
.syndicatum-navbar-single-row, .syndicatum-navbar-single-row .ui-navbar { flex-wrap: nowrap !important; white-space: nowrap; }
.syndicatum-navbar-single-row .ui-navbar-brand-media { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 0; background: transparent; }
.syndicatum-navbar-single-row .syndicatum-brand-icon { display: block; width: 48px; height: 48px; object-fit: contain; }
.syndicatum-navbar-single-row .ui-nav-icon { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; }
.syndicatum-navbar-single-row .ui-nav-icon svg { width: 32px; height: 32px; fill: none; stroke: currentColor; }
.syndicatum-navbar-single-row .ui-navbar-item.ui-button-borderless.is-active { background: color-mix(in srgb, var(--ui-accent) 16%, transparent); color: var(--ui-text); }
.syndicatum-navbar-single-row .ui-navbar-item.ui-button-borderless.is-active .ui-nav-icon,
.syndicatum-navbar-single-row .ui-navbar-item.ui-button-borderless.is-active .ui-nav-label { color: #e0faff; }
.syndicatum-navbar-single-row .ui-navbar-action:has(.navbar-account-avatar) .ui-nav-content,
.syndicatum-navbar-single-row .ui-navbar-action:has(.navbar-account-avatar) .ui-nav-icon { width: 48px; height: 48px; flex: 0 0 48px; display: inline-grid; place-items: center; gap: 0; line-height: 0; }
.syndicatum-navbar-single-row .ui-navbar-action.is-icon-only:has(.navbar-account-avatar) { display: inline-grid; place-items: center; width: 48px; min-width: 48px; height: 48px; padding: 0; border-radius: 12px; line-height: 1; }
.syndicatum-navbar-single-row .navbar-account-avatar { width: 48px; min-width: 48px; max-width: 48px; height: 48px; min-height: 48px; max-height: 48px; border-radius: 999px; display: inline-grid; place-items: center; object-fit: cover; color: var(--ui-text); border: 1px solid color-mix(in srgb, var(--app-accent) 36%, var(--app-border)); font-size: 13px; font-weight: 700; line-height: 1; }
.surface-host { display: grid; grid-template-rows: minmax(0, 1fr); overflow: hidden; padding: 12px; }
.two-column-surface { min-height: 0; display: grid; grid-template-columns: minmax(280px, 330px) minmax(0, 1fr); gap: 12px; align-self: stretch; }
.surface-column { border: 1px solid var(--app-border); border-radius: 18px; background: linear-gradient(180deg, var(--app-panel), rgba(10, 18, 31, .9)); box-shadow: var(--app-shadow); }
.workspace-profile-column, .workspace-projects-column, .project-participants-column { overflow: auto; padding: 18px; box-sizing: border-box; }
.project-messages-column { display: grid; grid-template-rows: auto auto auto auto minmax(0, 1fr); overflow: hidden; padding: 16px; box-sizing: border-box; }
.project-messages-column > .timeline-project-overview { grid-row: 1; }
.project-messages-column > .composer-shell { grid-row: 2; }
.project-messages-column > .filter-bar { grid-row: 3; }
.project-messages-column > .timeline-notice { grid-row: 4; }
.project-messages-column > .timeline-scroll { grid-row: 5; }
.workspace-profile-column { display: grid; align-content: start; gap: 14px; }
.identity-card, .workspace-card, .project-overview { padding: 18px; }
.identity-card { display: grid; gap: 14px; }
.identity-card h1, .workspace-card h2, .project-overview h1, .surface-heading h1, .surface-heading h2 { margin: 0; }
.identity-card > div:first-child .participant-avatar { width: 72px; height: 72px; }
.profile-details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 14px; margin: 0; font-size: 14px; }
.profile-details dt { color: var(--app-muted); }
.profile-details dd { margin: 0; overflow-wrap: anywhere; }
.surface-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.surface-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.surface-heading.compact { margin-top: 20px; }
.project-search { margin-bottom: 14px; }
.project-list, .admin-list { display: grid; gap: 10px; }
.project-card { width: 100%; display: grid; gap: 9px; padding: 15px; color: inherit; text-align: left; cursor: pointer; }
.project-card:hover { border-color: rgba(104, 143, 211, .75); transform: translateY(-1px); }
.project-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 17px; }
.project-card-description { color: #c0cee5; line-height: 1.45; }
.project-card-meta { color: var(--app-muted); font-size: 12px; }
.empty-state { padding: 18px; color: var(--app-muted); }
.project-overview { display: grid; gap: 12px; }
.participant-section { padding: 0 2px 16px; }
.admin-surface { min-height: 0; overflow: auto; padding: 20px; box-sizing: border-box; align-self: stretch; border: 1px solid var(--app-border); border-radius: 18px; background: var(--app-panel); box-shadow: var(--app-shadow); }
.admin-card { display: grid; gap: 7px; padding: 15px; }
.admin-card p { margin: 0; color: var(--app-muted); line-height: 1.5; overflow-wrap: anywhere; }
.connection-actions { display: flex; align-items: center; gap: 8px; }
.connection-label { color: var(--app-muted); font-size: 12px; }

/* Pre-approved Android/Web dark Sign in with Google artwork supplied by Google. */
.syndicatum-google-button {
  width: 164px;
  height: 36.444px;
  padding: 0 !important;
  overflow: visible;
  border: 0 !important;
  background: transparent !important;
}
.syndicatum-google-button .ui-action-modal-button-content,
.syndicatum-google-button .ui-action-modal-button-icon,
.syndicatum-google-button-image { display: block; width: 164px; height: 36.444px; }
.syndicatum-google-button .ui-action-modal-button-icon {
  flex: 0 0 164px;
  overflow: visible;
}
.syndicatum-google-button .ui-action-modal-button-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.syndicatum-google-button:hover { opacity: .92; }

@media (max-width: 1180px) {
  .app-topbar { grid-template-columns: minmax(220px, 1fr) minmax(220px, 320px); }
  .app-toolbar { grid-column: 1 / -1; }
}

@media (max-width: 980px) {
  .app-shell { padding: 0; gap: 0; }
  .app-topbar { grid-template-columns: 1fr; padding: 14px; border-radius: 16px; }
  .app-toolbar { grid-column: auto; }
  .mobile-panel-switcher { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 8px 10px 0; }
  .surface-host { padding: 10px; }
  .two-column-surface { grid-template-columns: minmax(0, 1fr); }
  .surface-column { display: none; border-radius: 16px; }
  .surface-column.is-mobile-active { display: block; }
  .project-messages-column.is-mobile-active { display: grid; }
}

@media (max-width: 640px) {
  .app-brand .app-subtitle, .current-user-name { display: none; }
  .app-toolbar { justify-content: stretch; }
  .app-toolbar .ui-button { flex: 1; justify-content: center; }
  .filter-bar { grid-template-columns: minmax(0, 1fr) auto; }
  .timeline-filter-dates { grid-template-columns: 1fr; }
  .addressing-row { grid-template-columns: 1fr; }
  .broadcast-warning { grid-column: 1; }
  .message-card-header time { white-space: normal; text-align: right; }
  .message-card-footer { align-items: stretch; }
  .message-actions { width: 100%; justify-content: flex-end; }
}
