/* Tabfold's public pages (the Mx-Share board's "What people see"; 1.0: a folder's note, the privacy
   policy and terms). Light and dark follow the system. */

:root {
  color-scheme: light dark;
  --page: #f7f7f8;
  --bg-subtle: #f7f7f8;
  --surface: #ffffff;
  --hover: #f2f2f4;
  --border: #e6e6ea;
  --border-strong: #d4d4da;
  --text: #17171a;
  --text-2: #4c4c55;
  --text-3: #6b6b75;
  --accent: #4f5bd5;
  --accent-hover: #4350c4;
  --accent-text: #3f4bc2;
  --on-accent: #ffffff;
  --red: #c42f2a;
  --skeleton: #ededf0;
  --shadow: 0 1px 2px rgba(16, 16, 20, 0.04), 0 8px 24px rgba(16, 16, 20, 0.08);
  --mark: #fdf0c4;
  --mark-text: #6b4a00;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #111113;
    --bg-subtle: #17171a;
    --surface: #1a1a1e;
    --hover: #222227;
    --border: #28282e;
    --border-strong: #3a3a42;
    --text: #ededf0;
    --text-2: #b3b3bc;
    --text-3: #8e8e98;
    --accent: #5964da;
    --accent-hover: #6670e0;
    --accent-text: #a3aaf7;
    --red: #f27a75;
    --skeleton: #26262b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);
    --mark: #3d3214;
    --mark-text: #f5d77a;
  }
}

