:root {
  --ink: #0a1628;
  --ink-soft: #4a5d78;
  --paper: #f3f6fa;
  --paper-2: #dde5ef;
  --navy: #0a1628;
  --navy-2: #ffffff;
  --accent: #c8102e;
  --accent-2: #9e0c24;
  --bar: #ffffff;
  --bar-edge: #d7e0eb;
  --bar-text: #0a1628;
  --bar-muted: #6b7c93;
  --danger: #c8102e;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --hover: rgba(10, 22, 40, 0.06);
  --shadow: 0 16px 40px rgba(10, 22, 40, 0.1);
  --font: 'Montserrat', system-ui, sans-serif;
  --display: 'Montserrat', system-ui, sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* —— Home —— */
.home {
  min-height: 100dvh;
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.home-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 70% 10%, rgba(27, 54, 93, 0.22), transparent 55%),
    radial-gradient(ellipse 60% 50% at 10% 90%, rgba(200, 16, 46, 0.12), transparent 50%),
    linear-gradient(160deg, #f4f6f9 0%, #e8eef6 45%, #dce6f2 100%);
  z-index: 0;
}

.home-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  opacity: 0.07;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.home-top,
.home-main {
  position: relative;
  z-index: 1;
}

.home-top {
  padding: 1.25rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.auth-status {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
  max-width: 16rem;
  text-align: right;
}

.auth-status[data-state='in'] {
  color: var(--accent-2);
  font-weight: 600;
}

.auth-status[data-state='needed'] {
  color: var(--danger);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.brand img {
  display: block;
  height: 28px;
  width: auto;
}

.home-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  max-width: 40rem;
  padding: 2rem 1.75rem 4rem;
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.home-minimal {
  display: grid;
  grid-template-rows: 1fr;
  place-items: center;
  min-height: 100dvh;
  padding: 1.5rem;
}

.home-center {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  text-align: center;
  width: min(100%, 22rem);
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.home-center .home-brand {
  margin: 0 0 0.15rem;
}

.home-brand {
  margin: 0;
  line-height: 0;
}

.home-brand img {
  display: block;
  width: min(240px, 68vw);
  height: auto;
  margin: 0 auto;
}

.home-auth {
  width: 100%;
}

.home-login,
.home-signed-in {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.15rem 1.15rem 1.25rem;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 20, 25, 0.08);
  border-radius: 14px;
  box-shadow: var(--shadow);
  text-align: left;
}

.home-login[hidden],
.home-signed-in[hidden] {
  display: none !important;
}

.home-login h2 {
  margin: 0 0 0.15rem;
  font-size: 1.05rem;
  color: var(--navy);
}

.home-login label {
  display: block;
}

.home-login label[hidden] {
  display: none !important;
}

.home-login input {
  width: 100%;
  border: 1px solid rgba(15, 20, 25, 0.12);
  border-radius: 10px;
  background: #fff;
  padding: 0.7rem 0.8rem;
  font: inherit;
  outline: none;
}

.home-login input:focus {
  border-color: var(--accent);
}

.home-login .btn-primary,
.home-signed-in .btn-primary {
  width: 100%;
  text-align: center;
  text-decoration: none;
  margin-top: 0.15rem;
}

.link-actions:not([hidden]) {
  display: grid;
  gap: 0.65rem;
}

.link-actions label span {
  display: block;
  margin-bottom: 0.25rem;
}

.code-sign-in [hidden],
.profile-form[hidden] {
  display: none !important;
}

.code-sign-in-status,
.code-sign-in-error {
  margin: 0;
  font-size: 0.85rem;
}

.code-sign-in-error {
  color: var(--danger);
}

.code-sign-in-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
}

.home-login-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.85rem;
}

.home-powered {
  margin: 0.85rem 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.home-powered a {
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
}

.home-powered a:hover {
  color: var(--accent);
}

.home-signed-in {
  text-align: center;
  align-items: stretch;
}

.home-signed-in p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.4;
}

.admin-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  border-bottom: 1px solid rgba(15, 20, 25, 0.22);
  padding-bottom: 0.1rem;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.admin-link:hover {
  color: var(--accent-2);
  border-color: var(--accent);
}

.home-brand {
  margin: 0;
  line-height: 0;
}

.home-sub {
  margin: 0 0 2rem;
  font-size: 1.1rem;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 28rem;
  animation: rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.url-form {
  display: flex;
  flex-direction: column;
  width: min(100%, 34rem);
  gap: 0.35rem;
  padding: 0.4rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 20, 25, 0.08);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  animation: rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both;
}

.url-form[hidden],
.admin-form[hidden] {
  display: none !important;
}

.url-form > input,
.url-form-row input {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 0.85rem 1rem;
  outline: none;
  min-width: 0;
  font: inherit;
}

.url-form > input {
  border-bottom: 1px solid rgba(15, 20, 25, 0.06);
}

.deadline-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 1rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  border-top: 1px solid rgba(15, 20, 25, 0.06);
}

.deadline-field input[type='date'] {
  border: 1px solid rgba(15, 20, 25, 0.12);
  background: #fff;
  padding: 0.4rem 0.55rem;
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  outline: none;
  min-width: 0;
}

.deadline-field input[type='date']:focus {
  border-color: var(--accent);
}

.upload-form .deadline-field {
  padding: 0;
  border-top: 0;
}

.site-meta .site-deadline {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #b91c1c;
  white-space: nowrap;
}

.site-meta .site-deadline svg {
  flex-shrink: 0;
  color: #b91c1c;
}

.site-actions .btn-icon.approve-site-btn {
  color: #fff;
  background: #16a34a;
  border-color: #16a34a;
}

