/* Geist admin surface — presentation only; account, option and owner-link data stay intact. */
@media (min-width: 769px) {
  body:has(#adminView.active) {
    --bg: var(--geist-canvas);
    --surface: var(--geist-elevated);
    --surface-2: var(--geist-soft);
    --surface-3: #ededed;
    --text: var(--geist-ink);
    --muted: var(--geist-mute);
    --near: var(--geist-body);
    --accent: var(--geist-accent);
    --border: var(--geist-hairline);
    background: var(--geist-canvas);
    color: var(--geist-ink);
    font-family: "Geist", "Inter", Arial, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  }

  body:has(#adminView.active) .app-shell {
    grid-template-columns: 232px minmax(0, 1fr);
    background: var(--geist-canvas);
  }

  body:has(#adminView.active) .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid var(--geist-hairline);
    background: var(--geist-elevated);
    padding: 24px 14px 18px;
  }

  body:has(#adminView.active) .brand {
    padding: 0 8px 26px;
  }

  body:has(#adminView.active) .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--geist-accent);
    color: var(--geist-ink);
    font-size: 14px;
    box-shadow: none;
  }

  body:has(#adminView.active) .brand strong {
    color: var(--geist-ink);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.2px;
  }

  body:has(#adminView.active) .brand span {
    color: var(--geist-mute);
    font-family: "Geist Mono", monospace;
    font-size: 9px;
  }

  body:has(#adminView.active) .nav {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  body:has(#adminView.active) .nav-item {
    justify-content: flex-start;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--geist-body);
    padding: 9px 10px;
    font-size: 13px;
    font-weight: 500;
  }

  body:has(#adminView.active) .nav-item:hover {
    border-color: var(--geist-hairline);
    background: var(--geist-canvas);
    color: var(--geist-ink);
  }

  body:has(#adminView.active) .nav-item.active {
    border-color: var(--geist-hairline);
    background: var(--geist-soft);
    color: var(--geist-ink);
  }

  body:has(#adminView.active) .nav-item.active::before {
    display: none;
  }

  body:has(#adminView.active) .nav-icon,
  body:has(#adminView.active) .nav-item:hover .nav-icon {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
    color: currentColor;
  }

  body:has(#adminView.active) .nav-icon svg {
    width: 19px;
    height: 19px;
    stroke-width: 1.65;
  }

  body:has(#adminView.active) .sidebar-note {
    margin-top: 22px;
    border: 1px solid var(--geist-hairline);
    border-radius: 12px;
    background: var(--geist-canvas);
    padding: 14px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.03);
  }

  body:has(#adminView.active) .sidebar-note span,
  body:has(#adminView.active) .eyebrow {
    color: var(--geist-mute);
    font-family: "Geist Mono", "IBM Plex Mono", monospace;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.04em;
  }

  body:has(#adminView.active) .sidebar-note strong {
    color: var(--geist-body);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
  }

  body:has(#adminView.active) .sidebar-account {
    border-color: var(--geist-hairline);
  }

  body:has(#adminView.active) .sidebar-account-avatar {
    border: 1px solid var(--geist-hairline);
    background: var(--geist-elevated);
    color: var(--geist-ink);
  }

  body:has(#adminView.active) .sidebar-account strong {
    color: var(--geist-ink);
    font-weight: 600;
  }

  body:has(#adminView.active) .sidebar-account span,
  body:has(#adminView.active) .sidebar-account-toggle {
    color: var(--geist-mute);
  }

  body:has(#adminView.active) .main {
    min-width: 0;
    padding: 0 32px 64px;
    background: var(--geist-canvas);
  }

  body:has(#adminView.active) .topbar {
    width: min(1200px, 100%);
    min-height: 80px;
    margin: 0 auto 24px;
    border-bottom: 1px solid var(--geist-hairline);
    padding: 18px 0;
  }

  body:has(#adminView.active) .topbar h1 {
    color: var(--geist-ink);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.8px;
  }

  body:has(#adminView.active) .topbar .pill.primary {
    min-height: 40px;
    border-radius: 6px;
    background: var(--geist-accent);
    color: #06140a;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
  }

  body:has(#adminView.active) .topbar .web-notification-button {
    width: 40px;
    height: 40px;
    min-height: 40px;
    border: 1px solid var(--geist-hairline);
    border-radius: 6px;
    background: var(--geist-elevated);
    color: var(--geist-ink);
    box-shadow: none;
  }

  #adminView {
    width: min(1200px, 100%);
    margin-inline: auto;
    color: var(--geist-ink);
  }

  #adminView .admin-panel {
    overflow: hidden;
    min-height: 560px;
    border: 1px solid var(--geist-hairline);
    border-radius: 12px;
    background: var(--geist-elevated);
    padding: 0;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.035);
  }

  #adminView .admin-content,
  #adminView .admin-content.open {
    display: block;
    margin: 0;
  }

  #adminView .admin-hub-head {
    min-height: 112px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid var(--geist-hairline);
    padding: 22px 24px;
  }

  #adminView .admin-hub-copy {
    display: grid;
    gap: 3px;
  }

  #adminView .admin-hub-copy .eyebrow {
    margin: 0 0 2px;
    text-transform: uppercase;
  }

  #adminView .admin-hub-copy h2 {
    margin: 0;
    color: var(--geist-ink);
    font-size: 24px;
    font-weight: 600;
    line-height: 32px;
    letter-spacing: -0.8px;
  }

  #adminView .admin-hub-copy > span {
    color: var(--geist-mute);
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
  }

  #adminView .admin-hub-head nav {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 4px;
    border: 1px solid var(--geist-hairline);
    border-radius: 8px;
    background: var(--geist-canvas);
    padding: 4px;
  }

  #adminView .admin-hub-head nav button {
    min-height: 36px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--geist-mute);
    padding: 0 13px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: none;
  }

  #adminView .admin-hub-head nav button:hover {
    color: var(--geist-ink);
  }

  #adminView .admin-hub-head nav button.active {
    border-color: var(--geist-hairline);
    background: var(--geist-elevated);
    color: var(--geist-ink);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  }

  #adminView .admin-dropdown-grid,
  #adminView .admin-member-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    background: var(--geist-canvas);
    padding: 16px;
  }

  #adminView .admin-member-grid .owner-link-manager,
  #adminView .admin-member-grid .account-manager {
    grid-column: 1 / -1;
  }

  #adminView .option-manager {
    display: grid;
    align-content: start;
    gap: 14px;
    min-width: 0;
    border: 1px solid var(--geist-hairline);
    border-radius: 10px;
    background: var(--geist-elevated);
    padding: 18px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.025);
  }

  #adminView .admin-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  #adminView .admin-card-head > div {
    display: grid;
    gap: 2px;
  }

  #adminView .admin-card-head .eyebrow {
    margin: 0;
    text-transform: uppercase;
  }

  #adminView .admin-card-head h3,
  #adminView .option-manager > div:first-child h3 {
    margin: 0;
    color: var(--geist-ink);
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    letter-spacing: -0.35px;
  }

  #adminView .admin-card-head > span {
    display: inline-grid;
    min-height: 24px;
    place-items: center;
    border: 1px solid var(--geist-hairline);
    border-radius: 999px;
    background: var(--geist-canvas);
    color: var(--geist-mute);
    padding: 0 8px;
    font-family: "Geist Mono", monospace;
    font-size: 9px;
    font-weight: 500;
  }

  #adminView .option-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }

  #adminView input,
  #adminView select {
    min-width: 0;
    min-height: 40px;
    border: 1px solid var(--geist-hairline);
    border-radius: 6px;
    background-color: var(--geist-elevated);
    color: var(--geist-ink);
    padding: 0 11px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 400;
    outline: none;
    box-shadow: none;
  }

  #adminView select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%234d4d4d' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: right 9px center;
    background-repeat: no-repeat;
    background-size: 15px;
    padding-right: 30px;
  }

  #adminView input::placeholder {
    color: var(--geist-faint);
  }

  #adminView input:focus,
  #adminView select:focus {
    border-color: var(--geist-accent);
    box-shadow: 0 0 0 3px rgba(0, 237, 100, 0.1);
  }

  #adminView .option-form .pill.primary,
  #adminView [data-save-owner-links] {
    min-height: 40px;
    border: 1px solid var(--geist-accent);
    border-radius: 6px;
    background: var(--geist-accent);
    color: #06140a;
    padding: 0 13px;
    font-size: 11px;
    font-weight: 600;
    text-transform: none;
    box-shadow: none;
  }

  #adminView .option-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  #adminView .admin-chip {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto 28px;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--geist-hairline);
    border-radius: 6px;
    background: var(--geist-elevated);
    color: var(--geist-ink);
    padding: 5px 6px;
    font-size: 11px;
    font-weight: 500;
    cursor: grab;
  }

  #adminView .admin-chip:has(.admin-option-color) {
    grid-template-columns: 20px 28px minmax(0, 1fr) auto 28px;
  }

  #adminView .admin-chip .admin-option-color {
    width: 28px;
    min-width: 28px;
    padding: 3px;
  }

  #adminView .admin-chip .admin-option-color > i {
    width: 18px;
    height: 18px;
  }

  #adminView .admin-chip:active {
    cursor: grabbing;
  }

  #adminView .drag-handle {
    color: var(--geist-faint);
    font-size: 11px;
    font-style: normal;
    text-align: center;
  }

  #adminView .admin-option-input,
  #adminView .admin-option-input[readonly] {
    min-height: 30px;
    border-color: transparent;
    background: transparent;
    padding: 0 4px;
    font-size: 11px;
    font-weight: 500;
  }

  #adminView .admin-option-input:not([readonly]) {
    border-color: var(--geist-accent);
    background: var(--geist-elevated);
  }

  #adminView .admin-chip button {
    width: auto;
    height: 28px;
    min-height: 28px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--geist-hairline);
    border-radius: 5px;
    background: var(--geist-elevated);
    color: var(--geist-body);
    padding: 0 8px;
    font-size: 9px;
    font-weight: 600;
    box-shadow: none;
  }

  #adminView .admin-chip [data-edit-option] {
    width: auto;
    height: 28px;
    border-radius: 5px;
    background: var(--geist-elevated);
    color: var(--geist-body);
    padding: 0 8px;
    font-size: 9px;
  }

  #adminView .admin-chip [data-delete-option] {
    width: 28px;
    padding: 0;
    border-color: #ffd4d4;
    background: #fff3f3;
    color: #c50000;
    font-size: 15px;
  }

  #adminView .owner-link-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
  }

  #adminView .owner-link-actions small {
    color: var(--geist-mute);
    font-size: 10px;
    font-weight: 400;
  }

  #adminView .owner-link-table {
    display: grid;
    gap: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--geist-hairline);
    border-radius: 8px;
  }

  #adminView .owner-link-head,
  #adminView .owner-link-row {
    display: grid;
    grid-template-columns: 1fr 1fr 0.8fr 1.2fr;
    gap: 10px;
    align-items: center;
    min-height: 46px;
    border-bottom: 1px solid var(--geist-hairline);
    padding: 0 12px;
  }

  #adminView .owner-link-head {
    background: var(--geist-canvas);
    color: var(--geist-mute);
    font-family: "Geist Mono", monospace;
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
  }

  #adminView .owner-link-row {
    border-radius: 0;
    background: var(--geist-elevated);
    color: var(--geist-body);
    font-size: 11px;
  }

  #adminView .owner-link-row:last-child {
    border-bottom: 0;
  }

  #adminView .owner-link-row.is-dirty {
    background: var(--geist-accent-soft);
    box-shadow: inset 3px 0 0 var(--geist-accent);
  }

  #adminView .owner-link-row strong {
    color: var(--geist-ink);
    font-weight: 600;
  }

  #adminView .owner-link-row select {
    min-height: 34px;
  }

  #adminView .owner-link-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--geist-mute);
    font-size: 10px;
    font-weight: 500;
  }

  #adminView .owner-link-state i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--geist-faint);
  }

  #adminView .owner-link-state.connected {
    color: #087231;
  }

  #adminView .owner-link-state.connected i {
    background: var(--geist-accent);
  }

  #adminView .owner-link-state.inactive {
    color: #c50000;
  }

  #adminView .owner-link-state.inactive i {
    background: #ee0000;
  }

  #adminView [data-save-owner-links].attention {
    box-shadow: 0 0 0 3px rgba(0, 237, 100, 0.16);
  }

  #adminView .account-list {
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--geist-hairline);
    border-radius: 8px;
  }

  #adminView .account-row {
    min-height: 72px;
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--geist-hairline);
    border-radius: 0;
    background: var(--geist-elevated);
    padding: 12px;
  }

  #adminView .account-row:last-child {
    border-bottom: 0;
  }

  #adminView .account-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
  }

  #adminView .account-name-line {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  #adminView .account-name-line strong {
    overflow: hidden;
    color: var(--geist-ink);
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #adminView .account-copy small {
    margin: 0;
    overflow: hidden;
    color: var(--geist-mute);
    font-size: 10px;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #adminView .account-status {
    display: inline-grid;
    min-height: 22px;
    place-items: center;
    border: 1px solid var(--geist-hairline);
    border-radius: 999px;
    background: var(--geist-canvas);
    color: var(--geist-body);
    padding: 0 7px;
    font-size: 9px;
    font-weight: 600;
  }

  #adminView .account-status.admin,
  #adminView .account-status.active {
    border-color: rgba(0, 237, 100, 0.28);
    background: var(--geist-accent-soft);
    color: #087231;
  }

  #adminView .account-status.pending {
    border-color: #ffe0ae;
    background: #fff8e8;
    color: #9a5b00;
  }

  #adminView .account-status.inactive {
    border-color: #ffd4d4;
    background: #fff3f3;
    color: #c50000;
  }

  #adminView .account-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    flex-wrap: wrap;
  }

  #adminView .account-position {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--geist-mute);
    font-size: 9px;
    font-weight: 500;
  }

  #adminView .account-position select {
    min-height: 34px;
  }

  #adminView .role-chip,
  #adminView .account-actions .delete-btn {
    min-height: 34px;
    border: 1px solid var(--geist-hairline);
    border-radius: 6px;
    background: var(--geist-elevated);
    color: var(--geist-body);
    padding: 0 9px;
    font-size: 10px;
    font-weight: 600;
    box-shadow: none;
  }

  #adminView .role-chip.active {
    border-color: var(--geist-ink);
    background: var(--geist-ink);
    color: #ffffff;
  }

  #adminView .role-chip[data-set-role="admin"].active {
    border-color: var(--geist-accent);
    background: var(--geist-accent);
    color: #06140a;
  }

  #adminView .role-chip[data-mark-pending].active {
    border-color: #f5a623;
    background: #fff8e8;
    color: #9a5b00;
  }

  #adminView .account-actions .delete-btn {
    width: 34px;
    padding: 0;
    border-color: #ffd4d4;
    background: #fff3f3;
    color: #c50000;
    font-size: 16px;
  }

  #adminView .account-actions .delete-btn:disabled {
    border-color: var(--geist-hairline);
    background: var(--geist-soft);
    color: var(--geist-faint);
  }

  #adminView button:focus-visible,
  #adminView input:focus-visible,
  #adminView select:focus-visible,
  body:has(#adminView.active) .nav-item:focus-visible,
  body:has(#adminView.active) .topbar button:focus-visible {
    outline: 2px solid rgba(0, 237, 100, 0.48);
    outline-offset: 1px;
  }

  #adminView .empty {
    min-height: 240px;
    display: grid;
    place-items: center;
    color: var(--geist-mute);
    font-size: 12px;
    font-weight: 400;
  }
}

