


:root {
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --status-operational: #10b981;
    --status-degraded: #f59e0b;
    --status-partial: #f97316;
    --status-major: #ef4444;
    --status-maintenance: #3b82f6;
    --status-maintenance-foreground: #08306b;
    --status-unknown: #6b7280;
    --accent-primary: #3b82f6;
    --accent-secondary: #10b981;
}

[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-tertiary: #d4d4d8;
    --border-primary: #262626;
    --border-secondary: #404040;
    --shadow-light: rgba(0, 0, 0, 0.4);
    --shadow-medium: rgba(0, 0, 0, 0.6);
    --card-bg: #111111;
    --header-bg: rgba(10, 10, 10, 0.95);
    --icon-color: #a1a1aa;
    --status-maintenance-foreground: #ffffff;
}

[data-theme="light"] {
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f4f4f5;
    --text-primary: #18181b;
    --text-secondary: #71717a;
    --text-tertiary: #3f3f46;
    --border-primary: #e4e4e7;
    --border-secondary: #d4d4d8;
    --shadow-light: rgba(0, 0, 0, 0.06);
    --shadow-medium: rgba(0, 0, 0, 0.1);
    --card-bg: #ffffff;
    --header-bg: rgba(250, 250, 250, 0.95);
    --icon-color: #71717a;
    --status-maintenance-foreground: #08306b;
}


*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: #60a5fa;
}


.header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-primary);
    padding: 24px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    height: 40px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo-image {
    height: 40px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    transition: opacity 0.2s ease;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 32px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.header-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.header-info-item:hover {
    color: var(--text-primary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 24px;
}

.control-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--icon-color);
}

.control-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.control-btn:active {
    transform: scale(0.95);
}


.main {
    max-width: 1160px;
    width: 100%;
    margin: 0 auto;
    padding: 36px 28px 72px;
    flex: 1;
}


.status-banner {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 28px 32px;
    background: var(--card-bg);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    margin-bottom: 32px;
    transition: all 0.4s ease;
}

.status-banner.operational {
    border-color: rgba(16, 185, 129, 0.25);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), var(--card-bg));
}

.status-banner.degraded {
    border-color: rgba(249, 115, 22, 0.25);
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.06), var(--card-bg));
}

.status-banner.major {
    border-color: rgba(239, 68, 68, 0.25);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.06), var(--card-bg));
}

.status-banner.maintenance {
    border-color: rgba(59, 130, 246, 0.28);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(29, 78, 216, 0.08));
}

.status-banner-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.4s ease;
}

.status-banner.operational .status-banner-icon {
    background: rgba(16, 185, 129, 0.12);
    color: var(--status-operational);
}

.status-banner.degraded .status-banner-icon {
    background: rgba(249, 115, 22, 0.12);
    color: var(--status-partial);
}

.status-banner.major .status-banner-icon {
    background: rgba(239, 68, 68, 0.12);
    color: var(--status-major);
}

.status-banner.maintenance .status-banner-icon {
    background: rgba(255, 255, 255, 0.08);
    color: var(--status-maintenance);
}

.status-banner-text h1 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 2px;
}

.status-banner-text p {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.status-banner.maintenance .status-banner-text h1,
.status-banner.maintenance .status-banner-text p {
    color: var(--text-primary);
}

.status-banner.maintenance .status-banner-text p {
    opacity: 0.9;
}

/* header loading text should not inherit global link color */
#headerStatusText {
    color: var(--text-secondary);
}


.service-pill-stack {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.service-notice-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    border: 1px solid transparent;
    white-space: nowrap;
}

.service-notice-pill.notice {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-secondary);
    border-color: rgba(107, 114, 128, 0.16);
}

.service-notice-pill.degraded {
    background: rgba(245, 158, 11, 0.1);
    color: var(--status-degraded);
    border-color: rgba(245, 158, 11, 0.16);
}

.service-notice-pill.partial {
    background: rgba(249, 115, 22, 0.1);
    color: var(--status-partial);
    border-color: rgba(249, 115, 22, 0.16);
}

.service-notice-pill.major,
.service-notice-pill.critical {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-major);
    border-color: rgba(239, 68, 68, 0.16);
}