.site-actions .btn-icon.approve-site-btn:hover {
  background: #15803d;
  border-color: #15803d;
  color: #fff;
}

.site-actions span.btn-icon.approve-site-btn:hover {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.site-actions .btn-icon.unapprove-btn {
  color: #b91c1c;
}

.site-actions .btn-icon.unapprove-btn:hover {
  background: rgba(185, 28, 28, 0.1);
  color: #991b1b;
}

.site-meta .site-approved {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #15803d;
}

.site-meta .site-folder {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.site-status-badge {
  display: inline-flex;
  align-items: center;
  max-width: 11.5rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 20, 25, 0.1);
  border-radius: 8px;
  white-space: nowrap;
}

.url-form-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  min-width: 0;
}

.url-form button {
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease;
}

.url-form button:hover {
  background: var(--accent-2);
}

.url-form button:active {
  transform: translateY(1px);
}

.home-hint {
  margin: 0.85rem 0 0;
  color: var(--danger);
  font-size: 0.9rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— Admin —— */
body[data-page='admin'] {
  min-height: 100dvh;
}

.admin {
  min-height: 100dvh;
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
}

.admin-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 85% 0%, rgba(27, 54, 93, 0.18), transparent 55%),
    linear-gradient(165deg, #f4f6f9 0%, #e8eef6 55%, #dce6f2 100%);
  z-index: 0;
}

.admin-top,
.admin-main {
  position: relative;
  z-index: 1;
}

.admin-top {
  padding: 1.25rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-main {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
  animation: rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.portal .admin-top {
  border-bottom: 1px solid rgba(15, 20, 25, 0.08);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
}

.portal-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: calc(100dvh - 4.5rem);
}

.portal-sidebar {
  background: rgba(244, 246, 249, 0.92);
  border-right: 1px solid rgba(15, 20, 25, 0.08);
  padding: 1rem 0.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow: auto;
}

.portal-nav {
  display: grid;
  gap: 0.2rem;
}

.portal-nav-item,
.portal-folder-item {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
}

.portal-nav-item em,
.portal-folder-item em {
  font-style: normal;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 500;
}

.portal-nav-item.is-on,
.portal-folder-item.is-on {
  background: rgba(15, 20, 25, 0.08);
  font-weight: 600;
}

.portal-nav-item:hover,
.portal-folder-item:hover {
  background: rgba(15, 20, 25, 0.05);
}

.portal-projects-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.65rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.portal-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}

.portal-icon-btn:hover {
  background: rgba(15, 20, 25, 0.08);
  color: var(--navy);
}

.portal-icon-btn.danger:hover {
  color: var(--danger);
  background: rgba(185, 28, 28, 0.08);
}

.portal-folder-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
}

.portal-folder-list > li {
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr);
  align-items: center;
  gap: 0.15rem;
  position: relative;
}

.portal-folder-drag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.7rem;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(74, 93, 120, 0.55);
  cursor: grab;
  touch-action: none;
}

.portal-folder-drag:active {
  cursor: grabbing;
}

.portal-folder-drag:hover {
  color: var(--ink-soft);
  background: rgba(15, 20, 25, 0.05);
}

.portal-folder-row.is-dragging {
  opacity: 0.45;
}

.portal-folder-row.drag-over-before::before,
.portal-folder-row.drag-over-after::after {
  content: '';
  position: absolute;
  left: 0.35rem;
  right: 0.35rem;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  pointer-events: none;
}

.portal-folder-row.drag-over-before::before {
  top: -1px;
}

.portal-folder-row.drag-over-after::after {
  bottom: -1px;
}

.portal-folder-row .portal-folder-item {
  min-width: 0;
}

.portal-folder-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-context-menu {
  position: fixed;
  z-index: 100;
  min-width: 10.5rem;
  padding: 0.3rem;
  background: #fff;
  border: 1px solid rgba(15, 20, 25, 0.1);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(10, 22, 40, 0.18);
  display: grid;
  gap: 0.15rem;
  animation: rise 0.12s ease;
}

.folder-context-menu[hidden] {
  display: none;
}

.folder-context-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 550;
  text-align: left;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
}

.folder-context-item:hover {
  background: rgba(15, 20, 25, 0.06);
}

.folder-context-item.is-danger {
  color: var(--danger, #b91c1c);
}

.folder-context-item.is-danger:hover {
  background: rgba(185, 28, 28, 0.08);
}

.portal-folder-empty {
  padding: 0.45rem 0.65rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.portal-main.admin-main {
  width: auto;
  max-width: 820px;
  margin: 0;
  padding: 1.5rem 1.75rem 3rem;
}

.client-proofs-main.admin-main {
  width: auto;
  max-width: 820px;
  margin: 0;
  padding: 1.5rem 1.75rem 3rem;
}

.client-proofs .portal-folder-list > li {
  grid-template-columns: minmax(0, 1fr);
}

.client-proofs .portal-folder-row .portal-folder-item {
  width: 100%;
  min-width: 0;
}

.client-proofs .site-actions .btn-primary {
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.45rem 0.8rem;
}

.folder-select {
  max-width: 9.5rem;
  font: inherit;
  font-size: 0.8rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid rgba(15, 20, 25, 0.12);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
}

.portal-nav-item.is-drop-target,
.portal-folder-row.is-drop-target {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  background: rgba(200, 16, 46, 0.06);
  border-radius: 8px;
}

.site-item[draggable='true'] {
  cursor: grab;
}

.site-item[draggable='true']:active {
  cursor: grabbing;
}

.site-item.is-dragging {
  opacity: 0.45;
}

.active-comments {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 2.4rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 20, 25, 0.1);
  border-radius: 8px;
}

.site-status-wrap {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.site-status {
  appearance: none;
  -webkit-appearance: none;
  max-width: 11.5rem;
  padding: 0.35rem 1.6rem 0.35rem 0.55rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  background-color: rgba(255, 255, 255, 0.85);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a6570' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.45rem center;
  background-size: 12px;
  border: 1px solid rgba(15, 20, 25, 0.1);
  border-radius: 8px;
  cursor: pointer;
  outline: none;
}

.site-status:hover,
.site-status:focus {
  border-color: rgba(15, 20, 25, 0.22);
  color: var(--ink);
}

.site-status:disabled {
  opacity: 0.65;
  cursor: wait;
}

@media (max-width: 860px) {
  .portal-shell {
    grid-template-columns: 1fr;
  }

  .portal-sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(15, 20, 25, 0.08);
    max-height: 42vh;
  }
}

.admin-intro h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3rem);
  margin: 0 0 0.5rem;
  letter-spacing: -0.03em;
  color: var(--navy);
}

