/* The shell's chrome around the survey frame. Tokens come from kit/vk.css. */

body.vk {
  min-height: 100dvh;
}

/* ------------------------------------------------------------ top bar */
.sh-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--vk-bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--vk-line);
}
.sh-bar-plain {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
}
.sh-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--vk-ink);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.sh-brand img {
  border-radius: 8px;
}
.sh-bar-title {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
  font-weight: 500;
  color: var(--vk-ink-2);
  text-align: center;
}
.sh-bar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-self: end;
}
.sh-status {
  font-size: 13px;
  color: var(--vk-ink-3);
  white-space: nowrap;
  transition: color 0.2s;
}
.sh-status[data-tone='ok']::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--vk-ok);
  margin-right: 7px;
  vertical-align: 1px;
}
.sh-status[data-tone='warn'] {
  color: var(--vk-accent-ink);
}
.sh-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
}
.sh-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--vk-accent);
  transition: width 0.5s var(--vk-ease);
}

/* ------------------------------------------------------------ buttons */
.sh-button {
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--vk-line-2);
  background: var(--vk-surface);
  color: var(--vk-ink);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.1s,
    opacity 0.15s;
}
.sh-button:hover:not(:disabled) {
  background: var(--vk-surface-2);
}
.sh-button:active:not(:disabled) {
  transform: scale(0.98);
}
.sh-button:focus-visible {
  outline: none;
  box-shadow: var(--vk-focus);
}
.sh-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.sh-primary {
  background: var(--vk-ink);
  color: var(--vk-bg);
  border-color: var(--vk-ink);
}
.sh-primary:hover:not(:disabled) {
  background: var(--vk-ink);
  opacity: 0.88;
}
.sh-primary.sh-done {
  background: var(--vk-ok-soft);
  color: var(--vk-ok);
  border-color: transparent;
  cursor: default;
}
.sh-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--vk-ink-2);
}
.sh-small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

/* -------------------------------------------------------------- frame */
.sh-frame-wrap {
  position: relative;
}
.vk-frame {
  display: block;
  width: 100%;
  height: 100vh;
  border: 0;
  background: transparent;
  opacity: 0;
  transition: opacity 0.35s var(--vk-ease);
  color-scheme: normal;
}
.vk-frame-ready {
  opacity: 1;
}
.sh-banner {
  max-width: 740px;
  margin: 20px auto 0;
  padding: 12px 16px;
  border-radius: var(--vk-radius-sm);
  background: var(--vk-warn-soft);
  border: 1px solid var(--vk-warn-line);
  font-size: 14px;
  text-align: center;
}

/* The bottom dock: progress and submit, always within thumb reach on phones. */
.sh-dock {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(560px, calc(100% - 24px));
  padding: 10px 10px 10px 20px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--vk-surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border: 1px solid var(--vk-line);
  box-shadow: var(--vk-shadow-lift);
}
.sh-dock > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.sh-count {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.sh-hint {
  font-size: 12.5px;
  color: var(--vk-ink-3);
}
.sh-dock .sh-button {
  min-height: 44px;
  padding: 0 22px;
}
/* On wide screens the bar's own submit button is enough. */
@media (min-width: 900px) {
  .sh-dock .sh-button {
    display: none;
  }
  .sh-dock {
    width: auto;
    padding: 10px 20px;
  }
}
@media (max-width: 899px) {
  .sh-bar-actions .sh-primary {
    display: none;
  }
}
@media (max-width: 600px) {
  .sh-bar {
    gap: 10px;
    padding-left: 14px;
    padding-right: 14px;
  }
  .sh-brand span {
    display: none;
  }
  .sh-bar-title {
    text-align: left;
  }
}

/* -------------------------------------------------------------- pages */
.sh-main {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}
.sh-center {
  min-height: 70dvh;
  display: grid;
  place-items: center;
}
.sh-page-head {
  margin: 8px 0 28px;
}
.sh-page-head h1 {
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 650;
  letter-spacing: -0.025em;
  margin: 0 0 8px;
}
.sh-muted {
  color: var(--vk-ink-3);
  font-size: 14px;
  margin: 0;
}
.sh-back {
  display: inline-block;
  font-size: 14px;
  color: var(--vk-ink-3);
  margin-bottom: 8px;
}
a:has(> .sh-back),
a:has(> .sh-card),
a:has(> .sh-row) {
  color: inherit;
  text-decoration: none;
}
.sh-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}
.sh-url {
  font: 13px var(--vk-mono);
  color: var(--vk-ink-2);
  background: var(--vk-surface);
  border: 1px solid var(--vk-line);
  border-radius: 8px;
  padding: 6px 10px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sh-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--vk-ink-2);
  margin: 28px 0 12px;
}

.sh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}
.sh-card {
  height: 100%;
  background: var(--vk-surface);
  border: 1px solid var(--vk-line);
  border-radius: var(--vk-radius);
  padding: 18px 20px;
  box-shadow: var(--vk-shadow);
  transition:
    box-shadow 0.2s var(--vk-ease),
    transform 0.2s var(--vk-ease);
}
a:hover > .sh-card {
  box-shadow: var(--vk-shadow-lift);
  transform: translateY(-2px);
}
.sh-card h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 12px 0 6px;
  letter-spacing: -0.01em;
}
.sh-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sh-card-top .sh-button {
  margin-left: auto;
}
.sh-card-stats {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--vk-ink-3);
}
.sh-card-stats strong {
  color: var(--vk-ink);
  font-size: 15px;
}

