/* View-specific styles. */

.view { display: flex; flex-direction: column; gap: 1.75rem; }
.view-head { display: flex; flex-direction: column; gap: .6rem; }
.view-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; }
.view-icon {
  display: grid; place-items: center; width: 3rem; height: 3rem; flex: none;
  background: var(--sunny); color: var(--chip-ink); border: var(--line) solid var(--ink); border-radius: 14px;
  box-shadow: 3px 3px 0 var(--ink); transform: rotate(-6deg);
}
.view-icon .icon { width: 1.75rem; height: 1.75rem; }
.view-title { font-size: clamp(1.9rem, 4.5vw, 2.75rem); font-weight: 700; text-shadow: 3px 3px 0 var(--ink); overflow-wrap: anywhere; }
.view-sub { font-family: var(--font-display); font-weight: 500; color: var(--on-table-muted); font-size: 1.1rem; }
.view-intro { color: var(--on-table-muted); max-width: 46rem; font-size: 1.05rem; white-space: pre-line; }
.view-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .25rem; }
.muted { color: var(--on-table-muted); }
.back-link { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; text-decoration: none; min-height: var(--tap); }
.back-link:hover { text-decoration: underline; }

.pile-section { display: flex; flex-direction: column; gap: .9rem; }
.section-title { display: flex; align-items: center; gap: .6rem; font-size: 1.4rem; }
.section-title > .icon { width: 1.6rem; height: 1.6rem; }
.alert-line {
  display: inline-flex; align-items: center; gap: .5rem; align-self: flex-start; padding: .5rem 1rem;
  background: var(--pink); color: var(--chip-ink); border: var(--line) solid var(--ink); border-radius: 999px; font-weight: 700;
}
.note { display: flex; gap: .5rem; align-items: flex-start; padding: .75rem 1rem; background: var(--card-alt); border-radius: var(--radius-sm); }

/* Nudges on Focus */
.nudges { display: flex; flex-wrap: wrap; gap: 1rem; }
.nudges:empty { display: none; }
.nudge {
  display: flex; align-items: center; gap: .85rem; flex-wrap: wrap; flex: 1 1 18rem; padding: .85rem 1rem;
  background: rgb(0 0 0 / .18); border: var(--line) dashed rgb(255 255 255 / .5); border-radius: var(--radius);
}
.nudge > .icon { width: 1.75rem; height: 1.75rem; }
.nudge p { flex: 1; font-weight: 700; min-width: 10rem; }

/* Filters */
.filters { display: flex; flex-direction: column; gap: .25rem; }
.filters .chip-row { margin: 0; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.filter-row label { font-weight: 700; }
.filter-row .input { background: var(--card); }

.inline-add { display: flex; gap: .75rem; flex-wrap: wrap; }
.inline-add .input { flex: 1 1 16rem; width: auto; }
.view-project .capture { max-width: 40rem; }
.view-project .capture-preview .pchip { border-color: var(--ink); }

/* Review */
.progress-wrap { display: flex; align-items: center; gap: 1rem; }
.progress {
  appearance: none; -webkit-appearance: none; flex: 1; max-width: 28rem; height: 1.25rem;
  border: var(--line) solid var(--ink); border-radius: 999px; background: var(--card); overflow: hidden;
}
.progress::-webkit-progress-bar { background: var(--card); }
.progress::-webkit-progress-value { background: var(--teal); border-radius: 999px; transition: width .4s var(--spring); }
.progress::-moz-progress-bar { background: var(--teal); border-radius: 999px; }
.progress-text { font-weight: 700; }
.review-group { display: flex; flex-direction: column; gap: .75rem; }
.review-steps { display: flex; flex-direction: column; gap: .75rem; }
.review-step {
  display: flex; align-items: center; gap: 1rem; padding: .85rem 1rem;
  background: var(--card); color: var(--card-text); border: var(--line) solid var(--card-line); border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--shadow); transition: transform .2s var(--spring), background .2s;
}
.review-step.is-checked { background: var(--done-bg); transform: rotate(-.6deg); }
.review-step.is-checked .review-step-title { text-decoration: line-through; text-decoration-thickness: 2px; }
.review-check { width: 1.75rem; height: 1.75rem; flex: none; cursor: pointer; accent-color: var(--teal); }
.review-label { flex: 1; display: flex; flex-direction: column; gap: .15rem; cursor: pointer; }
.review-step-title { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.review-step-body { color: var(--card-muted); }
.review-finish { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }

/* Search */
.search-form { display: flex; flex-direction: column; gap: .75rem; max-width: 40rem; }
.search-form .switch label { color: var(--on-table); }
.search-status { font-weight: 700; }

/* Settings */
.view-settings { max-width: 52rem; }
.settings-card {
  display: flex; flex-direction: column; gap: 1.1rem; padding: 1.25rem 1.5rem 1.5rem;
  background: var(--card); color: var(--card-text); border: var(--line) solid var(--card-line); border-radius: 22px;
  box-shadow: 6px 6px 0 var(--shadow);
}
.settings-grid { display: grid; gap: 1.1rem 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); align-items: end; }
.push-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }
.push-row > div { flex: 1 1 14rem; }
.strong { font-weight: 700; }
.ctx-list { display: flex; flex-direction: column; gap: .6rem; }
.ctx-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ctx-row .input:not(.input-small) { flex: 1 1 8rem; width: auto; }
.settings-card .icon-btn:hover { background: var(--card-alt); }

