:root {
  --server-safe-top: env(safe-area-inset-top, 0px);
  --server-safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
  --canvas: #000; --surface: #0d0d0f; --text: #f5f5f7;
  --muted: #a5a5ab; --line: rgba(255, 255, 255, .16);
  --accent: #51cedf; --accent-soft: rgba(81, 206, 223, .14);
}
.monitor-control { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; padding:12px; margin:8px 0; border:1px solid var(--line); border-radius:12px; text-align:left; }
.monitor-control > div { min-width:0; }
.monitor-control strong { display:block; font-size:14px; }
.monitor-control small { display:block; font-size:12px; color:var(--muted); }
.monitor-control button { flex:none; min-width:66px; min-height:44px; padding:8px 12px; border:1px solid var(--line); border-radius:24px; color:var(--text); background:var(--canvas); font:inherit; font-size:14px; font-weight:700; cursor:pointer; }
.monitor-control button[aria-checked="true"] { background:var(--accent-soft); border-color:var(--accent); color:var(--accent); }
.monitor-control button:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.monitor-control button:disabled { opacity:.65; cursor:wait; }
.monitor-scope-note { width:100%; font-size:12px!important; text-align:left; }
.monitor-overview-link { display:block; }
.overview-card > .monitor-control { margin:10px 0 0; padding:10px 0 0; border:0; border-top:1px solid var(--line); border-radius:0; }
.overview-card[data-monitor-enabled="false"] > .monitor-overview-link { opacity:.55; }
.server-panel[data-monitor-enabled="false"] > .server-toolbar .server-badge { display:none; }
.server-panel[data-monitor-enabled="false"] > #steamUpdated,
.server-panel[data-monitor-enabled="false"] > #patchUpdated,
.server-panel[data-monitor-enabled="false"] > #gameMaintenanceSummary { display:none; }
.server-panel[data-monitor-enabled="false"] > .steam-store-list,
.server-panel[data-monitor-enabled="false"] > .game-list { opacity:.55; }
/* APK rootView already reserves status/navigation bar insets. */
html[data-native-insets="true"] { --server-safe-top: 0px; --server-safe-bottom: 0px; }
html[data-theme="light"] {
  color-scheme: light;
  --canvas: #f3f3f5; --surface: #fff; --text: #17171b;
  --muted: #6f7079; --line: #d9d9df;
  --accent: #107e91; --accent-soft: rgba(16, 126, 145, .1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--canvas); color: var(--text); }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-wrap: anywhere; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.server-shell {
  width: min(760px, 100%); min-height: 100svh; margin: auto;
  padding: max(4px, var(--server-safe-top)) max(18px, env(safe-area-inset-right))
    calc(104px + var(--server-safe-bottom)) max(18px, env(safe-area-inset-left));
}
.server-header { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 8px; }
.server-back { display: grid; place-items: center; min-height: 48px; border-radius: 14px; }
.server-header h1 { margin: 0; text-align: center; font-size: 23px; line-height: 1.3; letter-spacing: -.035em; }
.server-content { margin-top: 12px; }
.server-panel { display: flex; flex-direction: column; align-items: center; padding: 14px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-align: center; }
.server-symbol { display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: 22px; border-radius: 22px; color: var(--accent); background: var(--accent-soft); }
.server-symbol svg { width: 36px; height: 36px; }
.server-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 3px 11px; border-radius: 20px; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--canvas); }
.server-panel h2 { margin: 12px 0 6px; font-size: clamp(22px, 5vw, 27px); letter-spacing: -.035em; }
.server-panel p { margin: 0; color: var(--muted); font-size: 15px; }
.server-note { width: 100%; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.steam-store-list { list-style: none; width: 100%; margin: 18px 0 0; padding: 0; text-align: left; }
.steam-store-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.steam-store-list strong { flex: none; font-size: 13px; color: var(--accent); }
.steam-store-info { min-width: 0; flex: 1; }
.steam-account-help { color: var(--muted); font-size: 12px; line-height: 1.6; text-align: left; margin: 0; }
.steam-account-heading { display: flex; align-items: center; gap: 6px; min-width: 0; }
.steam-store-title { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.steam-account-badge { flex: none; max-width: 42%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; }
.steam-account-badge[data-account="match"] { color: var(--accent); }
.steam-account-badge[data-account="mismatch"], .steam-account-badge[data-account="duplicate"] { color: #ff9c9c; }
html[data-theme="light"] .steam-account-badge[data-account="mismatch"], html[data-theme="light"] .steam-account-badge[data-account="duplicate"] { color: #b42332; }
.steam-account-detail { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.6; white-space: nowrap; overflow-x: auto; scrollbar-width: thin; }
.steam-account-time { flex: none; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
#steamStores > li { display: grid; grid-template-columns: minmax(0, 1fr) 92px; }
#steamStores > li > strong { text-align: right; }
#steamStores .steam-account-heading { display: grid; grid-template-columns: minmax(0, 220px) minmax(100px, 160px) 76px minmax(0, 1fr); column-gap: 16px; }
#steamStores .steam-account-name { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
#steamStores .steam-account-badge { justify-self: start; max-width: 100%; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.5; }
@media (max-width: 900px) {
  #steamStores .steam-account-heading { grid-template-columns: minmax(0, 1fr) 64px; gap: 5px 8px; }
  #steamStores .steam-account-badge { grid-column: 1 / -1; }
  #steamStores .steam-account-name { grid-column: 1; grid-row: 2; }
  #steamStores .steam-account-time { grid-column: 2; grid-row: 1; }
}
.steam-store-list [data-status="offline"] strong { color: #ef8585; }
html[data-theme="light"] .steam-store-list [data-status="offline"] strong { color: #b42332; }
.steam-store-list [data-status="pending"] strong, .steam-store-list [data-status="stale"] strong { color: var(--muted); }
#refreshSteam { margin-top: 14px; min-height: 44px; padding: 8px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.server-navigation {
  position: fixed; z-index: 40; inset: auto 0 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px;
  width: 100%; padding: 5px max(8px, env(safe-area-inset-right))
    max(5px, var(--server-safe-bottom)) max(8px, env(safe-area-inset-left));
  border-top: 1px solid var(--line); background: var(--surface);
  box-shadow: 0 -10px 30px rgba(15, 38, 66, .16); backdrop-filter: blur(18px);
}
.server-navigation a { display: grid; place-items: center; gap: 1px; min-width: 0; min-height: 52px; padding: 5px 2px; border-radius: 10px; color: var(--muted); text-align: center; font-size: 9px; font-weight: 800; line-height: 1.2; }
.server-navigation a > span { font-size: 9px; font-weight: 800; line-height: 1.2; }
.server-navigation a[aria-current="page"] { color: #b7edca; background: #183724; }
.server-navigation svg { display: block; width: 19px; height: 19px; }
.server-navigation a[href="/"] svg { width: 24px; height: 24px; }
.server-toolbar { width: 100%; display: flex; align-items: center; gap: 8px; text-align: left; }
.server-toolbar .server-symbol { width: 30px; height: 30px; flex: none; margin: 0; border-radius: 8px; }
.server-toolbar .server-symbol svg { width: 20px; height: 20px; }
.server-toolbar-title { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; flex-wrap: wrap; }
.server-toolbar h2 { margin: 0; font-size: 17px; line-height: 1.3; }
.server-toolbar .server-badge { min-height: 22px; padding: 2px 6px; font-size: 10px; }
.server-toolbar #refreshSteam, .server-toolbar #refreshPatch { flex: none; margin: 0; min-height: 44px; padding: 5px 8px; font-size: 12px; }
.server-panel > p { width: 100%; margin-top: 6px; font-size: 12px; text-align: left; }
.server-panel .steam-store-list { margin-top: 8px; }
.server-panel .server-note { margin-top: 16px; padding-top: 12px; font-size: 12px; }
#patchStores > li { display: grid; grid-template-columns: 220px 76px minmax(0, 1fr) 92px; column-gap: 16px; min-height: 49px; }
#patchStores li > span { min-width: 0; }
#patchStores .patch-store-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#patchStores .patch-store-time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
#patchStores .patch-store-detail { color: var(--muted); font-size: 11px; line-height: 1.5; }
#patchStores > li > strong { text-align: right; white-space: nowrap; }
@media (max-width: 900px) {
  #patchStores > li { grid-template-columns: minmax(0, 1fr) 64px 92px; gap: 5px 8px; }
  #patchStores .patch-store-time { text-align: right; }
  #patchStores .patch-store-detail { grid-column: 1 / -1; grid-row: 2; }
  #patchStores .patch-store-detail:empty { display: none; }
  #patchStores > li > strong { grid-column: 3; grid-row: 1; }
}
#steamStores > li > strong, #patchStores > li > strong {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  width: 92px; min-height: 28px; padding: 3px 6px; border: 1px solid #57524b; border-radius: 6px;
  background: #292724; color: #aaa39a; font-size: 12px; line-height: 1.4; white-space: nowrap;
}
#steamStores > li > strong::before, #patchStores > li > strong::before {
  content: '·'; display: inline-grid; place-items: center; flex: none; width: 14px; height: 14px;
  font-size: 12px; font-weight: 800; line-height: 1;
}
#steamStores > li[data-status="online"] > strong, #patchStores > li[data-status="online"] > strong {
  background: #35322e; color: #e2dbd1; border-color: #686055;
}
#steamStores > li[data-status="online"] > strong::before, #patchStores > li[data-status="online"] > strong::before { content: '✓'; }
#steamStores > li[data-status="offline"] > strong, #patchStores > li[data-status="offline"] > strong {
  background: #502824; color: #ffb7ad; border-color: #a55c51;
}
#steamStores > li[data-status="offline"] > strong::before, #patchStores > li[data-status="offline"] > strong::before {
  content: '!'; border: 1px solid currentColor; border-radius: 50%; font-size: 10px;
}
html[data-theme="light"] #steamStores > li > strong, html[data-theme="light"] #patchStores > li > strong {
  background: #f3f1ee; color: #6f685f; border-color: #d9d3cb;
}
html[data-theme="light"] #steamStores > li[data-status="online"] > strong, html[data-theme="light"] #patchStores > li[data-status="online"] > strong {
  background: #eeeae4; color: #494239; border-color: #c9c0b4;
}
html[data-theme="light"] #steamStores > li[data-status="offline"] > strong, html[data-theme="light"] #patchStores > li[data-status="offline"] > strong {
  background: #f9e4e1; color: #a32923; border-color: #dfa49c;
}
#refreshPatch { margin-top: 14px; min-height: 44px; padding: 8px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
html[data-theme="light"] .server-navigation a[aria-current="page"] { color: #155f3e; background: #e1f3eb; }
.server-overview-link { display: grid; place-items: center; min-height: 44px; font-size: 12px; color: var(--accent); }
#serverHome { align-items: stretch; padding: 0; border: 0; background: transparent; text-align: left; gap: 10px; }
.overview-heading, .overview-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#serverHome h2 { margin: 0; font-size: 18px; }
#serverHome .overview-heading p { font-size: 12px; margin: 2px 0 0; }
#refreshOverview { flex: none; min-height: 44px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface); font: inherit; font-size: 12px; cursor: pointer; }
.overview-card { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.overview-card h3 { margin: 0; font-size: 17px; }
.overview-card-heading > span { font-size: 11px; color: var(--accent); }
#serverHome .overview-scope { font-size: 11px; margin-top: 2px; }
.overview-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 10px 0 8px; }
.overview-metrics > div { display: grid; gap: 0; text-align: center; border-right: 1px solid var(--line); }
.overview-metrics > div:last-child { border: 0; }
.overview-metrics strong { font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.overview-metrics span { font-size: 11px; color: var(--muted); }
.overview-alert strong { color: #ef8585; }
html[data-theme="light"] .overview-alert strong { color: #b42332; }
#serverHome .overview-attention, #serverHome .overview-detail { font-size: 12px; margin-top: 6px; }
#serverHome .overview-attention { color: var(--text); }
#serverHome .overview-time { border-top: 1px solid var(--line); padding-top: 7px; margin-top: 8px; font-size: 10px; }
#serverHome .overview-footnote { font-size: 11px; margin: 0; }
@media (max-height: 500px) {
  .server-content { margin-top: 8px; }
  .server-panel { padding: 12px; }
}
@media (max-height: 520px) and (max-width: 960px) {
  .server-navigation a { min-height: 36px; }
}
/* Match the inventory desktop breakpoints; APK and mobile keep their bottom bar. */
.server-desktop-brand, .server-desktop-label { display: none; }
@media (min-width: 761px) {
  html:not([data-native-insets="true"]) { --server-sidebar-width: 76px; }
  html:not([data-native-insets="true"]) body { padding-left: var(--server-sidebar-width); }
  html:not([data-native-insets="true"]) .server-shell {
    width: min(100%, 1060px); padding-top: 16px; padding-bottom: 24px;
  }
  html:not([data-native-insets="true"]) nav.server-navigation {
    inset: 0 auto 0 0; width: var(--server-sidebar-width); height: 100dvh;
    grid-template-columns: minmax(0, 1fr); align-content: start; gap: 8px;
    padding: 28px 8px; overflow-y: auto;
    border-top: 0; border-right: 1px solid var(--line); box-shadow: none;
  }
  html:not([data-native-insets="true"]) .server-navigation a {
    min-height: 60px; padding: 8px 2px; gap: 5px; font-size: 11px;
  }
  html:not([data-native-insets="true"]) .server-navigation a > span { font-size: 11px; }
  html:not([data-native-insets="true"]) .server-navigation svg { width: 24px; height: 24px; }
}
@media (min-width: 761px) {
  html:not([data-native-insets="true"]) nav.server-navigation {
    --nav-bg: #0a0a0b; --nav-line: #2b2b2f; --nav-hover: #202026;
    --nav-icon-bg: #151518; --nav-icon-line: #34343a; --nav-green: #66d594;
    background: var(--nav-bg); border-color: var(--nav-line); padding-inline: 12px;
  }
  html[data-theme="light"]:not([data-native-insets="true"]) nav.server-navigation {
    --nav-bg: #e9e9ed; --nav-line: #d9d9df; --nav-hover: #f0f0f3;
    --nav-icon-bg: rgba(255,255,255,.62); --nav-icon-line: #d9d9df; --nav-green: #16845b;
  }
  html:not([data-native-insets="true"]) .server-desktop-brand {
    display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 0 22px;
  }
  .server-desktop-mark { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border-radius: 12px; background: #66d594; color: #06120a; font-size: 19px; font-weight: 900; }
  .server-desktop-brand-copy { display: none; min-width: 0; }
  .server-desktop-brand-copy strong { display: block; white-space: nowrap; color: var(--text); font-size: 17px; font-weight: 900; letter-spacing: -.03em; }
  .server-desktop-brand-copy small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 650; }
  html:not([data-native-insets="true"]) .server-desktop-label {
    display: block; height: 1px; overflow: hidden; color: transparent; margin: 10px 5px 4px; border-top: 1px solid var(--nav-line);
  }
  html:not([data-native-insets="true"]) .server-navigation a {
    position: relative; min-height: 58px; border: 1px solid transparent; border-radius: 12px;
    font-weight: 700; transition: border-color .16s ease, background .16s ease, color .16s ease;
  }
  html:not([data-native-insets="true"]) .server-navigation a:hover { background: var(--nav-hover); border-color: var(--nav-icon-line); }
  html:not([data-native-insets="true"]) .server-navigation a::before {
    content: ''; position: absolute; left: 0; top: 50%; width: 3px; height: 24px;
    border-radius: 0 3px 3px 0; background: var(--nav-green); transform: translateY(-50%); opacity: 0;
  }
  html:not([data-native-insets="true"]) .server-navigation a[aria-current="page"]::before { opacity: 1; }
  html:not([data-native-insets="true"]) .server-navigation a:focus-visible { outline: 3px solid rgba(36,107,254,.35); outline-offset: 2px; }
  html:not([data-native-insets="true"]) .server-navigation a svg {
    width: 34px; height: 34px; padding: 6px; border: 1px solid var(--nav-icon-line); border-radius: 10px; background: var(--nav-icon-bg);
  }
}
@media (min-width: 1051px) {
  html:not([data-native-insets="true"]) nav.server-navigation { padding-inline: 22px; }
  html:not([data-native-insets="true"]) .server-desktop-brand { justify-content: flex-start; padding-inline: 6px; }
  html:not([data-native-insets="true"]) .server-desktop-brand-copy { display: block; }
  html:not([data-native-insets="true"]) .server-desktop-label {
    height: auto; margin: 10px 8px 0; padding: 14px 6px 4px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em;
  }
  html:not([data-native-insets="true"]) .server-navigation a { grid-template-columns: 34px minmax(0,1fr); grid-template-rows: auto auto; gap: 2px 10px; padding: 8px 10px; justify-items: start; text-align: left; }
  html:not([data-native-insets="true"]) .server-navigation a svg { grid-row: 1 / 3; align-self: center; }
  html:not([data-native-insets="true"]) .server-navigation a > span { align-self: end; font-size: 13px; font-weight: 820; }
  html:not([data-native-insets="true"]) .server-navigation a::after { content: attr(data-description); grid-column: 2; align-self: start; color: var(--muted); font-size: 10px; font-weight: 650; line-height: 1.2; white-space: nowrap; }
  html:not([data-native-insets="true"]) .server-navigation a[href="/"]::after { content: '통합 업무 홈'; }
}
@media (min-width: 1051px) {
  html:not([data-native-insets="true"]) { --server-sidebar-width: 230px; }
  html:not([data-native-insets="true"]) nav.server-navigation { padding: 30px 22px; }
}
