/* VISAGE: forms, account settings and transient surfaces. */
.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 400;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.primary-button {
  background: var(--primary-fill);
  background-size: 200% 100%;
  color: var(--primary-ink);
  box-shadow: 0 3px 12px #9c76331a;
  transition:
    background-position 0.35s,
    box-shadow 0.2s,
    transform 0.12s var(--ease);
}
.primary-button:hover {
  background-position: 100% 0;
  box-shadow: 0 5px 20px #a3855026;
}
.secondary-button {
  background: var(--field);
}
.secondary-button:hover {
  background: var(--field);
  border-color: var(--faint);
}
.danger-button {
  color: white;
  background: #964c36;
}
.danger-button:hover {
  background: #803c29;
}
.click-wave {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, #caa47877, #caa47800 70%);
  pointer-events: none;
  animation: click-wave 0.46s ease-out both;
}
.primary-button .click-wave {
  background: radial-gradient(circle, #ffffff77, #ffffff00 70%);
}
@keyframes click-wave {
  from {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  to {
    transform: translate(-50%, -50%) scale(24);
    opacity: 0;
  }
}
.dialog {
  border: 0;
  padding: 0;
  border-radius: 8px;
  width: min(520px, calc(100% - 40px));
  max-height: calc(100dvh - 60px);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: dialog-in 0.24s var(--ease) both;
}
.dialog::backdrop {
  background: #59513e33;
  backdrop-filter: blur(10px);
  animation: fade-in 0.2s ease both;
}
.dialog.closing {
  pointer-events: none;
  animation: dialog-in 0.15s ease reverse both;
}
.dialog.closing::backdrop {
  animation: fade-in 0.15s ease reverse both;
}
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.dialog-heading {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: space-between;
  padding: 22px 24px 13px;
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 2;
  flex: none;
}
.dialog-heading h2 {
  font-size: 23px;
  line-height: 1.4;
  font-weight: 400;
  letter-spacing: normal;
  overflow-wrap: anywhere;
}
.dialog-heading .icon-button {
  background: var(--field);
  color: var(--muted);
  width: 38px;
  height: 38px;
}
.dialog-heading .icon-button:hover {
  background: var(--line);
}
.dialog-heading .icon {
  width: 18px;
  height: 18px;
}
.person-form {
  padding: 0 25px 24px;
}
.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 400;
  margin: 20px 0 10px;
}
.form-label span {
  font-size: 14px;
  color: var(--muted);
}
.form-label .field-title {
  font-size: 14px;
  color: var(--text);
}
.person-form > input,
.person-form textarea,
.form-field > input,
.score-input,
.sharing-select,
.invite-result input {
  width: 100%;
  border: 1px solid transparent;
  background: var(--field);
  border-radius: 6px;
  font-size: 16px;
  line-height: 1.5;
  padding: 12px 13px;
  transition:
    background 0.16s,
    box-shadow 0.16s;
}
.person-form textarea {
  resize: vertical;
  min-height: 100px;
}
.person-form input::placeholder,
.person-form textarea::placeholder {
  color: var(--faint);
}
.person-form > input:focus,
.person-form textarea:focus,
.form-field > input:focus,
.score-input:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 12%, transparent);
}
[data-theme='dark'] .person-form > input,
[data-theme='dark'] .person-form textarea,
[data-theme='dark'] .form-field > input,
[data-theme='dark'] .score-input {
  border-color: transparent;
}
.editor-dialog[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.editor-dialog .person-form {
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 0;
  overscroll-behavior: contain;
}
.editor-fields {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}
.form-field {
  min-width: 0;
}
.form-field > input {
  min-height: 50px;
}
.score-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  min-height: 50px;
}
.score-input > input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 10px 0;
  border: 0;
  background: none;
  font-size: 20px;
  line-height: 1.4;
}
.score-input > input:focus {
  outline: 0;
}
.score-input > span {
  color: var(--muted);
  font-size: 14px;
}
.checkbox-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-top: 22px;
  font-size: 14px;
  cursor: pointer;
  min-height: 44px;
}
.checkbox-row small {
  display: block;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 4px;
}
.checkbox-row input {
  appearance: none;
  width: 38px;
  height: 22px;
  border-radius: 99px;
  background: #b5a38a;
  position: relative;
  margin: 0;
  flex: none;
  cursor: pointer;
  transition: background 0.18s;
}
.checkbox-row input::after {
  content: '';
  width: 18px;
  height: 18px;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px #0002;
  position: absolute;
  transition: transform 0.18s var(--ease);
}
.checkbox-row input:checked {
  background: var(--accent);
}
.checkbox-row input:checked::after {
  transform: translateX(16px);
}
.checkbox-row input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}
.form-hint,
.settings-hint {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.8;
  margin-top: 16px;
}
.form-error {
  font-size: 14px;
  color: var(--danger);
  line-height: 1.8;
  margin-top: 13px;
  overflow-wrap: anywhere;
}
.form-error:empty {
  display: none;
}
.draft-update {
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
  padding-top: 12px;
  margin-top: 15px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}
