/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --surface: #f8f9fa;
  --border: #dee2e6;
  --text: #212529;
  --muted: #6c757d;
  --accent: #0d6efd;
  --accent-hover: #0a58ca;
  --radius: 8px;
  --max-w: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --surface: #1e1e1e;
    --border: #333;
    --text: #e0e0e0;
    --muted: #999;
    --accent: #4dabf7;
    --accent-hover: #74c0fc;
  }
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: underline; }
a:hover { color: var(--accent-hover); }

.skip {
  position: absolute; left: -9999px;
  &:focus { left: 1rem; top: 1rem; padding: .5rem 1rem; background: var(--accent); color: #fff; border-radius: var(--radius); text-decoration: none; }
}

/* Main */
main {
  flex: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

h1 { font-size: 1.75rem; margin-bottom: .5rem; }
h2 { font-size: 1.15rem; margin-top: 2rem; margin-bottom: .5rem; }
p { margin-bottom: .75rem; }
ul { padding-left: 1.5rem; margin-bottom: .75rem; }
li { margin-bottom: .25rem; }

/* Homepage app list */
.app-list {
  list-style: none;
  padding: 0;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.app-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.app-name { font-weight: 600; }
.app-card-links { display: flex; gap: 1rem; flex-shrink: 0; }
.app-link { font-size: .875rem; color: var(--accent); text-decoration: none; }
.app-link:hover { color: var(--accent-hover); text-decoration: underline; }

/* Policy article */
.policy { max-width: 100%; }
.meta { color: var(--muted); font-size: .9rem; margin-bottom: 1.25rem; }
.app-description { font-style: italic; color: var(--muted); margin-bottom: 1.5rem; }
.outro { margin-top: .5rem; font-size: .925rem; color: var(--muted); }

/* App hero banner */
.app-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}
.app-hero-icon { font-size: 2.25rem; line-height: 1; flex-shrink: 0; }
.app-hero-name { font-size: 1.5rem; font-weight: 700; margin: 0; line-height: 1.2; }
.app-hero-sub { font-size: .875rem; color: var(--muted); margin: .2rem 0 0; }

/* Accent-tinted h2 for branded pages */
html[style] .policy h2 {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
  padding-bottom: .25rem;
}

/* Table */
.table-wrap {
  overflow-x: auto;
  margin-bottom: .75rem;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .925rem;
}
th, td {
  text-align: left;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
}
th {
  background: var(--surface);
  font-weight: 600;
}
tr:nth-child(even) td { background: color-mix(in srgb, var(--surface) 50%, transparent); }

/* Definition list (network access etc.) */
dl { margin-bottom: .75rem; }
dt {
  font-weight: 600;
  margin-top: .75rem;
}
dd {
  margin-left: 1.5rem;
  color: var(--text);
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
  text-align: center;
  font-size: .8rem;
  color: var(--muted);
}

code { font-family: monospace; background: var(--surface); padding: .1em .3em; border-radius: 4px; }

/* Alert banners */
.alert {
  padding: .85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: .925rem;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
@media (prefers-color-scheme: dark) {
  .alert-success { background: #064e3b; color: #a7f3d0; border-color: #059669; }
  .alert-error   { background: #7f1d1d; color: #fca5a5; border-color: #dc2626; }
}

/* Support form */
.support-form { margin-top: 1.5rem; }
.field { margin-bottom: 1.25rem; display: flex; flex-direction: column; gap: .35rem; }
.field label { font-weight: 600; font-size: .925rem; }
.req { color: #dc2626; }
.field input,
.field select,
.field textarea {
  padding: .6rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.field textarea { resize: vertical; }
.hp { display: none; }
.btn {
  display: inline-flex;
  align-items: center;
  padding: .65rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: var(--accent-hover); }