.sh-list {
  background: var(--vk-surface);
  border: 1px solid var(--vk-line);
  border-radius: var(--vk-radius);
  overflow: hidden;
}
.sh-list > a + a .sh-row {
  border-top: 1px solid var(--vk-line);
}
.sh-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  transition: background 0.15s;
}
a:hover > .sh-row {
  background: var(--vk-surface-2);
}
.sh-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--vk-accent-soft);
  color: var(--vk-accent-ink);
  font-size: 12px;
  font-weight: 700;
}
.sh-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}
.sh-row-main small {
  color: var(--vk-ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 600px) {
  .sh-row-date {
    display: none;
  }
}

/* ----------------------------------------------------------- messages */
.sh-message {
  text-align: center;
  max-width: 420px;
}
.sh-message-icon {
  font-size: 40px;
  color: var(--vk-accent);
  line-height: 1;
}
.sh-message h1 {
  font-size: 24px;
  letter-spacing: -0.02em;
  margin: 16px 0 8px;
}
.sh-message p {
  color: var(--vk-ink-2);
  margin: 0 0 20px;
}
.sh-loading {
  min-height: 80dvh;
  display: grid;
  place-items: center;
}
.sh-spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2.5px solid var(--vk-line-2);
  border-top-color: var(--vk-accent);
  animation: sh-spin 0.8s linear infinite;
}
@keyframes sh-spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------- dialogs & sheets */
dialog {
  color: var(--vk-ink);
}
dialog::backdrop {
  background: rgba(15, 17, 21, 0.4);
  backdrop-filter: blur(3px);
}
.sh-thanks {
  border: 0;
  border-radius: 22px;
  padding: 36px 32px 28px;
  max-width: min(420px, calc(100% - 32px));
  text-align: center;
  background: var(--vk-surface);
  box-shadow: var(--vk-shadow-lift);
  animation: sh-pop 0.35s var(--vk-ease);
}
.sh-thanks h2 {
  font-size: 24px;
  margin: 14px 0 8px;
  letter-spacing: -0.02em;
}
.sh-thanks p {
  color: var(--vk-ink-2);
  margin: 0 0 22px;
}
.sh-thanks-mark {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--vk-ok-soft);
  color: var(--vk-ok);
  font-size: 26px;
  font-weight: 700;
}
@keyframes sh-pop {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(8px);
  }
}

.sh-sheet {
  border: 0;
  margin: auto auto 0;
  width: min(520px, 100%);
  max-width: 100%;
  border-radius: 24px 24px 0 0;
  padding: 10px 24px max(24px, env(safe-area-inset-bottom));
  background: var(--vk-surface);
  box-shadow: var(--vk-shadow-lift);
  animation: sh-up 0.32s var(--vk-ease);
}
@media (min-width: 600px) {
  .sh-sheet {
    margin: auto;
    border-radius: 24px;
  }
}
@keyframes sh-up {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}
.sh-sheet-grab {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--vk-line-2);
  margin: 0 auto 18px;
}

.sh-rec {
  text-align: center;
}
.sh-rec-head {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.sh-rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--vk-ink-3);
}
.sh-rec-live .sh-rec-dot {
  background: #e5484d;
  animation: sh-blink 1.2s ease-in-out infinite;
}
@keyframes sh-blink {
  50% {
    opacity: 0.25;
  }
}
.sh-rec-time {
  font-size: 34px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.sh-rec-meter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 56px;
  margin: 14px 0 6px;
}
.sh-rec-meter i {
  width: 4px;
  height: 100%;
  border-radius: 2px;
  background: var(--vk-accent);
  transform: scaleY(0.12);
  transition: transform 0.08s linear;
  opacity: 0.85;
}
.sh-rec-status {
  font-size: 14px;
  color: var(--vk-ink-2);
  min-height: 2.6em;
  margin: 6px 0 14px;
}
.sh-rec-status[data-tone='warn'] {
  color: var(--vk-accent-ink);
}
.sh-rec-actions {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.sh-rec-actions > :first-child {
  justify-self: start;
}
.sh-rec-stop {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid var(--vk-line-2);
  background: var(--vk-surface);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.12s;
}
.sh-rec-stop::after {
  content: '';
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #e5484d;
}
.sh-rec-stop:active:not(:disabled) {
  transform: scale(0.94);
}
.sh-rec-stop:disabled {
  opacity: 0.4;
}
.sh-rec-stop:focus-visible {
  outline: none;
  box-shadow: var(--vk-focus);
}

.sh-player {
  position: fixed;
  right: 16px;
  bottom: max(90px, calc(env(safe-area-inset-bottom) + 80px));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 16px;
  background: var(--vk-surface);
  border: 1px solid var(--vk-line);
  box-shadow: var(--vk-shadow-lift);
  animation: sh-up 0.25s var(--vk-ease);
}
.sh-player audio {
  height: 40px;
  max-width: calc(100vw - 100px);
}