.admin-intro p {
  margin: 0 0 1.5rem;
  color: var(--ink-soft);
  line-height: 1.45;
  max-width: 34rem;
}

.portal-intro-rule {
  display: block;
  width: 100%;
  max-width: 34rem;
  height: 1px;
  margin: 0 0 1.5rem;
  border: 0;
  background: rgba(15, 20, 25, 0.12);
}

.portal-intro-rule[hidden] {
  display: none;
}

.admin-form {
  margin-bottom: 0.5rem;
}

.admin-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
  padding: 0.3rem;
  width: fit-content;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(15, 20, 25, 0.08);
}

.admin-tab {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
}

.admin-tab.is-on {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 2px 10px rgba(10, 22, 40, 0.08);
}

.admin-nav {
  display: flex;
  gap: 0.35rem;
  margin: 0 0 1.25rem;
  padding: 0.3rem;
  width: fit-content;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(15, 20, 25, 0.08);
}

.admin-nav-btn {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
}

.admin-nav-btn.is-on {
  background: var(--navy);
  color: #fff;
}

.admin-section[hidden] {
  display: none !important;
}

.settings-block {
  margin-bottom: 1.75rem;
  padding: 1rem 1.1rem 1.15rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 20, 25, 0.08);
  box-shadow: var(--shadow);
}

.settings-block-head h2 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  color: var(--navy);
}

.settings-block-head p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.4;
}

.settings-block-head h3,
.settings-sub h3 {
  margin: 0 0 0.55rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.settings-dl {
  display: grid;
  gap: 0.55rem 1rem;
  margin: 0 0 1rem;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.settings-dl > div {
  display: grid;
  gap: 0.15rem;
}

.settings-dl dt {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.settings-dl dd {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink);
  word-break: break-word;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.settings-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.settings-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.user-item,
.digest-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding: 0.7rem 0.8rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 20, 25, 0.08);
}

.digest-item {
  justify-content: space-between;
}

.digest-item span {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.status-pill {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status-pill.is-ok {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.status-pill.is-bad {
  background: rgba(185, 28, 28, 0.1);
  color: #b91c1c;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: min(100%, 34rem);
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 20, 25, 0.08);
  box-shadow: var(--shadow);
}

.upload-form[hidden] {
  display: none !important;
}

.upload-drop {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.1rem;
  border: 1px dashed rgba(15, 20, 25, 0.2);
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
}

.upload-drop input[type='file'] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.upload-drop-title {
  font-weight: 600;
  color: var(--navy);
}

.upload-drop-hint {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.upload-form input[type='text'],
.upload-form input[type='date'] {
  border: 1px solid rgba(15, 20, 25, 0.12);
  background: #fff;
  padding: 0.75rem 0.9rem;
  outline: none;
  font: inherit;
}

.upload-form button[type='submit'] {
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  align-self: flex-start;
}

.upload-form button[type='submit']:hover {
  background: var(--accent-2);
}

.site-kind {
  font-style: normal;
  font-weight: 600;
  color: var(--navy);
}

.site-list-wrap {
  margin-top: 2.25rem;
}

.site-list-wrap h2 {
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.site-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.site-item {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  align-items: stretch;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 20, 25, 0.08);
  backdrop-filter: blur(8px);
}

.site-thumb {
  flex: 0 0 40%;
  width: 40%;
  max-width: 40%;
  aspect-ratio: 16 / 10;
  height: auto;
  align-self: stretch;
  border-radius: 6px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(10, 22, 40, 0.08), rgba(10, 22, 40, 0.02)),
    rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(15, 20, 25, 0.08);
  position: relative;
}

.site-thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.site-thumb.is-empty::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 46%, rgba(15, 20, 25, 0.12) 46%, rgba(15, 20, 25, 0.12) 54%, transparent 54%),
    linear-gradient(45deg, transparent 46%, rgba(15, 20, 25, 0.08) 46%, rgba(15, 20, 25, 0.08) 54%, transparent 54%);
  opacity: 0.7;
}

.site-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.15rem 0.25rem 0.15rem 0;
}

.site-meta {
  min-width: 0;
}

.site-meta strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.site-meta span {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.site-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-left: 0;
}

.site-actions .btn-primary,
.site-actions .btn-ghost {
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.45rem 0.8rem;
}

.site-actions .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: 1px solid rgba(15, 20, 25, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--navy);
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}

.site-actions .btn-icon.is-approved,
.site-actions span.btn-icon {
  cursor: default;
}

.site-actions .btn-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.site-actions .btn-icon.is-copied {
  border-color: #15803d;
  color: #15803d;
}

.site-actions .btn-icon.is-copied svg {
  display: none;
}