@media (min-width: 769px) and (max-width: 1100px) {
  #adminView .admin-dropdown-grid,
  #adminView .admin-member-grid {
    grid-template-columns: 1fr;
  }

  #adminView .option-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #adminView .account-row {
    grid-template-columns: 1fr;
  }

  #adminView .account-actions {
    justify-content: flex-start;
  }
}

@media (min-width: 769px) {
  #adminView .admin-hub-head nav {
    grid-template-columns: repeat(3, auto);
  }

  #adminView .telegram-digest-manager {
    background: var(--geist-canvas);
    color: var(--geist-ink);
  }

  #adminView .telegram-manager-hero {
    min-height: 104px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid var(--geist-hairline);
    background: var(--geist-elevated);
    padding: 18px 24px;
  }

  #adminView .telegram-manager-hero > div:first-child {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  #adminView .telegram-logo {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #229ed9;
    color: #fff;
    font-size: 19px;
    transform: rotate(-24deg);
  }

  #adminView .telegram-manager-hero h3,
  #adminView .telegram-setting-card h4 {
    margin: 0;
    color: var(--geist-ink);
  }

  #adminView .telegram-manager-hero h3 {
    font-size: 18px;
    line-height: 26px;
    letter-spacing: -0.4px;
  }

  #adminView .telegram-manager-hero p {
    margin: 0 0 1px;
  }

  #adminView .telegram-manager-hero small,
  #adminView .telegram-setting-card header small,
  #adminView .telegram-message-card > small,
  #adminView .telegram-manager-actions > span {
    color: var(--geist-mute);
    font-size: 10px;
    line-height: 16px;
  }

  #adminView .telegram-runtime-status {
    display: grid;
    justify-items: end;
    gap: 5px;
  }

  #adminView .telegram-runtime-status > small {
    color: var(--geist-mute);
    font-size: 9px;
  }

  #adminView .telegram-connection {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    border: 1px solid var(--geist-hairline);
    border-radius: 999px;
    background: var(--geist-canvas);
    color: var(--geist-body);
    padding: 0 10px;
    font-size: 9px;
    font-weight: 600;
  }

  #adminView .telegram-connection i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--geist-faint);
  }

  #adminView .telegram-connection.connected {
    border-color: rgba(0, 237, 100, 0.28);
    background: var(--geist-accent-soft);
    color: #087231;
  }

  #adminView .telegram-connection.connected i {
    background: var(--geist-accent);
  }

  #adminView .telegram-connection.warning {
    border-color: #ffe0ae;
    background: #fff8e8;
    color: #9a5b00;
  }

  #adminView .telegram-connection.warning i {
    background: #f5a623;
  }

  #adminView .telegram-connection.error {
    border-color: #ffd4d4;
    background: #fff3f3;
    color: #c50000;
  }

  #adminView .telegram-connection.error i {
    background: #ee0000;
  }

  #adminView .telegram-connection.checking i {
    animation: telegram-pulse 1s ease-in-out infinite;
  }

  #adminView .telegram-manager-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 12px;
    padding: 16px;
  }

  #adminView .telegram-setting-card {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 16px;
    border: 1px solid var(--geist-hairline);
    border-radius: 10px;
    background: var(--geist-elevated);
    padding: 18px;
  }

  #adminView .telegram-setting-card > header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
  }

  #adminView .telegram-setting-card > header > span {
    width: 24px;
    height: 24px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: var(--geist-ink);
    color: var(--geist-elevated);
    font-family: "Geist Mono", monospace;
    font-size: 9px;
  }

  #adminView .telegram-setting-card h4 {
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -0.25px;
  }

  #adminView .telegram-setting-card header div {
    display: grid;
    gap: 2px;
  }

  #adminView .telegram-delivery-modes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #adminView .telegram-delivery-modes > label {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--geist-hairline);
    border-radius: 8px;
    background: var(--geist-canvas);
    padding: 12px;
    cursor: pointer;
  }

  #adminView .telegram-delivery-modes > label.active {
    border-color: var(--geist-accent);
    background: var(--geist-accent-soft);
    box-shadow: inset 0 0 0 1px var(--geist-accent);
  }

  #adminView .telegram-delivery-modes input {
    width: 16px;
    min-width: 16px;
    min-height: 16px;
    accent-color: var(--geist-accent);
  }

  #adminView .telegram-delivery-modes span {
    display: grid;
    gap: 3px;
  }

  #adminView .telegram-delivery-modes b,
  #adminView .telegram-time-field > span,
  #adminView .telegram-category-list b {
    color: var(--geist-ink);
    font-size: 11px;
    font-weight: 600;
  }

  #adminView .telegram-delivery-modes small,
  #adminView .telegram-time-field small,
  #adminView .telegram-category-list small {
    color: var(--geist-mute);
    font-size: 9px;
    line-height: 14px;
  }

  #adminView .telegram-time-field {
    display: grid;
    grid-template-columns: auto minmax(130px, 180px);
    align-items: center;
    gap: 8px 14px;
    border-top: 1px solid var(--geist-hairline);
    padding-top: 14px;
    opacity: 0.52;
  }

  #adminView .telegram-time-field.enabled {
    opacity: 1;
  }

  #adminView .telegram-time-field small {
    grid-column: 1 / -1;
  }

  #adminView .telegram-category-card {
    grid-row: span 2;
  }

  #adminView .telegram-category-list {
    display: grid;
    gap: 6px;
  }

  #adminView .telegram-category-list > label {
    min-height: 54px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--geist-hairline);
    border-radius: 7px;
    background: var(--geist-canvas);
    padding: 8px 10px;
    cursor: pointer;
  }

  #adminView .telegram-category-list > label:has(input:checked) {
    border-color: rgba(0, 237, 100, 0.44);
    background: var(--geist-accent-soft);
  }

  #adminView .telegram-category-list input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }

  #adminView .telegram-category-list > label > i {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border: 1px solid var(--geist-hairline);
    border-radius: 5px;
    background: var(--geist-elevated);
  }

  #adminView .telegram-category-list input:checked + i {
    border-color: var(--geist-accent);
    background: var(--geist-accent);
  }

  #adminView .telegram-category-list input:checked + i::after {
    content: "✓";
    color: #06140a;
    font-size: 11px;
    font-weight: 700;
  }

  #adminView .telegram-category-list span {
    display: grid;
    gap: 1px;
  }

  #adminView .telegram-category-list em {
    min-width: 26px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 1px solid var(--geist-hairline);
    border-radius: 999px;
    background: var(--geist-elevated);
    color: var(--geist-mute);
    padding: 0 7px;
    font-family: "Geist Mono", monospace;
    font-size: 9px;
    font-style: normal;
  }

  #adminView .telegram-message-card textarea {
    width: 100%;
    min-height: 150px;
    resize: vertical;
    border: 1px solid var(--geist-hairline);
    border-radius: 7px;
    background: var(--geist-canvas);
    color: var(--geist-ink);
    padding: 12px;
    font-family: inherit;
    font-size: 11px;
    line-height: 18px;
    outline: none;
  }

  #adminView .telegram-message-card textarea:focus {
    border-color: var(--geist-accent);
    box-shadow: 0 0 0 3px rgba(0, 237, 100, 0.1);
  }

  #adminView .telegram-preview-card {
    min-height: 280px;
  }

  #adminView .telegram-preview-empty {
    min-height: 176px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    overflow: auto;
    border: 1px dashed var(--geist-hairline);
    border-radius: 8px;
    background: var(--geist-canvas);
    color: var(--geist-mute);
    padding: 14px;
    text-align: center;
  }

  #adminView .telegram-preview-empty > span {
    color: #229ed9;
    font-size: 22px;
  }

  #adminView .telegram-preview-empty > b {
    color: var(--geist-body);
    font-size: 11px;
  }

  #adminView .telegram-preview-empty > small {
    font-size: 9px;
  }

  #adminView .telegram-preview-empty pre {
    width: 100%;
    margin: 0;
    color: var(--geist-body);
    font-family: inherit;
    font-size: 10px;
    line-height: 17px;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-word;
  }

  #adminView .telegram-form-message {
    min-height: 16px;
    color: var(--geist-mute);
    font-size: 10px;
  }

  #adminView .telegram-manager-actions {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid var(--geist-hairline);
    background: var(--geist-elevated);
    padding: 14px 24px;
  }

  #adminView .telegram-manager-actions > div {
    display: flex;
    align-items: center;
    gap: 7px;
  }

  #adminView .telegram-manager-actions button {
    min-height: 38px;
    border-radius: 6px;
    padding: 0 13px;
    font-size: 10px;
    font-weight: 600;
  }

  #adminView .telegram-manager-actions button.primary {
    border-color: var(--geist-accent);
    background: var(--geist-accent);
    color: #06140a;
  }
}