.service-notice-pill.maintenance {
    background: rgba(59, 130, 246, 0.1);
    color: var(--status-maintenance);
    border-color: rgba(59, 130, 246, 0.16);
}


.notices-section {
    margin-bottom: 28px;
}

.notices-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.notice-card {
    background: var(--card-bg);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    box-shadow: 0 10px 24px -18px var(--shadow-medium);
}

.notice-card.notice {
    border-color: rgba(107, 114, 128, 0.24);
}

.notice-card.degraded {
    border-color: rgba(245, 158, 11, 0.24);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), var(--card-bg));
}

.notice-card.partial {
    border-color: rgba(249, 115, 22, 0.24);
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.05), var(--card-bg));
}

.notice-card.major,
.notice-card.critical {
    border-color: rgba(239, 68, 68, 0.24);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), var(--card-bg));
}

.notice-card.maintenance {
    border-color: rgba(59, 130, 246, 0.24);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), var(--card-bg));
}

.notice-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px 24px;
    align-items: start;
}

.notice-card-title-wrap {
    flex: 1;
    min-width: 0;
}

.notice-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.notice-type-pill,
.notice-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    border: 1px solid transparent;
}

.notice-type-pill.notice {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-secondary);
    border-color: rgba(107, 114, 128, 0.16);
}

.notice-type-pill.degraded {
    background: rgba(245, 158, 11, 0.1);
    color: var(--status-degraded);
    border-color: rgba(245, 158, 11, 0.16);
}

.notice-type-pill.partial {
    background: rgba(249, 115, 22, 0.1);
    color: var(--status-partial);
    border-color: rgba(249, 115, 22, 0.16);
}

.notice-type-pill.major {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-major);
    border-color: rgba(239, 68, 68, 0.16);
}

.notice-type-pill.critical {
    background: rgba(127, 29, 29, 0.1);
    color: #b91c1c;
    border-color: rgba(185, 28, 28, 0.16);
}

.notice-type-pill.maintenance,
.notice-status-pill.monitoring,
.notice-status-pill.identified,
.notice-status-pill.resolved,
.notice-status-pill.investigating,
.notice-status-pill.scheduled,
.notice-status-pill.in_progress,
.notice-status-pill.completed,
.notice-status-pill.planned,
.notice-status-pill.emergency {
    background: rgba(59, 130, 246, 0.1);
    color: var(--status-maintenance);
    border-color: rgba(59, 130, 246, 0.16);
}

.notice-title {
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.notice-summary {
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.55;
    max-width: 760px;
}

.notice-time-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 190px;
    align-items: flex-start;
    text-align: left;
    justify-self: end;
}

.notice-time-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notice-time-label {
    font-size: 0.68rem;
    color: var(--text-secondary);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.notice-body {
    color: var(--text-tertiary);
    line-height: 1.7;
    font-size: 0.92rem;
}

.notice-body > :first-child {
    margin-top: 0;
}

.notice-body > :last-child {
    margin-bottom: 0;
}

.notice-body p,
.notice-body ul,
.notice-body ol,
.notice-body pre,
.notice-body blockquote {
    margin: 0 0 12px;
}

.notice-body ul,
.notice-body ol {
    padding-left: 20px;
}

.notice-body code {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 0 5px;
    font-size: 0.85em;
}

.notice-body pre {
    overflow-x: auto;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    padding: 14px 16px;
}

.notice-body pre code {
    background: transparent;
    border: 0;
    padding: 0;
}

.notice-body a {
    color: var(--accent-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.notice-body strong {
    color: var(--text-primary);
}

.notice-affected-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-primary);
}

.notice-affected-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}

.notice-affected-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Keep affected-service pills left-aligned by default; allow card-specific tweaks */
.notice-card .notice-affected-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.notice-card .notice-affected-label {
    width: 100%;
    text-align: left;
}

.notice-card .notice-affected-pills {
    justify-content: flex-start;
}

/* Reduce left-indent for markdown lists inside notices so bullets align closer to text */
.notice-body ul,
.notice-body ol {
    padding-left: 1rem;
    margin-left: 0.2rem;
}

.notice-affected-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.18);
    background: rgba(59, 130, 246, 0.08);
    color: var(--status-maintenance);
}