.site-actions .btn-icon.is-copied::after {
  content: '';
  width: 10px;
  height: 6px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg) translateY(-1px);
}

.site-actions .btn-icon.danger {
  color: var(--danger);
}

.site-actions .btn-icon.danger:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(185, 28, 28, 0.06);
}

.site-actions .btn-ghost.danger {
  color: var(--danger);
}

.admin-gate {
  text-align: center;
  padding-top: 4rem;
}

.admin-gate h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3rem);
  margin: 0 0 0.5rem;
  color: var(--navy);
}

.admin-gate p {
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
}

.admin-main.is-locked .admin-intro p {
  color: var(--danger);
}


/* —— Session —— */
body[data-page='session'] {
  background: var(--paper);
  height: 100dvh;
  overflow: hidden;
}

.session {
  height: 100dvh;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr auto;
  position: relative;
}

.session > .panel {
  grid-row: 1;
  grid-column: 1;
}

.session > .viewport {
  grid-row: 1;
  grid-column: 2;
  min-width: 0;
}

.session > .toolbar {
  grid-row: 2;
  grid-column: 1 / -1;
}

.session > .notify,
.session > .toast {
  z-index: 40;
}

.viewport {
  position: relative;
  background:
    linear-gradient(180deg, #e8eef6, #d5deea);
  display: grid;
  place-items: stretch;
  overflow: hidden;
}

.viewport-size {
  position: absolute;
  bottom: 0.55rem;
  right: 0.65rem;
  top: auto;
  z-index: 5;
  pointer-events: none;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: rgba(10, 22, 40, 0.72);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(15, 20, 25, 0.08);
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 2px rgba(10, 22, 40, 0.06);
}

.viewport.is-mobile {
  place-items: center;
  padding: 1rem 1rem 0.5rem;
}

.viewport.is-mobile #frame {
  width: min(390px, 100%);
  height: 100%;
  border-radius: 18px;
  box-shadow: 0 0 0 1px rgba(10, 22, 40, 0.08), 0 20px 50px rgba(10, 22, 40, 0.18);
}

#frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.viewport.is-comment-mode #frame {
  outline: 5px solid var(--accent);
  outline-offset: -5px;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--bar);
  color: var(--bar-text);
  border-top: 1px solid var(--bar-edge);
  box-shadow: 0 -4px 24px rgba(10, 22, 40, 0.04);
  z-index: 20;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.toolbar-brand {
  display: inline-flex;
  align-items: center;
  margin-right: 0.35rem;
  line-height: 0;
  text-decoration: none;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  padding: 0.2rem 0.35rem;
}

.toolbar-brand img {
  display: block;
  height: 22px;
  width: auto;
}

.toolbar-right {
  justify-content: flex-end;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 0;
  background: transparent;
  color: var(--bar-text);
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

a.tool-btn[hidden] {
  display: none !important;
}

.tool-btn:hover,
.tool-btn[aria-pressed='true'],
.tool-btn.is-active {
  background: var(--hover);
}

.tool-btn-approve {
  background: #16a34a;
  color: #fff;
  font-weight: 650;
}

.tool-btn-approve:hover:not(:disabled) {
  background: #15803d;
  color: #fff;
}

.tool-btn-approve.is-approved,
.tool-btn-approve:disabled {
  background: #16a34a;
  color: #fff;
  opacity: 1;
  cursor: default;
}

.tool-btn-unapprove {
  color: #b91c1c;
  font-weight: 600;
}

.tool-btn-unapprove:hover {
  background: rgba(185, 28, 28, 0.1);
}

.device-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.1rem;
  border-radius: 10px;
  background: var(--surface-2);
}

.device-toggle .tool-btn {
  padding: 0.45rem;
}

.presence {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  color: var(--bar-muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5c6570;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.live-dot.is-live {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
  animation: pulse 1.8s ease infinite;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.05);
  }
}

.mode-toggle {
  position: relative;
  display: inline-flex;
  padding: 3px;
  background: var(--surface-2);
  border-radius: 999px;
  border: 1px solid var(--bar-edge);
}

.mode-opt {
  border: 0;
  background: transparent;
  color: var(--bar-muted);
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.mode-opt.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(10, 22, 40, 0.1);
}

.mode-tip {
  position: absolute;
  bottom: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%);
  width: min(320px, calc(100vw - 32px));
  padding: 1rem;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 30px rgba(10, 22, 40, 0.22);
  font-size: 0.85rem;
  line-height: 1.5;
}

.mode-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 10px solid transparent;
  border-top-color: var(--accent);
  border-bottom: 0;
}

.mode-tip strong {
  display: block;
  font-size: 0.9rem;
}

.mode-tip p {
  margin: 0.45rem 0 0.75rem;
}

.mode-tip button {
  border: 0;
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0a1628, #1b365d);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  margin-left: 0.25rem;
  overflow: hidden;
}

.avatar.has-image {
  padding: 0;
  background: #dbe4f0;
}

.avatar.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Drawer */
.drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 3.4rem;
  width: min(360px, 92vw);
  background: rgba(255, 255, 255, 0.96);
  color: var(--bar-text);
  border-left: 1px solid var(--bar-edge);
  display: flex;
  flex-direction: column;
  z-index: 15;
  backdrop-filter: blur(12px);
  animation: slideIn 0.22s ease;
}

.drawer[hidden] {
  display: none;
}