@media (min-width: 769px) and (max-width: 960px) {
  #adminView .admin-hub-head {
    align-items: flex-start;
    flex-direction: column;
  }

  #adminView .telegram-manager-grid {
    grid-template-columns: 1fr;
  }

  #adminView .telegram-category-card {
    grid-row: auto;
  }

  #adminView .telegram-manager-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Monthly report authoring */
#adminView .monthly-report-manager {
  display: grid;
  gap: 18px;
  padding: 24px;
}

#adminView .monthly-report-stepper {
  display: grid;
  grid-template-columns: max-content minmax(48px, 1fr) max-content minmax(48px, 1fr) max-content;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--geist-hairline, #ddd);
  border-radius: 12px;
  background: var(--geist-elevated, #fff);
  padding: 18px 22px;
}

#adminView .monthly-report-stepper > button {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--geist-mute, #777);
  padding: 0;
  text-align: left;
  cursor: pointer;
}

#adminView .monthly-report-stepper > button:disabled { cursor: default; opacity: .48; }
#adminView .monthly-report-stepper > button > i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--geist-hairline, #ddd);
  border-radius: 50%;
  background: var(--geist-soft, #f2f2f2);
  color: var(--geist-mute, #777);
  font: 700 13px "Geist Mono", monospace;
  font-style: normal;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}
#adminView .monthly-report-stepper > button > span { min-width: 0; display: grid; gap: 3px; }
#adminView .monthly-report-stepper > button strong { color: inherit; font-size: 11px; font-weight: 650; white-space: nowrap; }
#adminView .monthly-report-stepper > button small { color: var(--geist-mute, #777); font-size: 8px; white-space: nowrap; }
#adminView .monthly-report-stepper > button.is-complete { color: var(--geist-body, #444); }
#adminView .monthly-report-stepper > button.is-complete > i {
  border-color: color-mix(in srgb, var(--geist-accent, #00ed64) 45%, var(--geist-hairline, #ddd));
  background: color-mix(in srgb, var(--geist-accent, #00ed64) 16%, var(--geist-elevated, #fff));
  color: color-mix(in srgb, var(--geist-accent, #00ed64) 72%, var(--geist-ink, #111));
}
#adminView .monthly-report-stepper > button.is-current { color: var(--geist-ink, #111); }
#adminView .monthly-report-stepper > button.is-current > i {
  border-color: var(--geist-accent, #00ed64);
  background: var(--geist-accent, #00ed64);
  color: #04150b;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--geist-accent, #00ed64) 18%, transparent);
  transform: scale(1.04);
}
#adminView .monthly-report-stepper > b {
  height: 2px;
  display: block;
  margin: 0 14px;
  border-radius: 999px;
  background: var(--geist-hairline, #ddd);
}
#adminView .monthly-report-stepper > b.is-complete {
  background: color-mix(in srgb, var(--geist-accent, #00ed64) 52%, var(--geist-hairline, #ddd));
}

#adminView .monthly-report-stage { display: grid; gap: 18px; }
#adminView .monthly-report-generation-stage {
  min-height: 520px;
  place-items: center;
}
#adminView .monthly-report-generation-card {
  display: grid;
  justify-items: center;
  width: min(100%, 680px);
  border: 1px solid var(--geist-hairline, #ddd);
  border-radius: 16px;
  background: var(--geist-elevated, #fff);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .08);
  padding: 52px 56px 42px;
  text-align: center;
}
#adminView .monthly-report-generation-spinner {
  display: grid;
  position: relative;
  width: 58px;
  height: 58px;
  margin-bottom: 22px;
  place-items: center;
  border: 1px solid var(--geist-hairline, #ddd);
  border-radius: 50%;
  background: var(--geist-soft, #f4f4f4);
}
#adminView .monthly-report-generation-spinner::before,
#adminView .monthly-report-generation-spinner::after,
#adminView .monthly-report-generation-spinner > i {
  content: "";
  position: absolute;
  border-radius: 50%;
}
#adminView .monthly-report-generation-spinner::before {
  width: 38px;
  height: 38px;
  border: 2px solid rgba(0, 201, 88, .15);
  border-top-color: #00c958;
  animation: monthly-report-spin .9s linear infinite;
}
#adminView .monthly-report-generation-spinner::after {
  width: 8px;
  height: 8px;
  background: #00c958;
  box-shadow: 0 0 0 5px rgba(0, 201, 88, .12);
}
#adminView .monthly-report-generation-spinner > i { display: none; }
#adminView .monthly-report-generation-copy .eyebrow {
  margin-bottom: 8px;
  color: #00a748;
}
#adminView .monthly-report-generation-copy h3 {
  margin: 0;
  color: var(--geist-ink, #111);
  font-size: clamp(19px, 2.3vw, 26px);
  font-weight: 650;
  letter-spacing: -.04em;
}
#adminView .monthly-report-generation-copy > p:last-child {
  min-height: 20px;
  margin: 11px 0 0;
  color: var(--geist-mute, #777);
  font-size: 11px;
}
#adminView .monthly-report-progress {
  overflow: hidden;
  width: 100%;
  height: 8px;
  margin-top: 30px;
  border-radius: 999px;
  background: var(--geist-soft, #ededed);
}
#adminView .monthly-report-progress > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00b84f, #00e66b);
  box-shadow: 0 0 18px rgba(0, 201, 88, .3);
  transition: width .35s ease;
}
#adminView .monthly-report-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 9px;
  color: var(--geist-mute, #777);
  font-size: 9px;
}
#adminView .monthly-report-progress-meta strong {
  color: var(--geist-ink, #111);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
#adminView .monthly-report-generation-skeleton {
  display: grid;
  width: 100%;
  margin-top: 30px;
  gap: 9px;
}
#adminView .monthly-report-generation-skeleton > i {
  overflow: hidden;
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--geist-soft, #ededed);
}
#adminView .monthly-report-generation-skeleton > i:nth-child(2) { width: 86%; }
#adminView .monthly-report-generation-skeleton > i:nth-child(3) { width: 64%; }
#adminView .monthly-report-generation-skeleton > i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(127, 127, 127, .16), transparent);
  transform: translateX(-100%);
  animation: monthly-report-shimmer 1.5s ease-in-out infinite;
}
#adminView .monthly-report-generation-card > small {
  margin-top: 24px;
  color: var(--geist-faint, #999);
  font-size: 9px;
}
#adminView .monthly-report-stage-actions {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--geist-hairline, #ddd);
  padding: 12px 20px;
}
#adminView .monthly-report-stage > .monthly-report-stage-actions {
  min-height: 0;
  border: 0;
  padding: 0;
}
#adminView .monthly-report-stage-actions > span {
  margin-right: auto;
  color: var(--geist-mute, #777);
  font-size: 10px;
}
#adminView .monthly-report-stage-actions > span b { color: var(--geist-ink, #111); font-size: 12px; }