.editor-dialog .dialog-actions {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  padding: 18px 0 max(20px, env(safe-area-inset-bottom));
  margin-top: 20px;
  z-index: 2;
}
.photo-picker {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px;
  border-radius: 6px;
  background: var(--hover);
  width: 100%;
  text-align: left;
  min-height: 80px;
}
.photo-picker > .icon:first-child {
  width: 25px;
  height: 25px;
  color: var(--accent);
}
.photo-picker > span {
  flex: 1;
  font-size: 14px;
}
.photo-picker small {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.5;
}
.photo-picker > .icon:last-child {
  width: 18px;
  color: var(--muted);
}
.photo-picker:hover {
  background: var(--active);
}
.draft-photos:empty {
  display: none;
}
.draft-photos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-bottom: 12px;
}
.draft-photo {
  aspect-ratio: 1;
  border-radius: 5px;
  position: relative;
  background: var(--field);
}
.draft-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.draft-photo .icon-button {
  position: absolute;
  right: -5px;
  top: -5px;
  width: 28px;
  height: 28px;
  color: white;
  background: #503b29ed;
  border: 2px solid var(--surface);
  border-radius: 50%;
}
.draft-photo .icon {
  width: 13px;
  height: 13px;
}
.photo-progress {
  font-size: 14px;
  color: var(--muted);
  padding-top: 10px;
}
.confirm-dialog {
  width: min(420px, calc(100% - 40px));
}
.confirm-dialog .dialog-actions {
  padding: 0 24px 24px;
}
.confirm-message {
  padding: 15px 24px 0;
  font-size: 15px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}