@keyframes slideIn {
  from {
    transform: translateX(12px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.5rem;
}

.drawer-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--bar-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 6px;
}

.icon-btn:hover {
  background: var(--hover);
  color: var(--ink);
}

.icon-btn.danger {
  color: var(--bar-muted);
}

.icon-btn.danger:hover {
  background: rgba(200, 16, 46, 0.1);
  color: var(--danger);
}

.drawer-filter {
  padding: 0 1rem 0.75rem;
  color: var(--bar-muted);
  font-size: 0.8rem;
}

.drawer-filter label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.comment-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  overflow: auto;
  flex: 1;
}

.comment-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  padding: 0.75rem;
  border-radius: 10px;
  cursor: pointer;
}

.comment-item:hover {
  background: var(--hover);
}

.comment-item.is-resolved {
  opacity: 0.55;
}

.pin-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(10, 22, 40, 0.08);
  flex-shrink: 0;
}

.pin-badge.is-resolved {
  font-size: 0.9rem;
  line-height: 1;
}

.comment-meta {
  min-width: 0;
}

.comment-meta strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}

.comment-meta p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--bar-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-meta .page {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: #6b7380;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-empty {
  padding: 1.5rem 1rem;
  color: var(--bar-muted);
  font-size: 0.9rem;
  text-align: center;
}

/* Composer — pin + card anchored to click point */
.composer {
  position: absolute;
  inset: 0;
  z-index: 25;
  pointer-events: none;
}

.composer[hidden] {
  display: none;
}

.composer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(10, 22, 40, 0.48);
  cursor: default;
  pointer-events: auto;
  z-index: 0;
}

.composer-anchor {
  position: absolute;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  pointer-events: auto;
  transform: translate(-14px, -14px);
  animation: rise 0.12s ease;
  z-index: 1;
  filter: drop-shadow(0 8px 24px rgba(10, 22, 40, 0.28));
}

.composer.is-flipped .composer-anchor {
  flex-direction: row-reverse;
}

.composer-pin {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #3b82f6;
  border: 2px solid #fff;
  box-shadow: 0 2px 10px rgba(10, 22, 40, 0.35);
}

.composer-card {
  width: min(300px, calc(100vw - 4rem));
  background: #fff;
  color: var(--ink);
  padding: 0.75rem 0.85rem 0.7rem;
  border-radius: 10px;
  border: 1.5px solid #93c5fd;
  box-shadow: 0 12px 36px rgba(10, 22, 40, 0.18);
}

.composer-card textarea {
  width: 100%;
  border: 0;
  border-radius: 0;
  padding: 0.15rem 0.1rem 0.55rem;
  resize: none;
  outline: none;
  background: transparent;
  min-height: 4.2rem;
  font: inherit;
  line-height: 1.4;
  color: var(--ink);
}

.composer-card textarea::placeholder {
  color: #9aa7b8;
}

.composer-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  align-items: center;
  margin-top: 0.15rem;
  padding-top: 0.45rem;
  border-top: 1px solid #e8eef6;
}

.composer-attach-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-right: auto;
  border-radius: 7px;
  color: var(--ink-soft);
  cursor: pointer;
}

.composer-attach-btn:hover {
  background: var(--paper);
  color: var(--ink);
}

.composer-attach {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.35rem;
  padding: 0.35rem 0.45rem;
  background: #f4f7fb;
  border-radius: 7px;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.composer-attach[hidden] {
  display: none !important;
}

.composer-attach-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 550;
  color: var(--ink);
}

.composer-attach-clear {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.2rem;
}

.thread-attachment {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.55rem 0 0;
  padding: 0.4rem 0.55rem;
  max-width: 100%;
  font-size: 0.82rem;
  font-weight: 550;
  color: var(--accent-2, #1b365d);
  text-decoration: none;
  background: #f4f7fb;
  border-radius: 7px;
  border: 1px solid rgba(15, 20, 25, 0.08);
}

.thread-attachment[hidden] {
  display: none !important;
}

.thread-attachment:hover {
  background: #eaf0f7;
}

.comment-item .has-file {
  color: var(--ink-soft);
  margin-left: 0.25rem;
}

.composer-actions .btn-ghost,
.composer-actions .btn-primary {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  border-radius: 7px;
}

.btn-ghost,
.btn-primary {
  border: 0;
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
}

.btn-ghost:hover {
  background: var(--paper);
}

.btn-ghost.danger {
  color: var(--danger);
}

.btn-ghost.danger:hover {
  background: rgba(185, 28, 28, 0.06);
  color: var(--danger);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

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

.toast {
  position: absolute;
  left: 50%;
  top: 1rem;
  transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  z-index: 30;
  box-shadow: var(--shadow);
}

.toast[hidden] {
  display: none;
}

.admin-top-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.add-canvas-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  font-size: 0.88rem;
  padding: 0.55rem 0.95rem;
}

.add-canvas-btn.is-open {
  background: var(--navy);
}

.add-canvas-panel {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem 1.15rem;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 20, 25, 0.08);
  box-shadow: var(--shadow);
  border-radius: 12px;
}

.add-canvas-panel[hidden] {
  display: none !important;
}

.add-canvas-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.add-canvas-panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--navy);
}

.admin-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  color: var(--navy);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(15, 20, 25, 0.1);
}

.admin-icon-btn[hidden] {
  display: none;
}

.admin-icon-btn:hover,
.admin-icon-btn.is-active {
  color: var(--accent);
  border-color: var(--accent);
}

.settings-back {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
}

.settings-back a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
}

.settings-back a:hover {
  color: var(--navy);
}

button.avatar {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.avatar {
  cursor: pointer;
}

/* Profile modal */
.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.profile-modal[hidden] {
  display: none;
}

.profile-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 14, 18, 0.55);
  backdrop-filter: blur(4px);
}

.profile-card {
  position: relative;
  width: min(420px, 100%);
  background: #fff;
  color: var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 1.15rem 1.2rem 1.25rem;
  animation: rise 0.22s ease;
}