#adminView .monthly-report-confirmation {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  border: 1px solid color-mix(in srgb, var(--geist-accent, #00ed64) 34%, var(--geist-hairline, #ddd));
  border-radius: 12px;
  background: color-mix(in srgb, var(--geist-accent, #00ed64) 7%, var(--geist-elevated, #fff));
  padding: 20px;
}
#adminView .monthly-report-confirmation-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--geist-accent, #00ed64);
  color: #04150b;
  font: 750 17px "Geist Mono", monospace;
}
#adminView .monthly-report-confirmation h3,
#adminView .monthly-report-output-card h3 {
  margin: 3px 0 6px;
  color: var(--geist-ink, #111);
  font-size: 17px;
  font-weight: 650;
}
#adminView .monthly-report-confirmation p,
#adminView .monthly-report-output-card header > p:last-child {
  margin: 0;
  color: var(--geist-mute, #777);
  font-size: 10px;
  line-height: 1.6;
}

#adminView .monthly-report-output-card {
  overflow: hidden;
  border: 1px solid var(--geist-hairline, #ddd);
  border-radius: 12px;
  background: var(--geist-elevated, #fff);
}
#adminView .monthly-report-output-card > header { padding: 24px; }
#adminView .monthly-report-output-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--geist-hairline, #ddd);
  border-bottom: 1px solid var(--geist-hairline, #ddd);
}
#adminView .monthly-report-output-grid article {
  display: grid;
  gap: 7px;
  border-right: 1px solid var(--geist-hairline, #ddd);
  padding: 18px 20px;
}
#adminView .monthly-report-output-grid article:last-child { border-right: 0; }
#adminView .monthly-report-output-grid span,
#adminView .monthly-report-output-file span { color: var(--geist-mute, #777); font-size: 9px; }
#adminView .monthly-report-output-grid strong { color: var(--geist-ink, #111); font-size: 14px; font-weight: 650; }
#adminView .monthly-report-output-file {
  display: grid;
  gap: 8px;
  margin: 20px;
  border: 1px solid var(--geist-hairline, #ddd);
  border-radius: 9px;
  background: var(--geist-soft, #f2f2f2);
  padding: 16px;
}
#adminView .monthly-report-output-file strong {
  overflow-wrap: anywhere;
  color: var(--geist-ink, #111);
  font: 600 12px "Geist Mono", "Apple SD Gothic Neo", monospace;
}

#adminView .monthly-report-toolbar,
#adminView .monthly-report-card-head,
#adminView .monthly-report-preview-section > header,
#adminView .monthly-report-prompt-card summary,
#adminView .monthly-report-prompt-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

#adminView .monthly-report-toolbar > div,
#adminView .monthly-report-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

#adminView .monthly-report-toolbar label,
#adminView .monthly-report-month-control {
  display: grid;
  gap: 6px;
  color: var(--geist-mute, #777);
  font-size: 10px;
  font-weight: 600;
}

#adminView .monthly-report-month-control { position: relative; }
#adminView .monthly-report-month-trigger {
  min-width: 188px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--geist-hairline, #ddd);
  border-radius: 7px;
  background: var(--geist-elevated, #fff);
  color: var(--geist-ink, #111);
  padding: 0 11px 0 13px;
  font: 500 12px "Geist", "Apple SD Gothic Neo", sans-serif;
  cursor: pointer;
}
#adminView .monthly-report-month-trigger:hover,
#adminView .monthly-report-month-trigger[aria-expanded="true"] { border-color: #999; }
#adminView .monthly-report-month-trigger b { font-weight: 600; }
#adminView .monthly-report-month-trigger svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#adminView .monthly-report-month-popover {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  left: 0;
  width: 292px;
  max-width: calc(100vw - 28px);
  overflow: hidden;
  border: 1px solid var(--geist-hairline, #ddd);
  border-radius: 10px;
  background: var(--geist-elevated, #fff);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.16), 0 3px 10px rgba(0, 0, 0, 0.08);
  color: var(--geist-ink, #111);
}
#adminView .monthly-report-month-popover > header {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--geist-hairline, #ddd);
  padding: 10px 12px;
}
#adminView .monthly-report-month-popover > header strong { text-align: center; font-size: 12px; font-weight: 650; }
#adminView .monthly-report-month-popover > header button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--geist-body, #444);
  font: 400 20px/1 "Geist", sans-serif;
  cursor: pointer;
}
#adminView .monthly-report-month-popover > header button:hover { background: var(--geist-soft, #f1f1f1); color: var(--geist-ink, #111); }
#adminView .monthly-report-month-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 12px;
}
#adminView .monthly-report-month-grid button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--geist-body, #444);
  font: 550 11px "Geist", "Apple SD Gothic Neo", sans-serif;
  cursor: pointer;
}
#adminView .monthly-report-month-grid button:hover { background: var(--geist-soft, #f1f1f1); color: var(--geist-ink, #111); }
#adminView .monthly-report-month-grid button.current:not(.selected) { border-color: rgba(0, 201, 88, 0.52); color: #008f3e; }
#adminView .monthly-report-month-grid button.selected { border-color: var(--geist-ink, #111); background: var(--geist-ink, #111); color: var(--geist-elevated, #fff); }
#adminView .monthly-report-month-popover > footer {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--geist-hairline, #ddd);
  padding: 9px 12px;
}
#adminView .monthly-report-month-popover > footer button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #008f3e;
  padding: 6px 8px;
  font: 650 10px "Geist", "Apple SD Gothic Neo", sans-serif;
  cursor: pointer;
}
#adminView .monthly-report-month-popover > footer button:hover { background: rgba(0, 201, 88, 0.09); }

