:root {
    color-scheme: light;
    --ink: #25243b;
    --muted: #666579;
    --accent: #5850b5;
    --line: #e1e0ec;
    --paper: #fff;
    --background: #f7f7fc;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--ink); font-family: 'Sarabun', sans-serif; font-size: 16px; line-height: 1.8; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; border-radius: 5px; }
img { display: block; max-width: 100%; }
p, h1, h2, h3, figure, dl, dd { margin: 0; }
[hidden] { display: none !important; }
.skip-link { position: absolute; top: -100px; left: 20px; z-index: 10; padding: 10px 20px; background: var(--paper); }
.skip-link:focus { top: 10px; }
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.header-inner { max-width: 1160px; min-height: 82px; margin: auto; padding: 16px 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 24px; font-weight: 700; letter-spacing: -.6px; }
.back-link { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; color: var(--muted); font-size: 14px; }
.page { max-width: 1160px; margin: auto; padding: 64px 32px 48px; }
.profile { display: grid; grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr); gap: 64px; align-items: center; }
.portrait { position: relative; border-radius: 24px; overflow: hidden; isolation: isolate; box-shadow: 0 18px 48px #26214015; }
.portrait > img { width: 100%; height: auto; }
.portrait figcaption { position: absolute; inset: auto 0 0; padding: 56px 28px 25px; color: #fff; background: linear-gradient(transparent, #191925d9); display: grid; gap: 2px; font-size: 14px; }
.portrait-label { font-size: 22px; font-weight: 600; }
.eyebrow { color: var(--accent); font-size: 14px; font-weight: 600; margin-bottom: 14px; }
h1 { font-size: clamp(32px, 3.7vw, 48px); line-height: 1.45; letter-spacing: -.8px; font-weight: 700; }
h1 span { display: block; }
.intro { margin-top: 17px; font-size: 21px; line-height: 1.65; }
.profile-description { color: var(--muted); margin-top: 14px; }
.profile-facts { margin-top: 27px; }
.profile-facts > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
dt { color: var(--muted); font-size: 14px; padding-top: 2px; }
dd { font-weight: 500; }
dd small { display: block; color: var(--muted); font-weight: 400; font-size: 14px; margin-top: 2px; }
.age-line { display: inline-block; margin-left: 12px; color: var(--accent); white-space: nowrap; }
#profile-age-as-of { font-size: 12px; }
.system-section { margin-top: 76px; padding-top: 45px; border-top: 1px solid var(--line); }
h2 { font-size: clamp(25px, 2.5vw, 31px); line-height: 1.6; font-weight: 600; }
.section-heading > p:last-child { max-width: 690px; margin-top: 12px; color: var(--muted); }
.system-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 35px; }
.item-number { display: block; color: var(--accent); font-size: 13px; font-weight: 600; letter-spacing: 2px; margin-bottom: 12px; }
h3 { font-size: 19px; line-height: 1.7; font-weight: 600; margin-bottom: 8px; }
.system-item p { color: var(--muted); font-size: 15px; }
.behind-section { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 56px; margin-top: 60px; padding: 36px; background: var(--paper); border: 1px solid var(--line); border-radius: 24px; align-items: center; }
.behind-copy > p:last-child { margin-top: 14px; color: var(--muted); font-size: 15px; }
.server-note { border-left: 1px solid var(--line); padding-left: 36px; }
.server-icon { color: var(--accent); margin-bottom: 16px; }
.server-label { font-size: 13px; color: var(--muted); }
.server-location { font-size: 26px; font-weight: 600; margin: 4px 0 10px; }
.server-note > p:last-child { font-size: 14px; color: var(--muted); }
.page-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 16px 26px; margin-top: 40px; }
.primary-link { display: inline-flex; align-items: center; justify-content: center; gap: 28px; padding: 12px 24px; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 600; }
.primary-link:hover { color: #fff; background: #443d93; }
.news-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; color: var(--muted); }
.site-footer { max-width: 1096px; margin: auto; padding: 24px 0 32px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px 24px; color: var(--muted); font-size: 13px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; }

.usage-stats { margin-top: 48px; padding-top: 36px; border-top: 1px solid var(--line); }
.usage-stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.usage-stats-grid > div { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); min-width: 0; }
.usage-stats-grid dt { font-size: 14px; }
.usage-stats-grid dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 9px; margin-top: 8px; }
.usage-stats-grid strong { font-size: clamp(25px, 2.8vw, 36px); line-height: 1.6; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--accent); overflow-wrap: anywhere; }
.usage-stats-grid dd span { color: var(--muted); font-size: 13px; }
.usage-stats-note { margin-top: 18px; color: var(--muted); font-size: 12px; }
.usage-stats-status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 10px; min-height: 44px; color: var(--muted); font-size: 12px; }
.usage-stats-status-row button { min-height: 44px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--accent); font: inherit; cursor: pointer; }
.usage-stats-status-row button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.usage-stats-status-row button:disabled { opacity: .6; cursor: wait; }

@media (max-width: 900px) {
    .usage-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .profile { gap: 32px; }
    .profile-facts > div { grid-template-columns: 1fr; gap: 2px; }
    .behind-section { gap: 32px; padding: 28px; }
    .server-note { padding-left: 28px; }
    .site-footer { margin-inline: 32px; }
}

@media (max-width: 640px) {
    .usage-stats { margin-top: 32px; padding-top: 28px; }
    .usage-stats-grid { gap: 10px; }
    .usage-stats-grid > div { padding: 14px 12px; }
    .header-inner { min-height: 72px; padding: 12px 20px; }
    .brand { font-size: 22px; }
    .brand img { width: 34px; height: 34px; }
    .back-link { font-size: 13px; }
    .page { padding: 28px 20px 32px; }
    .profile { grid-template-columns: 1fr; gap: 30px; }
    .portrait { width: 100%; max-width: 360px; margin: auto; border-radius: 20px; }
    .portrait figcaption { padding: 48px 22px 20px; }
    h1 { font-size: 36px; }
    h1 span { display: inline; }
    .intro { font-size: 20px; }
    .profile-facts > div { padding: 13px 0; }
    .system-section { margin-top: 36px; padding-top: 30px; }
    .system-grid { grid-template-columns: 1fr; gap: 25px; margin-top: 28px; }
    .item-number { margin-bottom: 6px; }
    .behind-section { grid-template-columns: 1fr; margin-top: 36px; padding: 24px; gap: 26px; border-radius: 20px; }
    .server-note { padding: 26px 0 0; border-left: 0; border-top: 1px solid var(--line); }
    .server-location { font-size: 24px; }
    .page-actions { margin-top: 30px; gap: 12px; }
    .primary-link { width: 100%; }
    .site-footer { margin-inline: 20px; padding-block: 22px; flex-direction: column; text-align: center; }
    .site-footer nav { justify-content: center; gap: 0 16px; }
}

@media (prefers-color-scheme: dark) {
    :root { color-scheme: dark; --ink: #eeedf7; --muted: #b1afc6; --accent: #b5adff; --line: #35334b; --paper: #222033; --background: #191825; }
    .primary-link { background: #6258bf; }
    .primary-link:hover { background: #756ace; }
}