/* Chrome's tab group colours, for a folder's colour. */
.cg-grey { --cg: #5f6368; --cg-on: #ffffff; }
.cg-blue { --cg: #1a73e8; --cg-on: #ffffff; }
.cg-red { --cg: #d93025; --cg-on: #ffffff; }
.cg-yellow { --cg: #f9ab00; --cg-on: #202124; }
.cg-green { --cg: #188038; --cg-on: #ffffff; }
.cg-pink { --cg: #d01884; --cg-on: #ffffff; }
.cg-purple { --cg: #a142f4; --cg-on: #ffffff; }
.cg-cyan { --cg: #007b83; --cg-on: #ffffff; }
.cg-orange { --cg: #fa903e; --cg-on: #202124; }

@media (prefers-color-scheme: dark) {
  .cg-grey { --cg: #bdc1c6; --cg-on: #202124; }
  .cg-blue { --cg: #8ab4f8; --cg-on: #202124; }
  .cg-red { --cg: #f28b82; --cg-on: #202124; }
  .cg-yellow { --cg: #fdd663; --cg-on: #202124; }
  .cg-green { --cg: #81c995; --cg-on: #202124; }
  .cg-pink { --cg: #ff8bcb; --cg-on: #202124; }
  .cg-purple { --cg: #c58af9; --cg-on: #202124; }
  .cg-cyan { --cg: #78d9ec; --cg-on: #202124; }
  .cg-orange { --cg: #fcad70; --cg-on: #202124; }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

.offscreen {
  position: fixed;
  top: 0;
  left: -9999px;
  opacity: 0;
}

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

svg {
  flex: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sheet {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 16px 64px;
}

.card {
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

/* ---- Buttons ---- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.button.primary {
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
}

.button.primary:hover {
  background: var(--accent-hover);
}

.button.secondary {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.button.secondary:hover {
  background: var(--hover);
}

.button.small {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

/* ---- The shared folder ---- */

.head {
  padding: 20px 20px 8px;
}

.title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.folder-icon {
  display: flex;
  color: var(--cg);
}

.note {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.meta {
  margin: 4px 0 14px;
  font-size: 12px;
  color: var(--text-3);
}

.note + .meta {
  margin-top: 6px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.status {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-2);
}

.status:empty {
  display: none;
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 16px;
  border-top: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}

.row:hover {
  background: var(--hover);
}

.row:focus-visible {
  outline-offset: -2px;
}

.tile {
  width: 16px;
  height: 16px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--cg);
  color: var(--cg-on);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}

.text {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.page-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host {
  flex: none;
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-3);
}

.external {
  color: var(--text-3);
}

.empty {
  margin: 0;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
}

.foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}

.made {
  flex: 1;
  font-size: 12px;
  color: var(--text-2);
}

.logo {
  width: 20px;
  height: 20px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
}

.logo.big {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

/* ---- Other states ---- */

.notice {
  padding: 32px 24px;
  text-align: center;
}

.notice h1 {
  margin: 12px 0 6px;
  font-size: 18px;
  font-weight: 600;
}

.notice p {
  max-width: 420px;
  margin: 0 auto 18px;
  color: var(--text-2);
}

.notice .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--hover);
  color: var(--text-2);
}

.skeleton {
  padding: 20px;
}

.skeleton span {
  display: block;
  height: 12px;
  margin-bottom: 12px;
  border-radius: 6px;
  background: var(--skeleton);
}

.skeleton span:nth-child(1) { width: 40%; height: 20px; }
.skeleton span:nth-child(2) { width: 25%; }
.skeleton span:nth-child(3) { width: 90%; }
.skeleton span:nth-child(4) { width: 75%; }

/* ---- The home page ---- */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 40px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.home h1 {
  margin: 0 0 12px;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.home .lead {
  max-width: 560px;
  margin: 0 0 24px;
  font-size: 16px;
  color: var(--text-2);
}

.home .points {
  max-width: 560px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-2);
}

.home .points li {
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.home .points b {
  color: var(--text);
  font-weight: 600;
}

/* ---- The footer: the privacy policy and terms ---- */

.site-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  font-size: 12px;
  color: var(--text-3);
}

.site-foot a {
  color: var(--text-2);
  text-decoration: none;
}

.site-foot a:hover {
  color: var(--text);
  text-decoration: underline;
}

.sheet > .card + .site-foot,
.sheet > .notice + .site-foot {
  justify-content: center;
  margin-top: 20px;
}

/* ---- The privacy policy and terms ---- */

.doc {
  max-width: 720px;
}

.doc h1 {
  margin: 0 0 6px;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.doc .dated {
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--text-3);
}

.doc h2 {
  margin: 36px 0 8px;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 600;
}

.doc h3 {
  margin: 22px 0 6px;
  font-size: 15px;
  font-weight: 600;
}

.doc p,
.doc li {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-2);
}

.doc p {
  margin: 0 0 12px;
}

.doc ul {
  margin: 0 0 12px;
  padding-left: 22px;
}

.doc li {
  margin: 0 0 6px;
}

.doc b,
.doc strong {
  color: var(--text);
  font-weight: 600;
}

.doc code {
  font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--hover);
  color: var(--text);
}

.doc .summary {
  margin: 0 0 8px;
  padding: 16px 20px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
}

.doc .summary h2 {
  margin: 0 0 8px;
  font-size: 15px;
}

.doc .summary ul {
  margin: 0;
}

.doc .summary li:last-child {
  margin-bottom: 0;
}

.doc .table-wrap {
  margin: 4px 0 16px;
  overflow-x: auto;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
}

.doc th,
.doc td {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  color: var(--text-2);
}

.doc thead th {
  border-top: 0;
  background: var(--bg-subtle);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.doc td:first-child {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

/* What the owner fills in before publishing: hard to miss. */
.placeholder {
  padding: 0 3px;
  border-radius: 3px;
  background: var(--mark);
  color: var(--mark-text);
  font-weight: 600;
}

/* ---- Phones ---- */

@media (max-width: 600px) {
  .sheet {
    padding: 16px 16px 40px;
  }

  .head {
    padding: 16px 16px 4px;
  }

  .actions .button {
    flex: 1;
  }

  .text {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .host {
    max-width: none;
  }

  .foot {
    flex-wrap: wrap;
  }

  .made {
    flex-basis: calc(100% - 40px);
  }

  .foot .button {
    width: 100%;
  }

  .home h1 {
    font-size: 26px;
  }

  .doc h1 {
    font-size: 26px;
  }

  .doc td:first-child {
    white-space: normal;
  }

  .brand {
    margin-bottom: 28px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .skeleton span {
    animation: pulse 1.4s ease-in-out infinite;
  }

  @keyframes pulse {
    50% {
      opacity: 0.55;
    }
  }
}