.help-content {
  padding: 16px 26px 27px;
  font-size: 15px;
  line-height: 1.85;
  color: var(--muted);
}
.help-content h3 {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  margin: 22px 0 10px;
}
.help-content p + p {
  margin-top: 17px;
}
.help-content ol {
  margin: 0;
  padding-left: 22px;
}
.help-content li {
  padding-block: 3px;
}
.help-note {
  margin-top: 22px;
  padding-top: 18px;
  font-size: 14px;
  line-height: 1.9;
}
.tier-explanation {
  margin: 18px 0 22px;
}
.tier-explanation > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  font-size: 14px;
  color: var(--text);
}
.tier-explanation > div > span:last-child {
  color: var(--muted);
  font-size: 14px;
}
.tier-explanation i {
  display: none;
}
.help-intro {
  font-size: 16px;
  color: var(--text);
  line-height: 1.8;
}
.qr-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 17px 0 15px;
}
.qr-image {
  width: 224px;
  height: 224px;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  flex: none;
}
.qr-image svg {
  display: block;
  width: 100%;
  height: 100%;
}
.qr-area > p {
  font-size: 14px;
  text-align: center;
  line-height: 1.8;
}
.share-address {
  font-size: 14px;
  overflow-wrap: anywhere;
  text-align: center;
}
.qr-copy {
  display: flex;
  width: 100%;
  margin-top: 22px;
  gap: 8px;
}
.install-steps {
  list-style: none;
  padding: 0 !important;
  counter-reset: install;
}
.install-steps li {
  position: relative;
  padding: 9px 0 13px 35px !important;
  counter-increment: install;
}
.install-steps li::before {
  content: counter(install);
  position: absolute;
  left: 0;
  top: 12px;
  font-size: 14px;
  line-height: 21px;
  width: 22px;
  text-align: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 50%;
}
.install-steps strong {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  display: block;
}
.install-steps span {
  font-size: 14px;
  line-height: 1.8;
  display: block;
  margin-top: 3px;
}
.install-dialog {
  width: min(540px, calc(100% - 28px));
}
.upload-progress {
  text-align: center;
  padding: 26px 24px 38px;
}
.upload-progress p {
  font-size: 15px;
  line-height: 1.8;
  margin-top: 20px;
}
.upload-progress small {
  display: block;
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
  margin-top: 12px;
}
.spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.lightbox {
  width: min(960px, calc(100% - 48px));
  overflow: hidden;
}
.lightbox-image {
  height: min(64dvh, 640px);
  background: var(--field);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.lightbox-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 22px;
  font-size: 14px;
  color: var(--muted);
}
.toolbar-spacer {
  flex: 1;
}
.lightbox-toolbar .text-button {
  min-width: 36px;
}
.lightbox-toolbar .icon {
  width: 19px;
  height: 19px;
}
.settings-pane {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.settings-header {
  min-height: 112px;
  display: flex;
  align-items: center;
  flex: none;
}
.settings-header h1 {
  font-size: 36px;
  font-weight: 400;
  letter-spacing: normal;
}
.settings-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}
.settings-content {
  max-width: 760px;
  margin: auto;
  padding: 38px 28px 30px;
}
.my-profile {
  display: flex;
  align-items: center;
  gap: 20px;
}
.my-avatar {
  width: 62px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--field);
  border-radius: 5px;
  color: var(--accent);
  flex: none;
}
.my-avatar .icon {
  width: 29px;
  height: 29px;
}
.my-profile h2 {
  font-size: 25px;
  font-weight: 400;
  letter-spacing: normal;
}
.my-profile p {
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
}
.my-stats {
  display: flex;
  justify-content: space-around;
  padding: 30px 0;
  margin-bottom: 30px;
}
.my-stats > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}
.my-stats strong {
  font-size: 31px;
  font-weight: 400;
  letter-spacing: normal;
}
.my-stats span {
  font-size: 14px;
  color: var(--muted);
}
.settings-section {
  margin-bottom: 30px;
}
.settings-section > h3 {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 9px;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
  min-height: 67px;
  padding: 15px 0;
  text-align: left;
  font-size: 15px;
}
.setting-row:last-child {
  border-bottom: 0;
}
.setting-row > span:first-child {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.setting-row > span > .icon {
  width: 19px;
  height: 19px;
  color: var(--muted);
}
.setting-row > .icon {
  width: 15px;
  height: 15px;
  color: var(--faint);
}
.setting-row small {
  display: block;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 6px;
}
.setting-row:hover {
  background: var(--hover);
}
.setting-row.danger,
.setting-row.danger .icon {
  color: var(--danger);
}
.appearance-row select {
  border: 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  padding: 9px 0 9px 12px;
  max-width: 140px;
}
.settings-footer {
  text-align: center;
  color: var(--muted);
  font-size: 17px;
  letter-spacing: 0.12em;
  margin-top: 36px;
}
.settings-footer .version {
  font-size: 14px;
  letter-spacing: 0;
  margin-left: 6px;
}
.settings-footer p {
  font-size: 14px;
  letter-spacing: 0;
  margin: 10px 0;
  line-height: 1.7;
}
.update-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 25px;
  border-radius: 5px;
}
.sharing-panel {
  padding: 12px 25px 27px;
}
.sharing-intro {
  font-size: 14px;
  line-height: 1.9;
  color: var(--muted);
  padding: 12px 0;
}
.sharing-account {
  font-size: 14px;
  line-height: 1.8;
  overflow-wrap: anywhere;
  color: var(--muted);
}
.sharing-open {
  margin: 17px 0 7px;
  width: 100%;
}
.sharing-links {
  margin-top: 18px;
}
.sharing-select {
  font-size: 15px;
  padding: 11px 12px;
}
.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 0;
  font-size: 14px;
}
.member-row > span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.member-row strong {
  font-weight: 400;
}
.member-row small {
  display: block;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 5px;
}
.member-row select {
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px;
  background: var(--surface);
  max-width: 100px;
}
.member-row .icon-button {
  width: 36px;
  height: 36px;
}
.member-row .icon-button .icon {
  width: 16px;
  height: 16px;
}
.member-row .role-tag {
  flex: none;
}
.invite-result {
  margin-top: 20px;
}
.invite-result input {
  font-size: 14px;
  font-family: inherit;
  line-height: 1.8;
}
.invite-result .secondary-button {
  margin-top: 11px;
}
.invite-controls {
  display: flex;
  gap: 10px;
}
.invite-controls select {
  flex: 1;
  min-width: 0;
}
.invite-create {
  margin-top: 26px;
}
.active-invites {
  margin-top: 25px;
}
.active-invites > h3 {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}
.role-tag {
  display: inline-block;
  font-size: 14px;
  color: var(--muted);
  padding: 5px 8px;
  background: var(--field);
  border-radius: 4px;
}
.account-line {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 0 16px;
}
.account-line > div {
  flex: 1;
  min-width: 0;
}
.account-line strong {
  font-size: 17px;
  font-weight: 400;
}
.account-line p {
  font-size: 14px;
  color: var(--muted);
  margin-top: 5px;
  overflow-wrap: anywhere;
}
.account-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 43px;
  height: 43px;
  background: var(--field);
  color: var(--accent);
  border-radius: 50%;
}
.sharing-login {
  margin-top: 16px;
  padding-top: 24px;
}
.sharing-login h3 {
  font-size: 17px;
  font-weight: 400;
}
.sharing-login p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.9;
  margin: 10px 0 20px;
}
.invite-heading {
  font-size: 21px;
  line-height: 1.7;
  margin-top: 12px;
}
.trash-list {
  margin-top: 16px;
}
.trash-list > .empty-description {
  padding: 30px 0;
}
.activity-row {
  display: flex;
  gap: 13px;
  padding: 18px 0;
  font-size: 14px;
  line-height: 1.8;
}
.activity-row strong {
  font-weight: 500;
}
.activity-row small {
  font-size: 14px;
  color: var(--muted);
}
.activity-dot {
  margin-top: 10px;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  flex: none;
}
.score-change {
  color: var(--accent);
  font-size: 14px;
  margin-left: 6px;
}
.shared-readonly [data-action='add'],
.shared-readonly [data-action='edit'],
.shared-readonly [data-action='edit-description'],
.shared-readonly [data-action='photos'],
.shared-readonly .person-actions {
  display: none;
}
@media (max-width: 760px) {
  .dialog {
    width: calc(100% - 28px);
    max-height: calc(100dvh - 28px);
    border-radius: 8px;
  }
  .dialog-heading {
    padding: 18px 20px 10px;
  }
  .dialog-heading h2 {
    font-size: 22px;
  }
  .person-form {
    padding-inline: 20px;
  }
  .editor-fields {
    gap: 13px;
  }
  .editor-dialog .dialog-actions > button {
    flex: 1;
  }
  .form-label {
    margin-top: 17px;
  }
  .form-hint {
    font-size: 14px;
  }
  .dialog-heading .icon-button {
    width: 40px;
    height: 40px;
  }
  .settings-header {
    min-height: 84px;
    padding: 0 22px;
  }
  .settings-header h1 {
    font-size: 29px;
  }
  .settings-content {
    padding: 27px 23px;
  }
  .my-profile h2 {
    font-size: 23px;
  }
  .my-profile p {
    font-size: 14px;
  }
  .settings-section {
    margin-bottom: 27px;
  }
  .settings-hint {
    font-size: 14px;
  }
  .lightbox {
    width: 100%;
    max-height: 100dvh;
    border-radius: 0;
  }
  .lightbox-image {
    height: 65dvh;
  }
  .lightbox-toolbar {
    padding: 12px 15px max(12px, env(safe-area-inset-bottom));
    gap: 8px;
  }
  .sharing-panel {
    padding: 8px 20px 23px;
  }
  .invite-controls .primary-button {
    padding-inline: 14px;
  }
  .member-row {
    gap: 7px;
  }
  .member-row small {
    font-size: 14px;
  }
  .member-row select {
    max-width: 90px;
  }
}
@media (max-width: 360px) {
  .editor-fields {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .draft-photos {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
    border-color: var(--accent);
  }
}
.invite-ready {
  margin-top: 18px;
  padding-top: 18px;
}
.invite-ready p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 12px;
}
.device-options {
  margin-top: 27px;
  padding-top: 19px;
}
.device-options summary {
  font-size: 14px;
  cursor: pointer;
  min-height: 30px;
}
.device-options .secondary-button {
  margin-top: 14px;
}
.device-options .text-button {
  display: block;
  margin-top: 12px;
}