.profile-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.profile-card-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
}

.profile-x {
  font-size: 1.35rem;
  line-height: 1;
  color: var(--ink-soft);
}

.profile-status {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
  min-height: 1.2em;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-card--sign-in {
  width: min(440px, 100%);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  padding: clamp(1.15rem, 4vw, 1.75rem);
  border: 1px solid #e4e8ee;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(10, 22, 40, 0.22);
}

.profile-card--sign-in .profile-card-head {
  margin-bottom: 0.5rem;
}

.profile-card--sign-in .profile-card-head h2 {
  color: var(--navy);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.profile-card--sign-in .profile-x {
  flex: none;
  min-width: 40px;
  min-height: 40px;
}

.profile-card--sign-in .code-sign-in {
  gap: 1rem;
}

.profile-code-description,
.profile-card--sign-in .code-sign-in-status {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.875rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.profile-card--sign-in .code-sign-in-status {
  padding: 0.75rem 0.9rem;
  background: #f0f4f9;
  border: 1px solid #e4eaf2;
  border-radius: 10px;
}

.profile-card--sign-in .code-sign-in label {
  color: var(--ink);
  font-size: 0.85rem;
}

.profile-card--sign-in .code-sign-in input {
  min-height: 46px;
  background: #fff;
  border-color: #cbd4e1;
  border-radius: 10px;
  font-size: 1rem;
}

.profile-card--sign-in .code-sign-in input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}

.profile-card--sign-in .code-sign-in input[name="code"] {
  min-height: 56px;
  text-align: center;
  font: 600 1.4rem ui-monospace, monospace;
  letter-spacing: 0.3em;
}

.profile-card--sign-in .code-sign-in .btn-primary {
  justify-content: center;
  min-height: 46px;
  border-radius: 10px;
}

.profile-card--sign-in .code-sign-in-actions {
  justify-content: center;
  gap: 0.25rem 1rem;
  font-size: 0.8rem;
}

.profile-card--sign-in .code-sign-in-actions .text-btn {
  min-height: 40px;
}

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.15rem 0 0.25rem;
}

.profile-avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0a1628, #1b365d);
  color: #fff;
  font-weight: 700;
  font-size: 1.35rem;
  overflow: hidden;
}

.profile-avatar-preview.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-avatar-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 0;
}

.profile-avatar-upload {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.profile-avatar-actions .profile-hint {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--ink-soft);
}

.profile-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.profile-form label[hidden],
.profile-form [hidden] {
  display: none !important;
}

.profile-form input {
  border: 1px solid var(--paper-2);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  outline: none;
  background: #fafaf8;
}

.profile-form input:focus {
  border-color: var(--accent);
}

.profile-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--bar-muted);
  font-weight: 400;
}

.profile-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.85rem;
}

.profile-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.profile-actions-right {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
}

/* Edit proof dialog */
.edit-site-modal {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.edit-site-modal[hidden] {
  display: none;
}

body.edit-site-open {
  overflow: hidden;
}

.edit-site-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 14, 18, 0.55);
  backdrop-filter: blur(4px);
}

.edit-site-card {
  position: relative;
  width: min(420px, 100%);
  background: #fff;
  color: var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 1.15rem 1.2rem 1.25rem;
  animation: rise 0.22s ease;
  z-index: 1;
}

.edit-site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.edit-site-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
}

.edit-site-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.edit-site-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.edit-site-form label[hidden] {
  display: none !important;
}

.edit-site-form input {
  border: 1px solid var(--paper-2);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  outline: none;
  background: #fafaf8;
}

.edit-site-form input:focus {
  border-color: var(--accent);
}

.edit-site-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.edit-site-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.85rem;
}

.edit-site-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}

.edit-site-actions-right {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
}

.profile-alt {
  margin: 0.9rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: center;
}

.text-btn {
  border: 0;
  background: none;
  color: var(--accent-2);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.text-btn:hover {
  text-decoration: underline;
}

/* Left comment panel (Pastel-style) */
.panel {
  position: relative;
  width: min(380px, 92vw);
  height: calc(100dvh - 3.4rem);
  background: var(--surface);
  color: var(--bar-text);
  border-right: 1px solid var(--bar-edge);
  box-shadow: 4px 0 24px rgba(10, 22, 40, 0.04);
  display: flex;
  flex-direction: column;
  z-index: 15;
  animation: slideInLeft 0.22s ease;
}

.panel[hidden] {
  display: none;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-10px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.panel-view {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.panel-view[hidden] {
  display: none;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.9rem 1rem 0.55rem;
}

.panel-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.panel-tabs {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.panel-tab {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  cursor: pointer;
}

.panel-tab[hidden] {
  display: none;
}

.panel-tab.is-on {
  color: var(--bar-text);
  background: var(--hover);
}

.pages-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.pages-pane[hidden] {
  display: none;
}

.page-search {
  margin: 0 0.75rem 0.35rem;
  flex-shrink: 0;
}

.page-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0.5rem 1rem;
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.page-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.55rem 0.55rem 0.7rem;
  border-radius: 8px;
}

.page-row:hover,
.page-row.is-on {
  background: var(--hover);
}

.page-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
}

.page-item strong {
  font-size: 0.9rem;
  font-weight: 650;
}

.page-item span {
  font-size: 0.75rem;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.page-row-side {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.page-comment-count {
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border-radius: 999px;
  background: rgba(15, 20, 25, 0.08);
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.page-comment-count svg {
  flex-shrink: 0;
}

.page-view-btn {
  border: 0;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 650;
  padding: 0.35rem 0.6rem;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}

.page-view-btn:hover {
  filter: brightness(0.95);
}

.thread-head {
  gap: 0.35rem;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  border: 0;
  background: transparent;
  color: var(--bar-text);
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0.25rem 0.35rem;
  border-radius: 6px;
}

.back-btn:hover {
  background: var(--hover);
}

.thread-index {
  flex: 1;
  text-align: center;
  font-size: 0.85rem;
  color: var(--bar-muted);
  font-weight: 500;
}

.thread-nav {
  display: flex;
  gap: 0.15rem;
}

.panel-filter {
  padding: 0 1rem 0.75rem;
  color: var(--bar-muted);
  font-size: 0.8rem;
}

.panel-filter label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.panel-tools {
  padding: 0 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-bottom: 1px solid var(--bar-edge);
}

.panel-tools[hidden],
.comment-list[hidden] {
  display: none !important;
}

.comment-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--bar-edge);
  border-radius: 999px;
  background: var(--surface);
  color: var(--bar-muted);
}

.comment-search input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  min-width: 0;
}

.comment-search input::placeholder {
  color: var(--bar-muted);
}

.status-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bar-muted);
}