#adminView .monthly-report-source-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--geist-hairline, #ddd);
  border-radius: 10px;
  background: var(--geist-elevated, #fff);
}

#adminView .monthly-report-source-summary article {
  display: grid;
  gap: 3px;
  border-right: 1px solid var(--geist-hairline, #ddd);
  padding: 14px 16px;
}

#adminView .monthly-report-source-summary article:last-child { border-right: 0; }
#adminView .monthly-report-source-summary span { color: var(--geist-mute, #777); font-size: 9px; }
#adminView .monthly-report-source-summary b { color: var(--geist-ink, #111); font-size: 20px; font-weight: 600; }

#adminView .monthly-report-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--geist-hairline, #ddd);
  border-radius: 8px;
  background: var(--geist-soft, #f7f7f7);
  padding: 11px 13px;
  color: var(--geist-body, #444);
  font-size: 11px;
}

#adminView .monthly-report-notice strong { color: var(--geist-ink, #111); font-size: 10px; }
#adminView .monthly-report-notice.is-gpt { border-color: rgba(0, 237, 100, 0.36); background: rgba(0, 237, 100, 0.08); }

#adminView .monthly-report-preview-card,
#adminView .monthly-report-prompt-card {
  border: 1px solid var(--geist-hairline, #ddd);
  border-radius: 10px;
  background: var(--geist-elevated, #fff);
}

#adminView .monthly-report-card-head {
  border-bottom: 1px solid var(--geist-hairline, #ddd);
  padding: 18px 20px;
}

#adminView .monthly-report-card-head h3,
#adminView .monthly-report-prompt-card h3 {
  margin: 2px 0 0;
  color: var(--geist-ink, #111);
  font-size: 15px;
  font-weight: 600;
}

#adminView .monthly-report-card-head > small {
  max-width: 460px;
  color: var(--geist-mute, #777);
  font-size: 10px;
  line-height: 1.5;
  text-align: right;
}

#adminView .monthly-report-preview-section { padding: 18px 20px 20px; }
#adminView .monthly-report-preview-section + .monthly-report-preview-section { border-top: 1px solid var(--geist-hairline, #ddd); }
#adminView .monthly-report-preview-section > header { align-items: flex-start; margin-bottom: 11px; }
#adminView .monthly-report-preview-section h4 { margin: 0 0 3px; color: var(--geist-ink, #111); font-size: 13px; font-weight: 600; }
#adminView .monthly-report-preview-section header small { color: var(--geist-mute, #777); font-size: 9px; }
#adminView .monthly-report-section-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}
#adminView .monthly-report-section-actions > span {
  border-radius: 999px;
  background: var(--geist-soft, #f1f1f1);
  color: var(--geist-body, #444);
  padding: 4px 8px;
  font-size: 9px;
}
#adminView .monthly-report-collapse-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  min-height: 26px;
  border: 1px solid var(--geist-hairline, #ddd);
  border-radius: 7px;
  background: var(--geist-elevated, #fff);
  color: var(--geist-mute, #777);
  padding: 0 7px;
  font: 600 8px "Geist", "Apple SD Gothic Neo", sans-serif;
  cursor: pointer;
}
#adminView .monthly-report-collapse-toggle:hover {
  border-color: var(--geist-faint, #aaa);
  color: var(--geist-ink, #111);
}
#adminView .monthly-report-collapse-toggle svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .18s ease;
}
#adminView .monthly-report-collapse-toggle.is-collapsed svg { transform: rotate(-90deg); }
#adminView [data-monthly-report-collapse-content][hidden] { display: none !important; }

#adminView .monthly-report-document-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 20px 20px;
}
#adminView .monthly-report-document-editor {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--geist-hairline, #ddd);
  border-radius: 10px;
  background: var(--geist-canvas, #fafafa);
}
#adminView .monthly-report-document-editor:first-child { grid-column: 1 / -1; }
#adminView .monthly-report-document-editor > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--geist-hairline, #ddd);
  background: var(--geist-soft, #f4f4f4);
  padding: 13px 15px;
}
#adminView .monthly-report-document-editor h4 {
  margin: 0 0 3px;
  color: var(--geist-ink, #111);
  font-size: 12px;
  font-weight: 700;
}
#adminView .monthly-report-document-editor header small {
  color: var(--geist-mute, #777);
  font-size: 9px;
  line-height: 1.45;
}
#adminView .monthly-report-document-editor header > span {
  flex: 0 0 auto;
  border: 1px solid var(--geist-hairline, #ddd);
  border-radius: 999px;
  background: var(--geist-elevated, #fff);
  color: var(--geist-mute, #777);
  padding: 3px 7px;
  font-size: 8px;
}
#adminView .monthly-report-document-editor header > span b {
  color: var(--geist-ink, #111);
  font-weight: 700;
}
#adminView .monthly-report-document-editor textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: var(--geist-elevated, #fff);
  color: var(--geist-ink, #111);
  padding: 16px;
  font: 500 11px/1.75 "Geist", "Apple SD Gothic Neo", sans-serif;
  tab-size: 2;
}
#adminView .monthly-report-document-editor:first-child textarea { min-height: 430px; }
#adminView .monthly-report-document-editor textarea:focus {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--geist-accent, #00c958) 52%, transparent);
}
#adminView .monthly-report-document-editor textarea::placeholder { color: var(--geist-faint, #aaa); }

#adminView .monthly-report-preview-list { display: grid; gap: 7px; }
#adminView .monthly-report-type-group {
  display: grid;
  gap: 9px;
  border: 1px solid var(--geist-hairline, #ddd);
  border-radius: 10px;
  background: var(--geist-canvas, #fafafa);
  padding: 12px;
}
#adminView .monthly-report-type-group + .monthly-report-type-group { margin-top: 8px; }
#adminView .monthly-report-type-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}
#adminView .monthly-report-type-group > header > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
#adminView .monthly-report-type-group > header strong {
  color: var(--geist-ink, #111);
  font-size: 12px;
  font-weight: 700;
}
#adminView .monthly-report-type-group > header small {
  overflow: hidden;
  color: var(--geist-mute, #777);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#adminView .monthly-report-type-group > header > aside {
  display: flex;
  align-items: center;
  gap: 8px;
}
#adminView .monthly-report-type-group > header > aside > span {
  flex: 0 0 auto;
  border: 1px solid var(--geist-hairline, #ddd);
  border-radius: 999px;
  background: var(--geist-elevated, #fff);
  color: var(--geist-body, #444);
  padding: 3px 7px;
  font-size: 8px;
}
#adminView .monthly-report-group-select {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: var(--geist-body, #444);
  font-size: 9px;
  user-select: none;
}
#adminView .monthly-report-group-select > input { position: absolute; opacity: 0; pointer-events: none; }
#adminView .monthly-report-group-select > i {
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border: 1px solid var(--geist-faint, #aaa);
  border-radius: 4px;
  background: var(--geist-elevated, #fff);
}
#adminView .monthly-report-group-select > input:checked + i { border-color: #00b84f; background: #00c958; }
#adminView .monthly-report-group-select > input:checked + i::after {
  content: "✓";
  color: #041a0d;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}
#adminView .monthly-report-group-select > b { font-weight: 600; white-space: nowrap; }
#adminView .monthly-report-type-group > div { display: grid; gap: 7px; }
#adminView .monthly-report-type-group[data-report-group="work"] { border-left: 3px solid #6d7d8c; }
#adminView .monthly-report-type-group[data-report-group="video"] { border-left: 3px solid #00b84f; }
#adminView .monthly-report-type-group[data-report-group="studio"] { border-left: 3px solid #7c6bd0; }
#adminView .monthly-report-type-group[data-report-group="production"] { border-left: 3px solid #3f83d4; }
#adminView .monthly-report-type-group[data-report-group="next"] { border-left: 3px solid #d39a2c; }
#adminView .monthly-report-department-group {
  display: grid;
  gap: 7px;
  border-top: 1px solid var(--geist-hairline, #ddd);
  padding-top: 10px;
}
#adminView .monthly-report-department-group:first-child { border-top: 0; padding-top: 2px; }
#adminView .monthly-report-department-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}
#adminView .monthly-report-department-group > header > div {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
#adminView .monthly-report-department-group > header span {
  color: var(--geist-mute, #777);
  font-size: 8px;
  font-weight: 600;
}
#adminView .monthly-report-department-group > header strong {
  color: var(--geist-ink, #111);
  font-size: 10px;
  font-weight: 700;
}
#adminView .monthly-report-department-group > header em {
  color: var(--geist-mute, #777);
  font-size: 8px;
  font-style: normal;
}
#adminView .monthly-report-department-group > div { display: grid; gap: 7px; }
#adminView .monthly-report-task-group {
  display: grid;
  gap: 8px;
  border: 1px solid var(--geist-hairline, #ddd);
  border-radius: 9px;
  background: var(--geist-soft, #f7f7f7);
  padding: 12px;
}
#adminView .monthly-report-task-parent {
  display: grid;
  gap: 6px;
}
#adminView .monthly-report-task-parent > span {
  color: var(--geist-mute, #777);
  font-size: 9px;
  font-weight: 600;
  padding: 0 2px;
}
#adminView .monthly-report-task-parent > strong {
  color: var(--geist-ink, #111);
  font-size: 12px;
  font-weight: 650;
  padding: 8px 10px;
}
#adminView .monthly-report-task-parent .monthly-report-preview-item.is-parent {
  border-color: rgba(53, 86, 111, 0.3);
  background: var(--geist-elevated, #fff);
}
#adminView .monthly-report-task-parent .monthly-report-preview-item.is-parent > input[type="text"] {
  font-weight: 650;
}
#adminView .monthly-report-task-columns {
  display: flex;
  gap: 6px;
  padding: 0 2px;
  color: var(--geist-mute, #777);
  font-size: 8px;
}
#adminView .monthly-report-task-columns span + span::before { content: "/"; margin-right: 6px; color: #bbb; }
#adminView .monthly-report-task-children { display: grid; gap: 6px; padding-left: 14px; border-left: 2px solid rgba(0, 201, 88, 0.38); }
#adminView .monthly-report-task-children .monthly-report-preview-item { background: var(--geist-elevated, #fff); }
#adminView .monthly-report-preview-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--geist-hairline, #ddd);
  border-radius: 7px;
  background: var(--geist-canvas, #fafafa);
  padding: 8px 10px;
  transition: opacity .15s ease, background .15s ease;
}

#adminView .monthly-report-preview-item > input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
#adminView .monthly-report-preview-item > i { width: 16px; height: 16px; display: grid; place-items: center; border: 1px solid var(--geist-faint, #aaa); border-radius: 4px; background: var(--geist-elevated, #fff); }
#adminView .monthly-report-preview-item > input[type="checkbox"]:checked + i { border-color: #00b84f; background: #00c958; }
#adminView .monthly-report-preview-item > input[type="checkbox"]:checked + i::after { content: "✓"; color: #041a0d; font-size: 10px; font-style: normal; font-weight: 800; }
#adminView .monthly-report-preview-item > input[type="text"] { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--geist-ink, #111); padding: 3px 0; font: 500 11px/1.45 "Geist", "Apple SD Gothic Neo", sans-serif; }
#adminView .monthly-report-preview-item > span { min-width: 0; color: var(--geist-ink, #111); font: 500 11px/1.45 "Geist", "Apple SD Gothic Neo", sans-serif; }
#adminView .monthly-report-item-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
}
#adminView .monthly-report-owner-badge {
  border: 1px solid color-mix(in srgb, #3f83d4 38%, var(--geist-hairline, #ddd));
  border-radius: 999px;
  background: color-mix(in srgb, #3f83d4 9%, var(--geist-elevated, #fff));
  color: color-mix(in srgb, #3f83d4 74%, var(--geist-ink, #111));
  padding: 3px 7px;
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}
#adminView .monthly-report-recurrence-badge {
  border: 1px solid color-mix(in srgb, #7c6bd0 44%, var(--geist-hairline, #ddd));
  border-radius: 999px;
  background: color-mix(in srgb, #7c6bd0 10%, var(--geist-elevated, #fff));
  color: color-mix(in srgb, #7c6bd0 76%, var(--geist-ink, #111));
  padding: 3px 7px;
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}
#adminView .monthly-report-preview-item.is-parent > span { font-weight: 650; }
#adminView .monthly-report-preview-item:focus-within { border-color: #9a9a9a; background: var(--geist-elevated, #fff); }
#adminView .monthly-report-preview-item.is-excluded { opacity: .48; }
#adminView .monthly-report-empty { border: 1px dashed var(--geist-hairline, #ddd); border-radius: 7px; color: var(--geist-mute, #777); padding: 18px; font-size: 10px; text-align: center; }

#adminView .monthly-report-prompt-card { overflow: hidden; }
#adminView .monthly-report-prompt-card summary { cursor: pointer; list-style: none; padding: 16px 20px; }
#adminView .monthly-report-prompt-card summary::-webkit-details-marker { display: none; }
#adminView .monthly-report-prompt-card summary > span { color: var(--geist-mute, #777); font-size: 10px; }
#adminView .monthly-report-prompt-card summary > span::after { content: "열기"; }
#adminView .monthly-report-prompt-card[open] summary { border-bottom: 1px solid var(--geist-hairline, #ddd); }
#adminView .monthly-report-prompt-card[open] summary > span::after { content: "접기"; }
#adminView .monthly-report-prompt-card > div { display: grid; gap: 10px; padding: 18px 20px; }
#adminView .monthly-report-prompt-card p { margin: 0; color: var(--geist-mute, #777); font-size: 10px; }
#adminView .monthly-report-prompt-card textarea { width: 100%; resize: vertical; border: 1px solid var(--geist-hairline, #ddd); border-radius: 7px; background: var(--geist-canvas, #fafafa); color: var(--geist-body, #333); padding: 12px; font: 400 11px/1.65 "Geist", "Apple SD Gothic Neo", sans-serif; }
#adminView .monthly-report-prompt-card footer small { color: var(--geist-mute, #777); font-size: 9px; }

@media (max-width: 900px) {
  #adminView .monthly-report-stepper {
    grid-template-columns: repeat(3, minmax(148px, 1fr));
    gap: 12px;
    overflow-x: auto;
  }
  #adminView .monthly-report-stepper > b { display: none; }
  #adminView .monthly-report-source-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #adminView .monthly-report-source-summary article:nth-child(3) { border-right: 0; }
  #adminView .monthly-report-source-summary article:nth-child(n+4) { border-top: 1px solid var(--geist-hairline, #ddd); }
  #adminView .monthly-report-document-grid { grid-template-columns: 1fr; }
  #adminView .monthly-report-document-editor:first-child { grid-column: auto; }
}

@media (max-width: 768px) {
  #adminView.mobile-monthly-report {
    --geist-canvas: var(--mobile-video-canvas);
    --geist-elevated: var(--mobile-video-elevated);
    --geist-soft: var(--mobile-video-soft);
    --geist-ink: var(--mobile-video-ink);
    --geist-body: var(--mobile-video-body);
    --geist-mute: var(--mobile-video-mute);
    --geist-faint: var(--mobile-video-mute);
    --geist-hairline: var(--mobile-video-line);
    --geist-accent: var(--mobile-video-accent);
    min-width: 0;
  }
  #adminView .monthly-report-manager { padding: 14px; }
  #adminView .monthly-report-generation-stage { min-height: 430px; }
  #adminView .monthly-report-generation-card {
    border-radius: 12px;
    padding: 38px 20px 30px;
  }
  #adminView .monthly-report-generation-spinner {
    width: 52px;
    height: 52px;
    margin-bottom: 18px;
  }
  #adminView .monthly-report-generation-copy h3 { font-size: 19px; }
  #adminView .monthly-report-progress { margin-top: 24px; }
  #adminView .monthly-report-stepper {
    margin: 0;
    grid-template-columns: repeat(3, minmax(126px, 1fr));
    padding: 14px;
  }
  #adminView .monthly-report-stepper > button {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
  }
  #adminView .monthly-report-stepper > button > i {
    width: 34px;
    height: 34px;
  }
  #adminView .monthly-report-toolbar { align-items: stretch; flex-direction: column; }
  #adminView .monthly-report-toolbar > div { align-items: stretch; }
  #adminView .monthly-report-toolbar label { flex: 1; }
  #adminView .monthly-report-month-control { flex: 1; }
  #adminView .monthly-report-month-trigger { width: 100%; }
  #adminView .monthly-report-actions > button { flex: 1; }
  #adminView .monthly-report-source-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #adminView .monthly-report-source-summary article:nth-child(odd) { border-right: 1px solid var(--geist-hairline, #ddd); }
  #adminView .monthly-report-source-summary article:nth-child(even) { border-right: 0; }
  #adminView .monthly-report-source-summary article:nth-child(n+3) { border-top: 1px solid var(--geist-hairline, #ddd); }
  #adminView .monthly-report-card-head { align-items: flex-start; flex-direction: column; }
  #adminView .monthly-report-card-head > small { text-align: left; }
  #adminView .monthly-report-document-grid { gap: 10px; padding: 12px; }
  #adminView .monthly-report-document-editor > header { padding: 12px; }
  #adminView .monthly-report-document-editor textarea { min-height: 190px; padding: 13px; font-size: 10px; }
  #adminView .monthly-report-document-editor:first-child textarea { min-height: 360px; }
  #adminView .monthly-report-preview-item { grid-template-columns: 18px minmax(0, 1fr); }
  #adminView .monthly-report-item-badges { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }
  #adminView :is(.monthly-report-owner-badge, .monthly-report-recurrence-badge) { white-space: normal; }
  #adminView .monthly-report-type-group > header > div { display: grid; gap: 2px; }
  #adminView .monthly-report-type-group > header > aside { align-items: flex-end; flex-direction: column; gap: 5px; }
  #adminView .monthly-report-task-children { padding-left: 9px; }
  #adminView .monthly-report-stage-actions {
    flex-wrap: wrap;
    padding: 12px 14px;
  }
  #adminView .monthly-report-stage-actions > span {
    width: 100%;
    order: -1;
  }
  #adminView .monthly-report-confirmation {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
  }
  #adminView .monthly-report-confirmation-icon {
    width: 42px;
    height: 42px;
  }
  #adminView .monthly-report-output-card > header { padding: 20px; }
  #adminView .monthly-report-output-grid { grid-template-columns: 1fr; }
  #adminView .monthly-report-output-grid article {
    border-right: 0;
    border-bottom: 1px solid var(--geist-hairline, #ddd);
  }
  #adminView .monthly-report-output-grid article:last-child { border-bottom: 0; }
}

