/* Read-only share links.
   Owned by the sharing workstream. Every colour is a custom property from
   app.css, so light and dark mode both work and nothing here is hard-coded.
   All class names are prefixed `sh-` so they cannot collide with the shared
   design system or another workstream's stylesheet. */

/* ---------- the shared diagram page ---------- */

/* The mount is `.landing`, a document that scrolls with the window rather
   than the height-constrained application shell, so the page sizes itself. */
.sh-page {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 40px;
  display: grid;
  gap: 16px;
}

.sh-head { display: grid; gap: 8px; }

.sh-head-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sh-brand {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .01em;
  color: var(--ink-2);
}

/* The one label a visitor must not be able to miss: this is somebody else's
   estate, and they are a reader of it. */
.sh-pill {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.sh-title { font-size: 24px; margin: 0; }

.sh-note {
  max-width: 68ch;
  font-size: 13px;
  line-height: 1.55;
}

.sh-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 24px;
  margin: 4px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.sh-facts dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

.sh-facts dd {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink);
  overflow-wrap: break-word;
}

/* ---------- controls ---------- */

.sh-controls {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.sh-control { display: flex; align-items: center; gap: 8px; }

.sh-control label {
  font-size: 12px;
  color: var(--muted);
}

.sh-control select {
  font: inherit;
  font-size: 12px;
  padding: 5px 8px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.sh-zoom { display: flex; gap: 6px; margin-left: auto; }

.sh-zoom-btn { min-width: 38px; }

.sh-hint {
  flex-basis: 100%;
  margin: 0;
  font-size: 12px;
}

/* ---------- canvas ---------- */

/* `.canvas` from app.css supplies position and overflow; it is a flex child
   there and a block here, so the height has to be stated. */
.sh-canvas {
  flex: none;
  height: min(70vh, 760px);
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.sh-foot {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.sh-withheld { color: var(--ink-2); }

.sh-empty { padding: 24px 0; }

.sh-loading { padding: 8px 0; }

/* ---------- the one-sentence dead end ---------- */

.sh-message {
  max-width: 520px;
  margin: 48px auto;
  display: grid;
  gap: 10px;
  justify-items: start;
}

.sh-message h1 { font-size: 19px; margin: 0; }

/* ---------- the creator's share control ---------- */

.sh-manager { display: grid; gap: 12px; }

.sh-manager-head h2 { font-size: 15px; margin: 0; }

.sh-create {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.sh-field { margin: 0; min-width: 190px; }

.sh-field .hint { flex-basis: 100%; }

/* The token appears here once and nowhere else, so it is given the weight of
   something that will not come back. */
.sh-new {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.sh-new-title {
  margin: 0;
  font-size: 13px;
  font-weight: 640;
  color: var(--accent-ink);
}

.sh-new-row { display: flex; gap: 8px; flex-wrap: wrap; }

.sh-new-url {
  flex: 1 1 320px;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12px;
  padding: 7px 9px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.sh-table { width: 100%; }

.sh-table td { vertical-align: top; }

.sh-expiry-at {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}

.sh-last-viewed {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}

.sh-actions { text-align: right; }

.sh-revoke { color: var(--danger); }

.sh-pill-active {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: var(--ok);
}

/* Expired and revoked look alike on purpose: to the creator both mean "this
   link no longer works", and the column beside them says which. */
.sh-pill-expired,
.sh-pill-revoked {
  background: var(--surface-2);
  color: var(--muted);
  border-color: var(--line-strong);
}

@media (max-width: 720px) {
  .sh-page { padding: 20px 16px 32px; }
  .sh-zoom { margin-left: 0; }
  .sh-canvas { height: min(60vh, 520px); }
}
