/* The kit's own pieces on top of base.css: avatars, the app switcher, the account sheet, the
   toast, form details. Same paper, ink and kraft; corners, not radii (except avatars, which are
   photos of people and read better round). */

/* ---- avatar ------------------------------------------------------------------------- */
.avatar {
  --size: 32px; --tint: var(--kraft);
  display: inline-grid; place-items: center; width: var(--size); height: var(--size); flex: none;
  border-radius: 50%; overflow: hidden; background: var(--tint); color: #F3EDE1;
  font-family: var(--font-form); font-weight: 700; font-size: calc(var(--size) * 0.4);
  letter-spacing: 0.02em; line-height: 1; user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.account-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0;
  background: transparent; border-radius: 50%;
}
.account-btn:hover .avatar { box-shadow: 0 0 0 2px var(--wall), 0 0 0 4px var(--kraft); }

/* ---- the app switcher: E-Mail · Plans · Board ---------------------------------------- */
.apps { display: flex; gap: 2px; }
.apps-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px;
  color: var(--ink); text-decoration: none; font-weight: 600; border: 1.5px solid transparent;
}
.apps-link .icon { font-size: 1.1rem; }
.apps-link:hover { background: var(--hover); }
.apps-link.is-current { border-color: var(--ink); background: var(--sheet); }
/* the bottom bar on a phone: three equal tabs, label under the icon */
.apps-bar {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  padding: 0 0 env(safe-area-inset-bottom); background: var(--sheet);
  border-top: 1.5px solid var(--ink);
}
.apps-bar .apps-link {
  flex-direction: column; gap: 2px; min-height: 56px; padding: 6px 0; border: 0;
  font-size: 0.75rem; font-family: var(--font-form); justify-content: center;
}
.apps-bar .apps-link .icon { font-size: 1.35rem; }
.apps-bar .apps-link.is-current { background: var(--solid); color: var(--on-solid); }

/* ---- toast -------------------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 60;
  bottom: calc(20px + env(safe-area-inset-bottom)); max-width: min(560px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px;
  background: var(--solid); color: var(--on-solid); box-shadow: var(--lift);
}
.toast .btn-icon { color: inherit; }

/* ---- sign in extras ----------------------------------------------------------------- */
.login-note { margin: 18px 0 0; color: var(--muted); font-size: var(--step--1); }
.field-password { position: relative; }
.field-password .field-input { padding-right: 48px; }
.field-eye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field .field-label { margin-top: 0; }
.field-hint { margin: 0; color: var(--muted); font-size: var(--step--1); }
.field-area { min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
select.field-input { appearance: none; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%235A5148' d='m213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32'/%3E%3C/svg%3E") no-repeat right 12px center / 16px; padding-right: 40px; }
select.field-input option { color: #24201C; background: #ECE6DC; }

/* ---- the account sheet -------------------------------------------------------------- */
.sheet-layer { position: fixed; inset: 0; z-index: 50; display: grid; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(26, 23, 20, 0.45); }
.sheet {
  position: relative; align-self: end; width: 100%; max-height: 92dvh; display: flex;
  flex-direction: column; background: var(--sheet); box-shadow: var(--lift);
  padding-bottom: env(safe-area-inset-bottom);
  animation: sheet-up 0.22s var(--ease);
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 14px 12px 10px 18px; }
.sheet-who { flex: 1; min-width: 0; display: grid; }
.sheet-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-email { color: var(--muted); font-family: var(--font-form); font-size: var(--step--1); overflow: hidden; text-overflow: ellipsis; }
.sheet-tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--rule); overflow-x: auto; }
.sheet-tab {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted);
  font-weight: 600; white-space: nowrap;
}
.sheet-tab.is-on { color: var(--ink); border-bottom-color: var(--ink); }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sheet-form { display: grid; gap: 16px; padding: 18px; }
.sheet-lede { margin: 0; color: var(--muted); }
.sheet-done { margin: 0; color: var(--green); font-weight: 600; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; padding-top: 4px; }
.sheet-actions .btn-primary { min-width: 160px; }
.field-pair { display: grid; gap: 16px; }
.photo-row { display: flex; align-items: center; gap: 18px; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.photo-actions label.btn { cursor: pointer; }
/* eight colours on one row at every width: the row shares its width, each dot stays round */
.swatches { display: grid; grid-template-columns: repeat(8, minmax(0, 40px)); gap: 6px; min-height: 44px; align-items: center; }
.swatch {
  width: 100%; aspect-ratio: 1; height: auto; padding: 0; border: 0; border-radius: 50%; background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.swatch.is-on { box-shadow: 0 0 0 2px var(--sheet), 0 0 0 4px var(--ink); }
.devices { list-style: none; margin: 0; padding: 0; display: grid; }
.device { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.device-text { flex: 1; min-width: 0; display: grid; }
.device-name { font-weight: 600; }
.device-meta { color: var(--muted); font-family: var(--font-form); font-size: var(--step--1); }

@media (min-width: 600px) {
  .field-pair { grid-template-columns: 1fr 1fr; }
}
/* tablets and laptops: a centred panel instead of a bottom sheet */
@media (min-width: 700px) {
  .sheet { align-self: center; justify-self: center; width: min(640px, calc(100vw - 48px)); max-height: min(86dvh, 820px); padding-bottom: 0; }
  .sheet-form { padding: 22px 26px 26px; }
}
@media (pointer: coarse) {
  .apps-link { min-height: 44px; }
}