.notice-dropdown {
    background: var(--card-bg);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.notice-dropdown + .notice-dropdown {
    margin-top: 12px;
}

.notice-dropdown-summary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 14px;
    background: transparent;
    border: 0;
    outline: none;
    color: inherit;
    cursor: pointer;
    text-align: left;
    appearance: none;
}

.notice-dropdown-summary:focus-visible {
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.28);
}

.notice-dropdown-summary-left {
    min-width: 0;
    flex: 1;
    padding-left: 4px;
}

.notice-dropdown-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.notice-dropdown-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.notice-dropdown-headline {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.notice-dropdown-chevron {
    flex-shrink: 0;
    color: var(--text-secondary);
    transition: transform 0.22s ease;
}

.notice-dropdown.open .notice-dropdown-chevron {
    transform: rotate(180deg);
}

.notice-dropdown-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.24s ease;
}

.notice-dropdown.open .notice-dropdown-details {
    border-top: 1px solid var(--border-primary);
}

.notice-dropdown-detail-block {
    display: flex;
    flex-direction: column;
}

.notice-dropdown-body {
    padding: 16px 20px 0;
    color: var(--text-tertiary);
    line-height: 1.7;
}

.notice-dropdown-indent {
    padding-left: 20px;
    padding-right: 20px;
}

.notice-dropdown-times {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding-top: 12px;
    padding-bottom: 16px;
}

.notice-dropdown-time-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notice-dropdown-time-label {
    font-size: 0.68rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.notice-dropdown-time-value {
    font-size: 0.8rem;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}


.service-groups {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.service-group {
    background: var(--card-bg);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition);
}

.service-group:hover {
    border-color: var(--border-secondary);
}

.group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    cursor: pointer;
    user-select: none;
    transition: background var(--transition);
}

.group-header:hover {
    background: var(--bg-tertiary);
}

.group-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.group-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.group-status-dot.operational { background: var(--status-operational); box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
.group-status-dot.degraded { background: var(--status-degraded); box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
.group-status-dot.partial { background: var(--status-partial); box-shadow: 0 0 8px rgba(249, 115, 22, 0.4); }
.group-status-dot.major { background: var(--status-major); box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); animation: pulse-red 2s infinite; }
.group-status-dot.maintenance { background: var(--status-maintenance); box-shadow: 0 0 8px rgba(59, 130, 246, 0.4); }

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 16px rgba(239, 68, 68, 0.7); }
}

.group-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.group-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.group-status-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.group-status-label.operational { color: var(--status-operational); }
.group-status-label.degraded { color: var(--status-degraded); }
.group-status-label.partial { color: var(--status-partial); }
.group-status-label.major { color: var(--status-major); }
.group-status-label.maintenance { color: var(--status-maintenance); }

.group-chevron {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.group-header.expanded .group-chevron {
    transform: rotate(180deg);
}


.group-services {
    border-top: 1px solid var(--border-primary);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.28s cubic-bezier(0.25, 0.1, 0.25, 1), opacity 0.2s ease;
}

.group-services.open {
    max-height: 2000px;
    opacity: 1;
}

.service-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px 14px 28px;
    border-bottom: 1px solid var(--border-primary);
    opacity: 0;
    transform: translateY(-4px);
    transition: background var(--transition), opacity 0.2s ease, transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.group-services.open .service-item {
    opacity: 1;
    transform: translateY(0);
}

.service-item:last-child {
    border-bottom: none;
}

.service-item:hover {
    background: var(--bg-tertiary);
}

.service-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.service-name-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.service-status-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.service-status-icon.operational { background: var(--status-operational); }
.service-status-icon.degraded { background: var(--status-degraded); }
.service-status-icon.partial { background: var(--status-partial); }
.service-status-icon.major { background: var(--status-major); }
.service-status-icon.maintenance { background: var(--status-maintenance); }
.service-status-icon.unknown { background: var(--status-unknown); }

.service-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.service-target {
    font-size: 0.72rem;
    color: var(--text-secondary);
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.service-right {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    min-width: 0;
    flex-shrink: 0;
}

.service-pill-stack {
    align-items: flex-end;
}

.service-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    border: 1px solid transparent;
    background: rgba(16, 185, 129, 0.1);
    color: var(--status-operational);
}

.service-status-pill.operational {
    background: rgba(16, 185, 129, 0.1);
    color: var(--status-operational);
    border-color: rgba(16, 185, 129, 0.15);
}

.service-status-pill.maintenance {
    /* Match operational style: colored text with subtle translucent background */
    background: rgba(59, 130, 246, 0.12);
    color: var(--status-maintenance);
    border-color: rgba(59, 130, 246, 0.18);
}

.service-status-pill.degraded {
    background: rgba(245, 158, 11, 0.12);
    color: var(--status-degraded);
    border-color: rgba(245, 158, 11, 0.15);
}

.service-status-pill.partial {
    background: rgba(249, 115, 22, 0.12);
    color: var(--status-partial);
    border-color: rgba(249, 115, 22, 0.15);
}

.service-status-pill.major {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-major);
    border-color: rgba(239, 68, 68, 0.15);
}

