input, button { min-height: 40px; border: 1px solid var(--outline); border-radius: 9px; padding: 8px 11px; color: #e7edf0; background: var(--page-bg); font: inherit; }
button { color: var(--page-bg); background: var(--accent); border-color: var(--accent); font-weight: 700; cursor: pointer; padding: 8px 16px; }

.button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 8px; padding: 7px 12px; border: 1px solid; border-radius: 9px; font: inherit; font-size: .9rem; font-weight: 700; text-decoration: none; cursor: pointer; transition: color .12s, background-color .12s, border-color .12s; }
.button[hidden] { display: none; }
.button--filled { border-color: var(--accent); color: var(--page-bg); background: var(--accent); }
.button--filled:hover, .button--filled:focus-visible { border-color: var(--accent-strong); color: var(--page-bg); background: var(--accent-strong); }
.button--outline { border-color: var(--outline); color: var(--accent); background: var(--surface); }
.button--outline:hover, .button--outline:focus-visible { border-color: var(--accent); color: var(--focus-text); background: var(--surface); }
.button--danger { border-color: #c84d54; color: #fff; background: #c84d54; }
.button--danger:hover, .button--danger:focus-visible { border-color: #e35d64; color: #fff; background: #e35d64; }
.button-icon { display: block; flex: 0 0 18px; width: 18px; height: 18px; background-color: currentColor; mask-position: center; mask-repeat: no-repeat; mask-size: contain; -webkit-mask-position: center; -webkit-mask-repeat: no-repeat; -webkit-mask-size: contain; }
.button-icon.icon-enter { mask-image: url('/lightyear/icons/channel-enter.svg'); -webkit-mask-image: url('/lightyear/icons/channel-enter.svg'); }
.button-icon.icon-exit { mask-image: url('/lightyear/icons/channel-exit.svg'); -webkit-mask-image: url('/lightyear/icons/channel-exit.svg'); }
.button-icon.icon-profile { mask-image: url('/lightyear/icons/profile.svg'); -webkit-mask-image: url('/lightyear/icons/profile.svg'); }
.button-icon.icon-statistics { mask-image: url('/lightyear/icons/statistics.svg'); -webkit-mask-image: url('/lightyear/icons/statistics.svg'); }

.table-wrap { max-width: 100%; overflow-x: auto; }
table.data-table, table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: .9rem; }
table.data-table th, table.data-table td, table th, table td { padding: 12px 16px; border-top: 1px solid #39444a; text-align: left; vertical-align: top; }
table.data-table th, table th { color: var(--muted); font-size: .76rem; font-weight: 700; white-space: nowrap; }
table.data-table td.number, table.data-table th.number, table td.number, table th.number { text-align: right; white-space: nowrap; }
table.data-table tbody tr:hover, table tbody tr:hover { background: #2b3439; }
.pill { display: inline-block; padding: 4px 8px; border: 1px solid #53646a; border-radius: 999px; color: #fff; font-size: .75rem; font-weight: 700; text-transform: uppercase; white-space: nowrap; }
.service-chip { max-width: 130px; }
.service-chip.service-color-0 { border-color: #f3d34a; background: #74621b; }
.service-chip.service-color-1 { border-color: #63d986; background: #285b38; }
.service-chip.service-color-2 { border-color: #ff7780; background: #77343b; }
.service-chip.service-color-3 { border-color: #78aef7; background: #244b78; }
.service-chip.service-color-4 { border-color: #f59bd0; background: #713d5c; }
.service-chip.service-color-5 { border-color: #b99bf5; background: #564078; }
.service-chip.service-color-6 { border-color: #e8d8a9; background: #75634a; }
.service-chip.service-color-7 { border-color: #929ba3; background: #41474d; }
.service-chip.service-color-8 { border-color: #ffa34d; background: #824617; }
.service-chip.service-color-9 { border-color: #63d8ef; background: #2d6977; }
.device-pie-slice.service-color-0 { fill: #f3d34a; }
.device-pie-slice.service-color-1 { fill: #63d986; }
.device-pie-slice.service-color-2 { fill: #ff7780; }
.device-pie-slice.service-color-3 { fill: #78aef7; }
.device-pie-slice.service-color-4 { fill: #f59bd0; }
.device-pie-slice.service-color-5 { fill: #b99bf5; }
.device-pie-slice.service-color-6 { fill: #e8d8a9; }
.device-pie-slice.service-color-7 { fill: #929ba3; }
.device-pie-slice.service-color-8 { fill: #ffa34d; }
.device-pie-slice.service-color-9 { fill: #63d8ef; }

.device-card { display: flex; align-items: center; gap: 20px; padding: 22px 24px; border: 1px solid color-mix(in srgb, var(--outline) 78%, transparent); border-radius: 18px; background: color-mix(in srgb, var(--page-bg) 72%, var(--surface)); }
.device-card.lightyear-device { display: grid; gap: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.lightyear-device-layout { display: grid; grid-template-columns: minmax(240px, .72fr) minmax(0, 1.28fr); align-items: start; gap: 24px; }
.lightyear-device-layout.statistics-hidden { grid-template-columns: minmax(0, 1fr); }
.lightyear-device-info { min-width: 0; padding: 20px 22px; }
.device-section { display: grid; gap: 14px; }
.device-section > .device-list { margin-top: 0; }
.legacy-heading { margin: 0; }
.lightyear-device-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.lightyear-device-info .device-action { margin-top: 0; }
.lightyear-device-info .device-model-chart { margin-top: 14px; padding: 8px 0; }
.device-service-panel { min-width: 0; overflow: hidden; border: 1px solid var(--outline); border-radius: 20px; background: color-mix(in srgb, var(--surface) 94%, transparent); }
.device-service-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 22px 14px; }
.device-service-heading h3 { margin: 0; color: var(--focus-text); font-size: 1.17rem; }
.device-service-panel .table-wrap { width: 100%; margin: 0; }
.device-service-panel > .muted { margin: 0; padding: 16px 22px 20px; }
.lightyear-extended-info[hidden], .device-service-panel[hidden] { display: none; }
.statistics-consent-dialog { width: min(560px, calc(100vw - 32px)); max-width: none; padding: 0; border: 1px solid var(--outline); border-radius: 20px; color: #e7edf0; background: var(--surface); box-shadow: 0 24px 80px rgba(0,0,0,.55); }
.statistics-consent-dialog::backdrop { background: rgba(0,0,0,.72); }
.statistics-consent-form { display: grid; gap: 20px; padding: 26px; }
.statistics-consent-form h2 { margin: 0 0 12px; color: var(--focus-text); font-size: 1.25rem; }
.statistics-consent-form p { margin: 0; color: var(--muted); line-height: 1.55; }
.statistics-consent-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.device-card > div { width: 100%; min-width: 0; }
.device-list { display: grid; gap: 14px; margin-top: 18px; }
.legacy-device-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.device-card-heading { display: flex; align-items: center; justify-content: flex-start; gap: 14px; }
.device-card p { margin: 8px 0 0; }
.device-card .device-statistics { max-width: 680px; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.device-card .favorite-service { margin-top: 14px; color: var(--focus-text); font-size: .95rem; font-weight: 700; }
.service-breakdown { display: grid; grid-template-columns: minmax(190px, .34fr) minmax(0, 1fr); align-items: stretch; gap: 20px; margin-top: 16px; }
.device-model-chart { display: grid; align-content: center; justify-items: center; gap: 18px; padding: 8px 12px; }
.device-pie { position: relative; display: grid; width: 172px; aspect-ratio: 1; place-items: center; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 10px 28px rgba(0,0,0,.24), inset 0 0 0 1px rgba(255,255,255,.08); }
.device-pie-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.device-pie-slice { cursor: pointer; stroke: var(--surface); stroke-width: 1; transition: filter .12s, transform .12s, stroke-width .12s; transform-box: view-box; transform-origin: 50% 50%; }
.device-pie-slice.is-active, .device-pie-slice:focus-visible { filter: brightness(1.2); stroke: #fff; stroke-width: 1.8; }
.device-pie-slice.is-active { transform: scale(1.035); }
.device-pie-slice:focus-visible { outline: none; }
.device-pie-center { position: absolute; display: grid; width: 88px; aspect-ratio: 1; align-content: center; justify-items: center; border: 1px solid var(--outline); border-radius: 50%; background: radial-gradient(circle at 35% 25%, #303a40, var(--surface) 72%); box-shadow: 0 3px 12px rgba(0,0,0,.3); pointer-events: none; }
.device-pie-center strong { color: #fff; font-size: 1.4rem; letter-spacing: -.04em; }
.device-pie-center span { margin-top: 2px; color: var(--muted); font-size: .68rem; }
.device-pie-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 7px 12px; margin: 0; padding: 0; list-style: none; }
.device-pie-legend li { display: flex; min-width: 0; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid rgba(255,255,255,.06); border-radius: 9px; background: rgba(255,255,255,.025); font-size: .78rem; }
.device-pie-legend li.is-active { background: #3b454b; color: #e7edf0; font-weight: 400; }
table.data-table tbody tr.is-active, table tbody tr.is-active { background: #3b454b; }
table.data-table tbody tr.is-active td, table tbody tr.is-active td { color: #fff; }
.device-pie-swatch { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--model-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--model-color) 18%, transparent); }
.device-pie-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-pie-value { color: #e7edf0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.device-pie-value small { margin-left: 3px; color: var(--muted); font-size: .68rem; }

@media (max-width: 940px) { .service-breakdown { grid-template-columns: 1fr; } .lightyear-device-layout { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .device-service-heading { align-items: flex-start; flex-direction: column; padding: 16px; } .statistics-consent-form { padding: 20px; } .statistics-consent-actions { justify-content: stretch; } .statistics-consent-actions .button { flex: 1; } }
@media (max-width: 760px) { .legacy-device-list { grid-template-columns: 1fr; } }
@media (max-width: 500px) { .device-pie-legend { grid-template-columns: 1fr; } }
