:root { color-scheme: dark light; --hero-h: 3rem; }
* { box-sizing: border-box; }
body {
  margin: 0; padding: 2rem 1.5rem 4rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #0f172a; color: #e2e8f0;
}
@media (prefers-color-scheme: light) {
  body { background: #f1f5f9; color: #1e293b; }
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: none; margin: 0 auto; }

.hero { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.75rem; }
.clock {
  display: flex; flex-direction: row; align-items: center; justify-content: center;
  flex: 0 1 auto; min-width: 0; height: var(--hero-h); padding: 0 1.25rem; border-radius: 12px;
  white-space: nowrap;
  background: #1e293b; border: 1px solid #27364d;
}
.clock-txt { display: flex; align-items: baseline; gap: .55rem; min-width: 0; }
.clock-time { font-size: 1.35rem; font-weight: 700; letter-spacing: .03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.clock-date { font-size: .82rem; opacity: .75; white-space: nowrap; }
.gsearch { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-width: 0; }
.gsearch form { display: flex; gap: .5rem; width: min(420px, 100%); }
.gsearch input[type="search"] {
  flex: 1; min-width: 0; width: 100%; height: var(--hero-h); padding: 0 1.1rem; border-radius: 999px;
  border: 1px solid #334155; background: #1e293b; color: inherit;
  font-size: 1rem; outline: none;
}
.gsearch input[type="search"]:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
.weather {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  flex: 0 1 auto; min-width: 0; height: var(--hero-h); padding: 0 1.25rem; border-radius: 12px;
  white-space: nowrap;
  background: #1e293b; border: 1px solid #27364d;
}
.weather-state { font-size: .8rem; opacity: .6; text-align: center; }
.weather-data:not([hidden]) { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.weather-ic { display: flex; width: 26px; height: 26px; flex: none; color: #e2e8f0; }
.weather-ic svg { width: 100%; height: 100%; }
.weather-txt { display: flex; flex-direction: row; align-items: baseline; gap: .5rem; line-height: 1.25; min-width: 0; }
.weather-cond { font-size: .8rem; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.weather-temp { font-size: .95rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }

.quicklinks { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-bottom: 2rem; }
.qlink {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem;
  aspect-ratio: 1 / 1; width: 112px; flex: none; padding: .6rem;
  border-radius: 14px; text-decoration: none; color: inherit;
  background: #1e293b; border: 1px solid #27364d;
  transition: border-color .15s, transform .15s;
}
.qlink:hover { border-color: #38bdf8; transform: translateY(-2px); }
.qlink:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
.qlink svg, .qlink .qlink-mark { width: 40px; height: 40px; flex: none; fill: #e2e8f0; }
.qlink svg.stroke path { fill: none; stroke: #e2e8f0; stroke-width: 1.6; stroke-linejoin: round; }
.qlink .qlink-mark { display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.25rem; letter-spacing: .02em; fill: none; }
.qlink > span:last-child { font-size: .8rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.tabs-label-row { display: flex; align-items: center; gap: .75rem; margin: 2rem 0 1rem; flex-wrap: wrap; }
.tabs-label { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .08em; opacity: .65; margin: 0; padding-bottom: 0; border-bottom: none; }
.tabs { display: inline-flex; gap: .3rem; }
.tabs input[type="radio"] { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; pointer-events: none; }
.tabs label { padding: .45rem 1.1rem; border-radius: 999px; border: 1px solid #334155; font-size: .85rem; font-weight: 700; letter-spacing: .03em; cursor: pointer; user-select: none; }
#tab-public:checked ~ label[for="tab-public"],
#tab-internal:checked ~ label[for="tab-internal"] { background: #38bdf8; border-color: #38bdf8; color: #0f172a; }
#tab-public:focus-visible ~ label[for="tab-public"],
#tab-internal:focus-visible ~ label[for="tab-internal"] { outline: 2px solid #38bdf8; outline-offset: 2px; }
.sf {
  width: min(260px, 100%); padding: .5rem .95rem; margin-left: auto;
  border-radius: 999px; border: 1px solid #334155; background: #1e293b; color: inherit;
  font-size: .88rem; outline: none;
}
.sf:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }

h2 {
  font-size: 1.02rem; text-transform: uppercase; letter-spacing: .08em;
  opacity: .65; margin: 1.75rem 0 .75rem; padding-bottom: .35rem;
  border-bottom: 1px solid #334155;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: .75rem; }
a.card {
  display: flex; flex-direction: column; padding: .8rem .9rem .7rem; border-radius: 12px;
  background: #1e293b; text-decoration: none; color: inherit;
  border: 1px solid #27364d; transition: border-color .15s, transform .15s;
}
a.card:hover { border-color: #38bdf8; transform: translateY(-1px); }
a.card:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
.card .top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card .name { font-weight: 700; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge {
  font-size: .62rem; font-weight: 700; letter-spacing: .04em; padding: .13rem .5rem;
  border-radius: 999px; white-space: nowrap; flex: none;
}
.badge.public { background: #14532d; color: #bbf7d0; }
.badge.lan { background: #1e3a8a; color: #bfdbfe; }
.card .host { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .68rem; opacity: .55; margin-top: .25rem; word-break: break-all; overflow-wrap: anywhere; }
.card .desc { font-size: .78rem; opacity: .8; margin-top: auto; padding-top: .45rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.tab-intro { margin: 0 0 1rem; font-size: .85rem; opacity: .6; line-height: 1.45; }
.card[data-hidden] { display: none; }
[data-group][data-hidden="1"] { display: none; }
body:has(#tab-public:checked) .tab-internal { display: none; }
body:has(#tab-internal:checked) .tab-internal { display: block; }
body:has(#tab-internal:checked) section[data-tab="public"] { display: none; }
body:has(#tab-internal:checked) .tab-internal[data-hidden="1"] { display: none; }

footer { margin-top: 3rem; font-size: .78rem; opacity: .5; line-height: 1.5; max-width: 800px; }
footer a { color: inherit; }

@media (prefers-color-scheme: light) {
  .clock, .weather { background: #fff; border-color: #e2e8f0; }
  .gsearch input[type="search"] { border-color: #cbd5e1; background: #fff; }
  .weather-ic { color: #1e293b; }
  .qlink, a.card { background: #fff; border-color: #e2e8f0; }
  .qlink svg { fill: #1e293b; }
  .qlink svg.stroke path { stroke: #1e293b; }
  .qlink .qlink-mark { color: #1e293b; }
  .gsearch input[type="search"]:focus-visible,
  .sf:focus-visible,
  .qlink:focus-visible,
  a.card:focus-visible,
  #tab-public:focus-visible ~ label[for="tab-public"],
  #tab-internal:focus-visible ~ label[for="tab-internal"] { outline-color: #1d4ed8; }
  .tabs label { border-color: #cbd5e1; color: #1e293b; }
  #tab-public:checked ~ label[for="tab-public"],
  #tab-internal:checked ~ label[for="tab-internal"] { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
  .sf { border-color: #cbd5e1; background: #fff; }
  h2 { border-color: #e2e8f0; }
  .badge.public { background: #dcfce7; color: #166534; }
  .badge.lan { background: #dbeafe; color: #1d4ed8; }
}
@media (max-width: 900px) {
  .hero { flex-wrap: wrap; }
  .clock { order: 1; flex: 1 1 auto; }
  .weather { order: 2; flex: 1 1 auto; }
  .gsearch { order: 3; flex: 1 1 100%; }
  .gsearch form { width: 100%; }
  .qlink { width: 96px; }
}
@media (max-width: 520px) {
  .hero { gap: .5rem; }
  .clock, .weather { flex: 1 1 100%; }
  .qlink { width: 84px; }
  .tabs-label-row { gap: .5rem; }
  .sf { margin-left: 0; order: 3; width: 100%; }
}