.service-status-pill.unknown {
    background: rgba(107, 114, 128, 0.1);
    color: var(--status-unknown);
    border-color: rgba(107, 114, 128, 0.15);
}


.uptime-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    max-width: 100%;
}

.uptime-bar {
    display: flex;
    gap: clamp(1px, 0.14vw, 1.5px);
    height: 24px;
    align-items: center;
    position: relative;
}

.uptime-day {
    width: clamp(1.5px, 0.32vw, 3px);
    height: 24px;
    border-radius: 1.5px;
    transition: height 0.15s ease, opacity 0.15s ease;
    cursor: pointer;
    position: relative;
}

.uptime-day.operational { background: var(--status-operational); }
.uptime-day.degraded { background: var(--status-degraded); }
.uptime-day.partial { background: var(--status-partial); }
.uptime-day.major { background: var(--status-major); }
.uptime-day.maintenance { background: var(--status-maintenance); }
.uptime-day.unknown { background: #2a2a2a; }

.uptime-day:hover {
    height: 28px;
}


.uptime-day .tooltip {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    white-space: nowrap;
    font-size: 0.72rem;
    color: var(--text-tertiary);
    z-index: 120;
    pointer-events: none;
    box-shadow: 0 4px 12px var(--shadow-medium);
}

.uptime-day:hover .tooltip {
    display: block;
}

.uptime-day:nth-child(-n + 8) .tooltip {
    left: 0;
    transform: translateY(-50%);
}

.uptime-day:nth-last-child(-n + 8) .tooltip {
    left: auto;
    right: 0;
    transform: translateY(-50%);
}

.uptime-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.uptime-percentage {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.uptime-range {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.uptime-range span {
    font-size: 0.65rem;
    color: var(--text-secondary);
    opacity: 0.6;
}


.latency-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    background: rgba(16, 185, 129, 0.1);
    color: var(--status-operational);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.latency-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--status-degraded);
    border-color: rgba(245, 158, 11, 0.15);
}

.latency-badge.critical {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-major);
    border-color: rgba(239, 68, 68, 0.15);
}

.latency-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}


.incidents-section {
    margin-top: 12px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-primary);
}

.section-title svg {
    color: var(--icon-color);
}

.incidents-list {
    display: flex;
    flex-direction: column;
}

.incident-date-group {
    margin-bottom: 8px;
}

.incident-date {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    padding-left: 2px;
}

.incident-card {
    background: var(--card-bg);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    transition: all var(--transition);
    cursor: pointer;
}

.incident-card:hover {
    border-color: var(--border-secondary);
    background: var(--bg-tertiary);
}

