:root {
  --coral: #e07a5f;
  --cream: #fff7f0;
  --surface: #fffbf8;
  --text: #4a3f35;
  --muted: #8a7b72;
  --err: #b42318;
  --line: #ead9cc;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--cream);
  color: var(--text);
}

body {
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}

body:not(.page) {
  display: flex;
  align-items: center;
  justify-content: center;
}

.shell {
  width: min(360px, 100%);
}

.wrap {
  width: min(480px, 100%);
  margin: 0 auto;
}

.wrap.wide {
  width: min(640px, 100%);
}

.page-title {
  margin: 0 0 4px;
  font-size: 1.4rem;
}

.hostline {
  margin: 0 0 16px;
}

.ok-msg {
  color: #2f6f4e;
  margin: 0 0 12px;
}

.modules {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: 0;
  cursor: pointer;
}

.check input {
  width: 22px;
  min-height: 22px;
  margin: 0;
  accent-color: var(--coral);
}

.note {
  margin: 12px 0 0;
  font-size: 0.85rem;
}

.refresh-row {
  margin-bottom: 16px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 520px) {
  .grid2 { grid-template-columns: 1fr; }
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: var(--cream);
  border-radius: 12px;
}

.stat-l { color: var(--muted); font-size: 0.85rem; }
.stat-v { font-size: 1.6rem; font-weight: 700; }
.stat-s { color: var(--muted); font-size: 0.85rem; }
.stat-v.ok, .pressure.ok, .dot.ok { color: #2f6f4e; }
.stat-v.warn, .pressure.warn { color: #a15c12; }
.stat-v.bad, .pressure.bad, .dot.bad { color: var(--err); }
.dot.warn { color: #a15c12; }

.pressure {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trow {
  display: grid;
  grid-template-columns: 16px 1fr auto auto auto;
  gap: 8px;
  align-items: center;
  font-size: 0.92rem;
}

.dot::before {
  content: '●';
  font-size: 0.75rem;
}

.tname { font-weight: 600; }
.tmeta { color: var(--muted); text-align: right; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.top h1 {
  margin: 0;
  font-size: 1.35rem;
}

.back {
  color: var(--coral);
  text-decoration: none;
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.session-hint {
  margin: 0 0 16px;
  font-size: 0.85rem;
}

label {
  display: block;
  margin: 14px 0 6px;
  font-size: 0.95rem;
}

label:first-of-type,
.card form label:first-of-type {
  margin-top: 0;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
}

input:focus {
  outline: 2px solid var(--coral);
  outline-offset: 1px;
}

button {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  border: 0;
  border-radius: 14px;
  background: var(--coral);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 650;
  cursor: pointer;
}

button.ghost {
  background: transparent;
  color: var(--coral);
  box-shadow: inset 0 0 0 1.5px var(--coral);
}

button.small {
  width: auto;
  min-height: 44px;
  margin-top: 0;
  padding: 0 14px;
  font-size: 0.95rem;
}

button.danger {
  color: var(--err);
  box-shadow: inset 0 0 0 1.5px var(--err);
}

.card {
  padding: 20px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(74, 63, 53, 0.08);
  margin-bottom: 20px;
}

.card-title {
  margin: 0 0 14px;
  font-size: 1.1rem;
}

.muted {
  color: var(--muted);
  line-height: 1.4;
}

.empty {
  text-align: center;
  padding: 12px 0;
}

.err {
  margin: 0 0 12px;
  text-align: center;
  color: var(--err);
  font-size: 0.95rem;
}

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

.server-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  min-height: 56px;
  background: var(--surface);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 16px rgba(74, 63, 53, 0.06);
}

.server-name {
  font-weight: 650;
}

.server-host {
  color: var(--muted);
  font-size: 0.9rem;
}

.meta {
  margin: 0 0 12px;
}

.meta div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.meta dt {
  color: var(--muted);
}

.meta dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