/* Editor dialog */
.dialog-editor { width: min(46rem, calc(100vw - 2rem)); }
.editor { display: flex; flex-direction: column; gap: 1.1rem; }
.input-title { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; }
.more-fields { border: 2px solid var(--field-border); border-radius: var(--radius); padding: 0 1rem; }
.more-fields[open] { padding-bottom: 1rem; }
.more-fields summary {
  display: flex; align-items: center; gap: .5rem; min-height: var(--tap); cursor: pointer; font-weight: 700; list-style: none;
}
.more-fields summary::-webkit-details-marker { display: none; }
.more-fields summary::after { content: '+'; margin-inline-start: auto; font-size: 1.4rem; font-family: var(--font-display); }
.more-fields[open] summary::after { content: '–'; }
.more-fields > * + * { margin-top: 1rem; }
.repeat { display: flex; flex-direction: column; gap: .75rem; }
.repeat-details { display: flex; flex-direction: column; gap: .9rem; padding-inline-start: .75rem; border-inline-start: var(--line) solid var(--sunny); }
.field-small .input { width: 6rem; }
.weekdays .seg label { min-width: 2.6rem; justify-content: center; }
.editor-footer { justify-content: space-between; }
.editor-footer .btn-primary { margin-inline-start: auto; }
.dialog-help .help-table { border-collapse: collapse; width: 100%; }
.help-table th, .help-table td { text-align: start; padding: .45rem .5rem; border-bottom: 1px solid var(--card-alt); vertical-align: top; }
.help-table th { white-space: nowrap; font-weight: 400; }
.help-table kbd + kbd { margin-inline-start: .25rem; }
.dialog-help h3 { font-size: 1.15rem; margin-top: .5rem; }

/* Auth */
.auth-wrap { position: relative; display: grid; place-items: center; min-height: calc(100dvh - 10rem); padding: 1rem 0; }
.auth-card {
  position: relative; z-index: 1; display: flex; flex-direction: column; gap: 1.1rem; width: min(26rem, 100%);
  padding: 2rem 1.75rem; background: var(--card); color: var(--card-text);
  border: var(--line) solid var(--card-line); border-radius: 24px; box-shadow: 10px 10px 0 var(--shadow);
  animation: deal-in .7s var(--spring);
}
.auth-title { font-size: 2rem; }
.auth-card .view-intro { color: var(--card-muted); }
.auth-card .btn-big { margin-top: .5rem; }
.auth-deco { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.auth-deco span {
  position: absolute; width: 11rem; height: 15rem; border: var(--line) solid var(--ink); border-radius: 18px; box-shadow: 6px 6px 0 var(--ink);
}
.auth-deco span:nth-child(1) { background: var(--pink); transform: translate(-12rem, 2rem) rotate(-18deg); }
.auth-deco span:nth-child(2) { background: var(--teal); transform: translate(12rem, -3rem) rotate(14deg); }
.auth-deco span:nth-child(3) { background: var(--sunny); transform: translate(9rem, 9rem) rotate(28deg); }
@media (max-width: 599px) { .auth-deco { display: none; } }

/* Accounts: auth extras */
.auth-links { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; }
.auth-link, .auth-legal a { color: var(--card-text); font-weight: 700; text-underline-offset: 3px; }
.auth-link { display: inline-flex; align-items: center; min-height: 2.75rem; }
.auth-legal { font-size: .9rem; color: var(--card-muted); }
.auth-resend:not([hidden]) { display: flex; }
/* Honeypot: invisible to people and assistive tech, still in the form for bots. */
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Avatar */
.avatar {
  display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; flex: none; margin-inline-start: .25rem;
  background: var(--sunny); color: var(--chip-ink); border: var(--line) solid var(--ink); border-radius: 50%;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem; text-decoration: none;
  transition: transform .2s var(--spring);
}
a.avatar:hover { transform: scale(1.08) rotate(-6deg); }
.avatar[aria-current="page"] { box-shadow: 0 0 0 3px var(--on-table); }
.avatar-big { width: 3rem; height: 3rem; font-size: 1.25rem; margin: 0; }

/* Devices */
.device-list { display: flex; flex-direction: column; gap: .5rem; }
.device-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .6rem 0; border-bottom: 1px solid var(--card-alt); }

/* Admin */
.view-admin { max-width: 60rem; }
.user-list { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.user-card {
  display: flex; flex-direction: column; gap: .75rem; padding: 1rem 1.1rem;
  background: var(--card); color: var(--card-text); border: var(--line) solid var(--card-line); border-radius: var(--radius);
  box-shadow: 5px 5px 0 var(--shadow);
}
.user-card.is-disabled { background: var(--card-alt); }
.user-head { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.user-id { min-width: 0; }
.user-name { font-size: 1.2rem; overflow-wrap: anywhere; }
.user-email { color: var(--card-muted); overflow-wrap: anywhere; }
.user-badges { display: flex; flex-wrap: wrap; gap: .4rem; }
.user-meta { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .9rem; color: var(--card-muted); }
.user-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.user-meta .icon { width: 1rem; height: 1rem; }
.chip-done { background: var(--done-bg); color: var(--card-text); }

.invite-heading { font-size: 1.05rem; }