@keyframes telegram-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes monthly-report-spin {
  to { transform: rotate(360deg); }
}

@keyframes monthly-report-shimmer {
  to { transform: translateX(100%); }
}

@media (min-width: 769px) {
  #adminView .admin-hub-head nav {
    grid-template-columns: repeat(4, auto);
  }

  #adminView .admin-activity-manager {
    display: grid;
    gap: 14px;
    background: var(--geist-canvas);
    padding: 16px;
  }

  #adminView .admin-activity-filters {
    display: grid;
    grid-template-columns: 200px minmax(160px, 1fr) minmax(180px, 1fr);
    gap: 10px;
    border: 1px solid var(--geist-hairline);
    border-radius: 10px;
    background: var(--geist-elevated);
    padding: 14px;
  }

  #adminView .admin-activity-filters label {
    display: grid;
    gap: 6px;
    color: var(--geist-mute);
    font-size: 10px;
    font-weight: 600;
  }

  #adminView .admin-activity-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  #adminView .admin-activity-summary article {
    min-width: 0;
    display: grid;
    gap: 3px;
    border: 1px solid var(--geist-hairline);
    border-radius: 10px;
    background: var(--geist-elevated);
    padding: 14px;
  }

  #adminView .admin-activity-summary span,
  #adminView .admin-activity-summary small {
    color: var(--geist-mute);
    font-size: 9px;
    font-weight: 500;
  }

  #adminView .admin-activity-summary b {
    color: var(--geist-ink);
    font-family: "Geist Mono", monospace;
    font-size: 22px;
    font-weight: 600;
  }

  #adminView .admin-activity-days {
    display: grid;
    gap: 10px;
  }

  #adminView .admin-activity-day {
    overflow: hidden;
    border: 1px solid var(--geist-hairline);
    border-radius: 10px;
    background: var(--geist-elevated);
  }

  #adminView .admin-activity-day > header {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--geist-hairline);
    background: var(--geist-soft);
    padding: 0 14px;
  }

  #adminView .admin-activity-day > header div {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  #adminView .admin-activity-day > header strong {
    color: var(--geist-ink);
    font-size: 13px;
    font-weight: 600;
  }

  #adminView .admin-activity-day > header span {
    border: 1px solid var(--geist-hairline);
    border-radius: 999px;
    background: var(--geist-elevated);
    color: var(--geist-mute);
    padding: 2px 7px;
    font-size: 9px;
  }

  #adminView .admin-activity-day > header small {
    color: var(--geist-mute);
    font-family: "Geist Mono", monospace;
    font-size: 9px;
  }

  #adminView .admin-activity-list {
    display: grid;
  }

  #adminView .admin-activity-row {
    min-height: 72px;
    display: grid;
    grid-template-columns: 52px 48px minmax(0, 1fr) minmax(100px, 150px);
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--geist-hairline);
    padding: 10px 14px;
  }

  #adminView .admin-activity-row:last-child {
    border-bottom: 0;
  }

  #adminView .admin-activity-row time {
    color: var(--geist-mute);
    font-family: "Geist Mono", monospace;
    font-size: 10px;
  }

  #adminView .admin-activity-entity {
    min-height: 24px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #cfe0ff;
    border-radius: 999px;
    background: #f2f6ff;
    color: #2256a0;
    font-size: 9px;
    font-weight: 700;
  }

  #adminView .admin-activity-entity.work {
    border-color: rgba(0, 237, 100, 0.28);
    background: var(--geist-accent-soft);
    color: #087231;
  }

  body[data-theme="dark"] #adminView .admin-activity-entity.project {
    border-color: #29415f;
    background: #162334;
    color: #91b9ef;
  }

  #adminView .admin-activity-copy {
    min-width: 0;
    display: grid;
    gap: 5px;
  }

  #adminView .admin-activity-copy > strong {
    overflow: hidden;
    color: var(--geist-ink);
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #adminView .admin-activity-copy p {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--geist-body);
    font-size: 10px;
  }

  #adminView .admin-activity-copy p b {
    color: var(--geist-mute);
    font-size: 9px;
    font-weight: 600;
  }

  #adminView .admin-activity-actor {
    min-width: 0;
    display: grid;
    justify-items: end;
    gap: 3px;
  }

  #adminView .admin-activity-actor span {
    color: var(--geist-mute);
    font-size: 8px;
  }

  #adminView .admin-activity-actor strong {
    overflow: hidden;
    max-width: 100%;
    color: var(--geist-body);
    font-size: 10px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #adminView .admin-activity-empty {
    min-height: 240px;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 7px;
    border: 1px dashed var(--geist-hairline);
    border-radius: 10px;
    background: var(--geist-elevated);
    color: var(--geist-mute);
    text-align: center;
  }

  #adminView .admin-activity-empty strong {
    color: var(--geist-body);
    font-size: 13px;
  }

  #adminView .admin-activity-empty span {
    font-size: 10px;
  }
}

@media (min-width: 769px) and (max-width: 960px) {
  #adminView .admin-activity-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