.incident-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.incident-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.incident-severity {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.incident-severity.resolved {
    background: rgba(16, 185, 129, 0.12);
    color: var(--status-operational);
}

.incident-severity.investigating {
    background: rgba(245, 158, 11, 0.12);
    color: var(--status-degraded);
}

.incident-severity.major {
    background: rgba(239, 68, 68, 0.12);
    color: var(--status-major);
}

.incident-severity.maintenance {
    background: rgba(59, 130, 246, 0.12);
    color: var(--status-maintenance);
}

.incident-body {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.incident-time {
    font-size: 0.72rem;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-top: 8px;
}

.incident-updates {
    margin-top: 0;
    padding-top: 0;
    border-top: 1px solid transparent;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(-4px);
    transition: max-height 0.28s ease, opacity 0.22s ease, transform 0.24s ease, margin-top 0.24s ease, padding-top 0.24s ease, border-color 0.24s ease;
}

.incident-updates.open {
    max-height: 560px;
    opacity: 1;
    margin-top: 10px;
    padding-top: 10px;
    border-top-color: var(--border-primary);
    pointer-events: auto;
    transform: translateY(0);
}

.incident-update {
    display: flex;
    gap: 10px;
    font-size: 0.78rem;
}

.incident-update-label {
    font-weight: 600;
    color: var(--text-tertiary);
    flex-shrink: 0;
    min-width: 48px;
}

.incident-update-label.resolved { color: var(--status-operational); }
.incident-update-label.update { color: var(--status-degraded); }
.incident-update-label.investigating { color: var(--status-partial); }
.incident-update-label.identified { color: var(--accent-primary); }

.incident-update-text {
    color: var(--text-secondary);
    line-height: 1.5;
    flex: 1;
}

.incident-update-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.6;
    flex-shrink: 0;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}


.updates-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-primary);
}

.updates-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 7px 14px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
    font-family: inherit;
}

.updates-back-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-secondary);
}

.updates-back-btn:active {
    transform: scale(0.97);
}

.updates-page-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin: 0;
}

.updates-page-title svg {
    color: var(--icon-color);
    flex-shrink: 0;
}

.incidents-footer {
    margin-top: 18px;
    text-align: center;
}

.incidents-more-link {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition);
    user-select: none;
}

.incidents-more-link:hover {
    color: var(--accent-primary);
}

.incidents-more-link[style*="display: none"] {
    display: none !important;
}

.no-incidents {
    text-align: center;
    padding: 28px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.no-incidents svg {
    display: block;
    margin: 0 auto 10px;
    color: var(--status-operational);
    opacity: 0.5;
}


.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-primary);
    padding: 20px 0;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.footer-logo-img {
    height: 48px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

.footer-right {
    display: flex;
    flex-direction: column;
}

.footer-main-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0 0 4px 0;
    line-height: 1.5;
    text-align: right;
    font-weight: 500;
}

.footer-main-text:last-child {
    margin-top: 6px;
    margin-bottom: 0;
}

.footer-small-text {
    color: var(--text-secondary);
    font-size: 0.7rem;
    margin: 0;
    line-height: 1.5;
    text-align: right;
}

.footer-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.footer-link:hover {
    text-decoration: underline;
}


.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, #222 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}



body,
.header,
.status-banner,
.service-group,
.incident-card,
.footer,
.modal {
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}


[data-theme="light"] a {
    color: #2563eb;
}

[data-theme="light"] a:hover {
    color: #1d4ed8;
}

[data-theme="light"] .status-banner.operational {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), var(--card-bg));
}

[data-theme="light"] .uptime-day.unknown {
    background: #e4e4e7;
}