.status-filter-head .text-btn {
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.status-chip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--bar-edge);
  background: var(--surface);
  color: var(--ink);
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.status-chip.is-on {
  border-color: #93c5fd;
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.15);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot-open {
  background: #3b82f6;
}

.status-dot-progress {
  background: #f59e0b;
}

.status-dot-awaiting {
  background: #ef4444;
}

.status-dot-resolved {
  background: #22c55e;
}

.status-name {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-count {
  font-size: 0.78rem;
  color: var(--bar-muted);
  font-weight: 600;
}

.panel-tools-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.tool-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  background: transparent;
  color: var(--bar-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0;
}

.tool-link.is-on,
.tool-link:hover {
  color: var(--ink);
}

.thread-scroll {
  flex: 1;
  overflow: auto;
  min-height: 0;
}

.thread-main {
  padding: 0.25rem 1rem 1rem;
}

.thread-author-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.thread-author-row strong {
  display: block;
  font-size: 0.92rem;
}

.thread-author-row time {
  display: block;
  font-size: 0.75rem;
  color: var(--bar-muted);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #3b82f6;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}

.user-avatar.tiny {
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
}

.thread-body {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.thread-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
  max-width: 14rem;
}

.thread-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--bar-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.thread-fields select {
  border: 1px solid var(--bar-edge);
  background: var(--surface);
  color: var(--bar-text);
  border-radius: 8px;
  padding: 0.5rem 0.55rem;
  font: inherit;
  font-size: 0.85rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.thread-meta-card {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 0.65rem;
  padding: 0.65rem;
  border: 1px solid var(--bar-edge);
  border-radius: 10px;
  margin-bottom: 0.9rem;
  background: var(--surface-2);
}

.meta-thumb {
  border-radius: 8px;
  min-height: 84px;
  overflow: hidden;
  background: #111827;
  border: 1px solid var(--bar-edge);
}

.meta-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 84px;
  max-height: 110px;
  object-fit: cover;
}

.meta-lines {
  font-size: 0.78rem;
  color: var(--bar-muted);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
}

.reply-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.reply-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
}

.reply-item strong {
  display: inline;
  font-size: 0.85rem;
  margin-right: 0.35rem;
}

.reply-item time {
  font-size: 0.72rem;
  color: var(--bar-muted);
}

.reply-item p {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  line-height: 1.4;
}

.reply-box {
  display: flex;
  gap: 0.45rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--bar-edge);
  background: var(--surface);
}

.reply-box input {
  flex: 1;
  border: 1px solid var(--bar-edge);
  background: var(--surface-2);
  color: var(--bar-text);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  outline: none;
}

.reply-box input:focus {
  border-color: var(--accent);
}

.reply-send {
  padding: 0.55rem 0.85rem;
}

.notify {
  position: absolute;
  right: 1rem;
  bottom: 4.5rem;
  width: min(300px, calc(100% - 2rem));
  background: #dbeafe;
  color: #1e3a5f;
  border-radius: 12px;
  padding: 0.85rem 1rem 0.9rem;
  z-index: 28;
  box-shadow: var(--shadow);
  animation: rise 0.2s ease;
}

.notify[hidden] {
  display: none;
}

.notify-close {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  border: 0;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  color: #1e3a5f;
}

.notify-title {
  margin: 0 0 0.25rem;
  font-weight: 700;
  font-size: 0.9rem;
  padding-right: 1rem;
}

.notify-body {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  line-height: 1.35;
}