@media (max-width: 768px) {
    .header {
        padding: 16px 0;
    }

    .header-content {
        padding: 0 16px;
    }

    .header-info-item {
        display: none;
    }

    .controls {
        margin-left: 0;
    }

    .logo-image {
        height: 32px;
        max-width: 120px;
    }

    .main {
        padding: 20px 16px 40px;
    }

    .status-banner {
        padding: 20px;
        gap: 14px;
    }

    .status-banner-icon {
        width: 44px;
        height: 44px;
    }

    .status-banner-icon svg {
        width: 22px;
        height: 22px;
    }

    .status-banner-text h1 {
        font-size: 1.05rem;
    }

    .group-header {
        padding: 14px 16px;
    }

    .service-item {
        padding: 12px 16px 12px 24px;
        flex-wrap: nowrap;
        gap: 12px;
        align-items: center;
    }

    .service-left {
        flex: 1 1 auto;
        align-items: center;
    }

    .service-right {
        flex: 0 0 auto;
        justify-content: flex-end;
        align-items: center;
        margin-left: auto;
    }

    .service-status-pill {
        margin-top: 2px;
    }

    .notice-card {
        padding: 16px 16px 18px;
    }

    .notice-card-head {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .notice-card-title-wrap {
        padding-left: 2px;
    }

    .notice-pill-row {
        gap: 6px;
        margin-bottom: 8px;
    }

    .notice-type-pill,
    .notice-status-pill {
        padding: 4px 9px;
        font-size: 0.68rem;
    }

    .notice-title {
        font-size: 0.98rem;
        line-height: 1.35;
        margin-bottom: 4px;
        word-break: keep-all;
        overflow-wrap: anywhere;
    }

    .notice-summary {
        font-size: 0.76rem;
        line-height: 1.5;
    }

    .notice-time-list {
        min-width: 0;
        justify-self: start;
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px 12px;
    }

    .notice-time-row {
        min-width: calc(50% - 6px);
    }

    .notice-body {
        margin-top: 12px;
        font-size: 0.84rem;
        line-height: 1.6;
    }

    .notice-affected-section {
        margin-top: 12px;
        padding-top: 12px;
    }

    .notice-affected-label {
        margin-bottom: 6px;
    }

    .notice-affected-pill {
        font-size: 0.68rem;
        padding: 4px 9px;
    }

    .notice-dropdown-summary {
        padding: 11px 12px;
        gap: 14px;
    }

    .notice-dropdown-summary-left {
        padding-left: 2px;
    }

    .notice-dropdown-pill-row {
        gap: 6px;
        margin-bottom: 6px;
    }

    .notice-dropdown-title {
        font-size: 0.88rem;
        line-height: 1.32;
        margin-bottom: 2px;
        word-break: keep-all;
        overflow-wrap: anywhere;
    }

    .notice-dropdown-headline {
        font-size: 0.74rem;
        line-height: 1.45;
    }

    .notice-dropdown-body {
        padding: 12px 14px 0;
        font-size: 0.84rem;
        line-height: 1.6;
    }

    .notice-dropdown-indent {
        padding-left: 14px;
        padding-right: 14px;
    }

    .notice-dropdown-times {
        gap: 10px 12px;
        padding-top: 10px;
        padding-bottom: 14px;
    }

    .notice-dropdown-time-row {
        min-width: calc(50% - 6px);
    }

    .notice-dropdown-time-value {
        font-size: 0.74rem;
        line-height: 1.35;
        word-break: keep-all;
        overflow-wrap: anywhere;
    }

    .uptime-bar {
        gap: 1px;
    }

    .uptime-day {
        width: 2px;
    }

    .footer {
        padding: 16px 0;
    }

    .footer-container {
        padding: 0 16px;
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .footer-logo-img {
        height: 36px;
        max-width: 140px;
    }

    .footer-right {
        width: 100%;
    }

    .footer-main-text {
        font-size: 0.8rem;
        text-align: left;
    }

    .footer-main-text:last-child {
        margin-top: 5px;
    }

    .footer-small-text {
        font-size: 0.65rem;
        text-align: left;
    }
}

@media (min-width: 769px) and (max-width: 1080px) {
    .service-item {
        padding: 12px 16px 12px 32px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .service-left {
        flex: 1 0 100%;
    }

    .service-right {
        flex: 1 0 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .logo-image {
        height: 32px;
        max-width: 120px;
    }

    .controls {
        margin-left: 0;
    }

    .status-banner {
        flex-direction: column;
        text-align: center;
    }

    .service-item {
        padding: 12px 14px 12px 22px;
        gap: 10px;
    }

    .service-left {
        gap: 10px;
    }

    .service-name {
        font-size: 0.8rem;
    }

    .service-target {
        font-size: 0.68rem;
    }

    .service-status-pill {
        font-size: 0.72rem;
        padding: 5px 10px;
    }

    .notice-card {
        padding: 14px 14px 16px;
    }

    .notice-title {
        font-size: 0.94rem;
    }

    .notice-summary {
        font-size: 0.73rem;
    }

    .notice-dropdown-summary {
        padding: 10px 11px;
    }

    .notice-dropdown-title {
        font-size: 0.84rem;
    }

    .notice-dropdown-headline {
        font-size: 0.72rem;
    }

    .uptime-day {
        width: 1.5px;
        height: 20px;
    }
}