.notify-view {
  border: 0;
  background: transparent;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
}

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

  .session > .viewport,
  .session > .panel {
    grid-column: 1;
    grid-row: 1;
  }

  .panel {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 16;
  }

  .toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.4rem;
    padding: 0.4rem 0.55rem calc(0.45rem + env(safe-area-inset-bottom));
    z-index: 30;
  }

  .toolbar-left {
    order: 1;
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    justify-content: flex-start;
    gap: 0.15rem;
  }

  .toolbar-right {
    order: 2;
    flex: 0 0 auto;
    width: auto;
    justify-content: flex-end;
    gap: 0.15rem;
  }

  .mode-toggle {
    order: 3;
    flex: 1 1 100%;
    display: flex;
  }

  .mode-opt {
    flex: 1;
    text-align: center;
    padding: 0.55rem 0.35rem;
  }

  .toolbar-brand {
    margin-right: 0.1rem;
  }

  .toolbar-brand img {
    height: 18px;
  }

  .device-toggle {
    display: none;
  }

  .tool-btn {
    padding: 0.5rem 0.55rem;
  }

  #toggle-panel {
    position: relative;
  }

  #comment-count,
  #presence {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .presence {
    position: relative;
    padding: 0.35rem 0.2rem;
  }

  #share-btn {
    font-size: 0;
    gap: 0;
  }

  .page-row {
    gap: 0.35rem;
    padding: 0.7rem 0.45rem 0.7rem 0.65rem;
  }

  .page-view-btn {
    min-height: 2.35rem;
    padding: 0.45rem 0.7rem;
  }

  .page-comment-count {
    min-height: 2rem;
    padding: 0 0.45rem;
  }

  .panel-tab {
    padding: 0.45rem 0.7rem;
  }

  .icon-btn {
    padding: 0.55rem;
  }

  .composer-card {
    width: min(340px, calc(100vw - 1.25rem));
  }

  .reply-box {
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
  }

  .viewport.is-mobile {
    padding: 0.45rem 0.35rem 0.25rem;
  }

  .approve-card,
  .share-stack {
    max-height: calc(100dvh - 1.5rem);
    overflow: auto;
  }

  .home-main {
    padding-top: 3rem;
  }

  .url-form {
    flex-direction: column;
  }

  .url-form-row {
    flex-direction: column;
  }

  .url-form-row button {
    width: 100%;
  }
}

/* Share dialog (Pastel-style layout) */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.share-modal[hidden] {
  display: none;
}

body.share-open {
  overflow: hidden;
}

.share-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 14, 18, 0.55);
  backdrop-filter: blur(4px);
}

.share-stack {
  position: relative;
  width: min(440px, 100%);
  z-index: 1;
  animation: rise 0.22s ease;
}

.share-card {
  background: #fff;
  color: var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 1.15rem 1.2rem 1.2rem;
}

.share-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.share-card-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
}

.share-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 550;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.share-invite-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.share-invite-row input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 0.9rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(15, 20, 25, 0.14);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.share-invite-row input:focus {
  outline: none;
  border-color: rgba(200, 16, 46, 0.45);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}

.share-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 550;
  padding: 0.5rem 0.7rem;
  border: 1px solid rgba(15, 20, 25, 0.14);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.share-copy-btn:hover {
  background: #f6f8fb;
}

.share-copy-btn.is-copied {
  border-color: #16a34a;
  color: #15803d;
}

.share-copy-btn-wide {
  width: 100%;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.share-text-btn {
  display: inline-block;
  margin: 0.55rem 0 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 550;
  color: var(--accent);
  cursor: pointer;
}

.share-text-btn:hover {
  color: var(--accent-2);
}

#share-message-wrap {
  margin-top: 0.65rem;
}

#share-message-wrap textarea {
  width: 100%;
  font: inherit;
  font-size: 0.88rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(15, 20, 25, 0.14);
  border-radius: 8px;
  resize: vertical;
  min-height: 4.5rem;
  color: var(--ink);
}

.share-send {
  display: inline-flex;
  width: 100%;
  margin-top: 0.85rem;
  justify-content: center;
}

.share-status {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

.share-status.is-ok {
  color: #15803d;
}

.share-status.is-warn {
  color: #a16207;
}

.share-status.is-error {
  color: var(--accent-2);
}

.share-section {
  margin-top: 1.15rem;
}

.share-section-title {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.share-people {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 9.5rem;
  overflow: auto;
}

.share-people-empty {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.share-person {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.share-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0a1628, #1b365d);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.share-person-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.share-person-meta strong {
  font-size: 0.88rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-person-meta span {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.share-person-remove {
  flex-shrink: 0;
  width: 1.7rem;
  height: 1.7rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.share-person-remove:hover {
  background: rgba(185, 28, 28, 0.1);
  color: var(--danger, #b91c1c);
}

.share-divider {
  height: 1px;
  background: rgba(15, 20, 25, 0.08);
  margin: 1rem 0 0.9rem;
}

.share-access {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.share-access-copy strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 650;
}

.share-access-copy p {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

.share-access-pill {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 550;
  padding: 0.4rem 0.65rem;
  border: 1px solid rgba(15, 20, 25, 0.12);
  border-radius: 8px;
  background: #f6f8fb;
  color: var(--ink);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .share-invite-row {
    flex-direction: column;
  }

  .share-access {
    flex-direction: column;
  }
}

/* Approve proof dialog */
.approve-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.approve-modal[hidden] {
  display: none;
}

body.approve-open {
  overflow: hidden;
}

.approve-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 14, 18, 0.55);
  backdrop-filter: blur(4px);
}

.approve-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  background: #fff;
  color: var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem 1.25rem;
  animation: rise 0.22s ease;
}

.approve-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.approve-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.approve-disclaimer {
  margin: 0 0 1rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.approve-label,
.approve-sign-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

.approve-sign-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.85rem;
}

.approve-clear {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

#approve-name {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(15, 20, 25, 0.12);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  outline: none;
  background: #fafaf8;
}

#approve-name:focus {
  border-color: var(--accent);
}

.approve-pad-wrap {
  border: 1px dashed rgba(15, 20, 25, 0.22);
  border-radius: 10px;
  background: #f8faf8;
  overflow: hidden;
}

#approve-pad {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  cursor: crosshair;
  background: #fff;
}

.approve-error {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: #b91c1c;
}

.approve-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.btn-approve-confirm {
  border: 0;
  border-radius: 8px;
  background: #16a34a;
  color: #fff;
  font: inherit;
  font-weight: 650;
  padding: 0.65rem 1rem;
  cursor: pointer;
}

.btn-approve-confirm:hover:not(:disabled) {
  background: #15803d;
}

.btn-approve-confirm:disabled {
  opacity: 0.65;
  cursor: wait;
}
