/* Rasid on the computer: layout and Material 3 components in Rasid's colors.
   Widths: compact (< 600px) one column with a bottom bar, like the phone; medium (600-959px) side rail and one
   column; expanded (960px and up) side rail with the item list beside the selected item's detail. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--background);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--background);
  color: var(--on-background);
  font: var(--body-large);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Selected text (a wrong PIN is selected for retyping) in Rasid's own color, not the browser's blue. */
::selection { background: var(--primary); color: var(--on-primary); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--primary); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.icon { flex: none; display: block; }

/* Visible focus for every control (keyboard), never on mouse clicks. */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 8px;
}
main:focus-visible, [tabindex="-1"]:focus-visible { outline: none; }
.report:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

.skip {
  position: fixed;
  left: 16px; top: -64px;
  z-index: 50;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--inverse-surface);
  color: var(--inverse-on-surface);
  font: var(--label-large);
  text-decoration: none;
  transition: top 0.15s var(--ease);
}
.skip:focus { top: 12px; }

.noscript { padding: 24px; text-align: center; }

/* ---------------------------------------------------------------- shell */

.app { min-height: 100vh; min-height: 100dvh; }

.shell {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 18px 0 24px;
  background: var(--surface);
  border-right: 1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent);
  overflow-y: auto;
}
.rail__logo .logo { border-radius: 12px; box-shadow: var(--shadow); }
.rail__items { display: flex; flex-direction: column; gap: 14px; }

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 80px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--on-surface-variant);
  font: var(--label-medium);
  -webkit-tap-highlight-color: transparent;
}
.nav-item__pill {
  display: grid;
  place-items: center;
  width: 56px;
  height: 32px;
  border-radius: 999px;
  transition: background-color 0.2s var(--ease);
}
.nav-item:hover .nav-item__pill { background: color-mix(in srgb, var(--on-surface) 8%, transparent); }
.nav-item[aria-current="page"] { color: var(--on-surface); font-weight: 600; }
.nav-item[aria-current="page"] .nav-item__pill {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}
.nav-item:focus-visible { outline: none; }
.nav-item:focus-visible .nav-item__pill { outline: 3px solid var(--primary); outline-offset: 2px; }

.column { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(48px, 1fr) auto minmax(48px, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 64px;
  padding: 8px 12px 8px 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.topbar__lead { display: flex; align-items: center; }
.topbar__logo { display: none; }
.topbar__logo .logo { border-radius: 10px; }
.topbar__title { text-align: center; min-width: 0; }
.topbar__name { font: var(--title-large); font-weight: 700; letter-spacing: 0; }
.topbar__sub { font: var(--label-medium); color: var(--on-surface-variant); }
.topbar__heading { font: var(--title-large); font-weight: 600; text-align: center; }
.topbar__actions { display: flex; justify-content: flex-end; gap: 4px; }

.bottom-nav { display: none; }

.main { flex: 1; min-width: 0; padding-bottom: 32px; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: var(--label-large);
  text-align: center;
  white-space: normal;
  transition: background-color 0.15s var(--ease), box-shadow 0.15s var(--ease), color 0.15s var(--ease);
}
.btn .icon { width: 18px; height: 18px; margin-left: -8px; }
.btn--filled { background: var(--primary); color: var(--on-primary); }
.btn--filled:hover:not(:disabled) { box-shadow: var(--shadow); background: color-mix(in srgb, var(--on-primary) 8%, var(--primary)); }
.btn--tonal { background: var(--secondary-container); color: var(--on-secondary-container); }
.btn--tonal:hover:not(:disabled) { background: color-mix(in srgb, var(--on-secondary-container) 8%, var(--secondary-container)); }
.btn--outlined { border-color: var(--outline); background: transparent; color: var(--primary); }
.btn--outlined:hover:not(:disabled) { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.btn--text { background: transparent; color: var(--primary); padding: 8px 12px; }
.btn--text .icon { margin-left: 0; }
.btn--text:hover:not(:disabled) { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.btn--danger { color: var(--error); }
.btn--danger:hover:not(:disabled) { background: color-mix(in srgb, var(--error) 8%, transparent); }
.btn:disabled {
  background: color-mix(in srgb, var(--on-surface) 12%, transparent);
  border-color: transparent;
  color: color-mix(in srgb, var(--on-surface) 45%, transparent);
  box-shadow: none;
}
.btn--text:disabled, .btn--outlined:disabled { background: transparent; }
.btn--outlined:disabled { border-color: color-mix(in srgb, var(--on-surface) 14%, transparent); }
.btn--block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row > .btn { flex: 1 1 140px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--on-surface-variant);
  transition: background-color 0.15s var(--ease);
}
.icon-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--on-surface-variant) 10%, transparent); }
.icon-btn:focus-visible { border-radius: 50%; }

.fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 20px 0 16px;
  border: 0;
  border-radius: 16px;
  background: var(--primary-container);
  color: var(--on-primary-container);
  font: var(--label-large);
  box-shadow: var(--shadow-high);
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.fab:hover { transform: translateY(-1px); }
.fab:focus-visible { border-radius: 16px; }

/* ---------------------------------------------------------------- fields */

.field { position: relative; --field-bg: var(--surface); }
.field__input {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 16px;
  border: 1px solid var(--outline);
  border-radius: 4px;
  background: transparent;
  color: var(--on-surface);
  font: var(--body-large);
  transition: border-color 0.15s var(--ease);
}
textarea.field__input { resize: vertical; min-height: 88px; padding-top: 18px; }
.field__input:hover { border-color: var(--on-surface); }
.field__input:focus { outline: none; border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.field__input:focus-visible { outline: none; }
.field__label {
  position: absolute;
  left: 12px;
  top: 16px;
  max-width: calc(100% - 24px);
  padding: 0 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: var(--field-bg);
  color: var(--on-surface-variant);
  font: var(--body-large);
  pointer-events: none;
  transform-origin: left top;
  transition: transform 0.15s var(--ease), color 0.15s var(--ease), top 0.15s var(--ease);
}
.field__input:focus + .field__label,
.field__input:not(:placeholder-shown) + .field__label,
.field__label--up {
  top: -9px;
  font: var(--body-small);
  line-height: 18px;
}
.field__input:focus + .field__label { color: var(--primary); }
.field--icon .field__input { padding-left: 50px; }
.field--icon .field__label { left: 46px; max-width: calc(100% - 58px); }
.field--icon .field__input:focus + .field__label,
.field--icon .field__input:not(:placeholder-shown) + .field__label { left: 12px; }
.field__icon {
  position: absolute;
  left: 14px;
  top: 17px;
  color: var(--on-surface-variant);
  pointer-events: none;
}
.field--error .field__input, .field--error .field__input:focus { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.field--error .field__label, .field--error .field__input:focus + .field__label { color: var(--error); }
.field-error { margin: -4px 4px 0; color: var(--error); font: var(--body-small); }
.field--select select.field__input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  background-image: linear-gradient(45deg, transparent 50%, var(--on-surface-variant) 50%),
    linear-gradient(135deg, var(--on-surface-variant) 50%, transparent 50%);
  background-position: calc(100% - 22px) 25px, calc(100% - 17px) 25px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.field--select option { background: var(--surface-container-high); color: var(--on-surface); }

/* ---------------------------------------------------------------- switches, chips, status */

.toggle-row { display: flex; align-items: center; gap: 12px; }
.toggle-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; cursor: pointer; }
.toggle-row__title { font: var(--body-large); font-weight: 600; }
.toggle-row__sub { font: var(--body-small); color: var(--on-surface-variant); }

.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 52px;
  height: 32px;
  margin: 0;
  border: 2px solid var(--outline);
  border-radius: 999px;
  background: var(--surface-container-highest);
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.switch::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--outline);
  transform: translateY(-50%);
  transition: all 0.2s var(--ease);
}
.switch:checked { background: var(--primary); border-color: var(--primary); }
.switch:checked::before { left: 22px; width: 24px; height: 24px; background: var(--on-primary); }
.switch:disabled { opacity: 0.38; cursor: default; }
.switch:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 999px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 16px;
  border: 1px solid var(--outline-variant);
  border-radius: 8px;
  background: transparent;
  color: var(--on-surface-variant);
  font: var(--label-large);
  transition: background-color 0.15s var(--ease);
}
.chip:hover { background: color-mix(in srgb, var(--on-surface-variant) 8%, transparent); }
.chip--on {
  padding-left: 8px;
  border-color: transparent;
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}
.chip--on:hover { background: color-mix(in srgb, var(--on-secondary-container) 8%, var(--secondary-container)); }
.chip--on .icon { width: 18px; height: 18px; }

.status {
  flex: none;
  align-self: flex-start;
  padding: 5px 10px;
  border-radius: 999px;
  font: var(--label-medium);
  white-space: nowrap;
}
.status--ok { background: var(--secondary-container); color: var(--on-secondary-container); }
.status--low { background: var(--tertiary-container); color: var(--on-tertiary-container); }
.status--out { background: var(--error-container); color: var(--on-error-container); }

.muted { color: var(--on-surface-variant); }

/* ---------------------------------------------------------------- panes */

.pane {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}
.pane--narrow { max-width: 820px; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 16px;
  text-align: center;
}
.empty__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 6px;
  border-radius: 18px;
  background: var(--primary-container);
  color: var(--on-primary-container);
}
.empty__title { font: var(--title-medium); font-weight: 600; }
.empty__body { color: var(--on-surface-variant); font: var(--body-medium); }

/* ---------------------------------------------------------------- stock */

.list-pane { display: flex; flex-direction: column; gap: 12px; }

.stats { display: flex; flex-direction: column; gap: 10px; }
.stats__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stats__row--b { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.stat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 12px;
  border-radius: var(--radius-card);
  background: var(--primary-container);
}
.stat__label { font: var(--label-medium); color: var(--on-primary-container); }
.stat__value {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font: var(--title-large);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--on-surface);
}

.field--search { --field-bg: var(--surface); }

.items { display: flex; flex-direction: column; gap: 12px; }

.item {
  border-radius: var(--radius-card);
  background: var(--surface-container-highest);
  transition: box-shadow 0.15s var(--ease), background-color 0.15s var(--ease);
}
.item__main {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding: 14px 14px 10px;
  border: 0;
  border-radius: var(--radius-card);
  background: transparent;
  text-align: left;
}
.item__head { display: flex; align-items: flex-start; gap: 10px; }
.item__titles { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item__name { font: var(--title-medium); font-weight: 600; overflow-wrap: anywhere; }
.item__line {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font: var(--body-small);
  color: var(--on-surface-variant);
  overflow-wrap: anywhere;
}
.item__qty { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.item__amount { font: var(--headline-small); font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.item__alert { font: var(--body-small); color: var(--on-surface-variant); }
.move-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.move-btns--card { padding: 0 14px 14px; }
.move-btns > .btn { flex: 1 1 72px; padding-left: 16px; padding-right: 16px; }

/* Expanded: list beside detail, each scrolling on its own. */
.shell--split .main { padding-bottom: 0; }
.split {
  display: grid;
  grid-template-columns: minmax(340px, 440px) minmax(0, 1fr);
  gap: 24px;
  height: calc(100vh - 64px);
  height: calc(100dvh - 64px);
  padding: 0 24px 0 16px;
}
.split__list { position: relative; min-height: 0; }
.split__list .list-pane {
  height: 100%;
  overflow-y: auto;
  padding: 8px 8px 112px 4px;
  scrollbar-gutter: stable;
}
.split__list .fab { position: absolute; right: 16px; bottom: 24px; }
.split__detail {
  min-height: 0;
  overflow-y: auto;
  padding: 8px 0 32px;
  scrollbar-gutter: stable;
}
.split .item__main { padding-bottom: 14px; }
.split .item:hover { background: color-mix(in srgb, var(--on-surface) 4%, var(--surface-container-highest)); }
.item--selected,
.split .item--selected:hover {
  background: var(--secondary-container);
  box-shadow: inset 0 0 0 2px var(--primary);
}
.item--selected .item__line, .item--selected .item__alert { color: var(--on-secondary-container); }

.detail {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 760px;
  min-height: 100%;
  padding: 28px;
  border-radius: var(--radius-dialog);
  background: var(--surface-container-low);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--outline-variant) 60%, transparent);
}
.detail--empty { display: grid; place-items: center; }
.detail__placeholder { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 32px; }
.detail__placeholder-icon {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  margin-bottom: 8px;
  border-radius: 24px;
  background: var(--primary-container);
  color: var(--on-primary-container);
}
.detail__back { margin: -12px 0 -8px -12px; }
.detail__head { display: flex; align-items: flex-start; gap: 16px; }
.detail__titles { flex: 1; min-width: 0; }
.detail__name { font: var(--headline-medium); font-weight: 600; overflow-wrap: anywhere; }
.detail__line { margin-top: 4px; color: var(--on-surface-variant); font: var(--body-medium); overflow-wrap: anywhere; }
.detail__head .status { margin-top: 6px; }
.detail__hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 20px 24px;
  border-radius: 20px;
  background: var(--primary-container);
  color: var(--on-primary-container);
}
.detail__qty { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.detail__amount {
  font: var(--display-small);
  font-size: 3rem;
  line-height: 3.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--on-surface);
  overflow-wrap: anywhere;
}
.detail__unit { font: var(--title-large); color: var(--on-primary-container); }
.detail__alert { font: var(--label-large); color: var(--on-primary-container); padding-bottom: 8px; }
.detail--low .detail__hero { background: var(--tertiary-container); color: var(--on-tertiary-container); }
.detail--low .detail__unit, .detail--low .detail__alert { color: var(--on-tertiary-container); }
.detail--out .detail__hero { background: var(--error-container); color: var(--on-error-container); }
.detail--out .detail__unit, .detail--out .detail__alert { color: var(--on-error-container); }
.move-btns--detail > .btn { flex: 1 1 96px; min-height: 48px; }

.facts {
  --line: color-mix(in srgb, var(--outline-variant) 70%, transparent);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
  overflow: hidden;
  border-radius: 16px;
  background: var(--surface-container-low);
  box-shadow: inset 0 0 0 1px var(--line);
}
.fact { padding: 12px 16px; min-width: 0; box-shadow: 1px 1px 0 0 var(--line); }
.fact dt { font: var(--label-medium); color: var(--on-surface-variant); }
.fact dd { font: var(--body-large); overflow-wrap: anywhere; }
.fact--note { grid-column: 1 / -1; }
.fact--note dd { white-space: pre-wrap; }
.detail__h3 { font: var(--title-medium); font-weight: 600; margin-bottom: 10px; }

/* ---------------------------------------------------------------- history */

.moves { display: flex; flex-direction: column; gap: 10px; }
.move {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-card);
  background: var(--surface-container-highest);
}
.move__badge {
  display: grid;
  place-items: center;
  flex: none;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--primary-container);
  color: var(--on-primary-container);
  font: var(--title-medium);
  font-weight: 700;
}
.move__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.move__title { font: var(--body-large); font-weight: 600; }
.move__name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.move__date { font: var(--body-small); color: var(--on-surface-variant); }
.move__now { flex: none; font: var(--label-large); font-variant-numeric: tabular-nums; }
.moves--compact .move { background: var(--surface-container); padding: 10px 14px; }
.moves--compact .move__badge { min-width: 34px; height: 34px; padding: 0 10px; font: var(--title-small); font-weight: 700; }

/* ---------------------------------------------------------------- reports */

.report-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.report-actions > .btn { flex: 1 1 140px; }
.report {
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-variant);
  color: var(--on-surface);
  font: var(--body-medium);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 4;
}

/* ---------------------------------------------------------------- settings */

.pane--settings { max-width: 1120px; }
.groups { columns: 2 440px; column-gap: 16px; }
.group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  break-inside: avoid;
  margin-bottom: 14px;
  padding: 14px 16px 16px;
  border-radius: var(--radius-card);
  background: var(--surface-container-highest);
  --field-bg: var(--surface-container-highest);
}
.group .field { --field-bg: var(--surface-container-highest); }
.group__title { font: var(--title-medium); font-weight: 600; }

.suppliers { display: flex; flex-direction: column; gap: 8px; }
.supplier {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
}
.supplier__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.supplier__name { font-weight: 600; overflow-wrap: anywhere; }
.supplier__sub { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: var(--body-small); color: var(--on-surface-variant); }

/* ---------------------------------------------------------------- dialogs */

.dlg {
  width: min(560px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius-dialog);
  background: var(--surface-container-high);
  color: var(--on-surface);
  box-shadow: var(--shadow-high);
  overflow: hidden;
  --field-bg: var(--surface-container-high);
}
.dlg .field { --field-bg: var(--surface-container-high); }
.dlg::backdrop { background: rgb(0 0 0 / 0.32); }
.dlg[open] { animation: dlg-in 0.2s var(--ease); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.dlg__surface {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 48px);
  padding: 24px 24px 18px;
}
.dlg__title { font: var(--headline-small); padding-right: 32px; }
.dlg__subtitle { margin-top: 8px; color: var(--on-surface-variant); }
.dlg__body { margin-top: 16px; overflow-y: auto; padding: 10px 2px 4px; margin-left: -2px; margin-right: -2px; }
.dlg__text { color: var(--on-surface-variant); font: var(--body-medium); }
.dlg__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.dlg__spacer { flex: 1; }
.dlg__close { position: absolute; top: 14px; right: 14px; }
.dlg__handle { display: none; }

.form { display: flex; flex-direction: column; gap: 14px; }
.form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 8px; }
.form__item { font: var(--title-medium); font-weight: 600; }

.keys { display: flex; flex-direction: column; gap: 4px; }
.keys__row { display: flex; align-items: center; gap: 16px; padding: 8px 4px; border-bottom: 1px solid color-mix(in srgb, var(--outline-variant) 60%, transparent); }
.keys__row dt { flex: none; width: 56px; }
kbd {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--outline-variant);
  border-bottom-width: 3px;
  border-radius: 8px;
  background: var(--surface-container-lowest);
  font: var(--label-large);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
.keys__note { margin-top: 12px; font: var(--body-small); }

/* ---------------------------------------------------------------- toast */

.toast-region {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 100;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.toast-region--show { opacity: 1; transform: translate(-50%, 0); }
.toast {
  max-width: min(480px, calc(100vw - 32px));
  padding: 12px 20px;
  border-radius: 24px;
  background: var(--inverse-surface);
  color: var(--inverse-on-surface);
  font: var(--body-medium);
  box-shadow: var(--shadow-high);
  text-align: center;
}

/* ---------------------------------------------------------------- lock */

.lock {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 70%),
    var(--surface);
}
.lock__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(420px, 100%);
  padding: 36px 28px 28px;
  border-radius: var(--radius-dialog);
  background: var(--surface-container-low);
  box-shadow: var(--shadow);
  text-align: center;
  --field-bg: var(--surface-container-low);
}
.lock__card .field { --field-bg: var(--surface-container-low); }
.lock__icon { color: var(--primary); }
.lock__icon .icon { width: 52px; height: 52px; }
.lock__title { margin-top: 16px; font: var(--headline-small); font-weight: 600; }
.lock__sub { margin-top: 6px; color: var(--on-surface-variant); }
.lock__form { display: flex; flex-direction: column; gap: 12px; width: 100%; margin-top: 22px; text-align: left; }
.lock__form .field-error { margin-top: -6px; }

/* ---------------------------------------------------------------- about */

.about { min-height: 100vh; min-height: 100dvh; background: var(--background); }
.topbar--about { background: color-mix(in srgb, var(--background) 92%, transparent); }
.about__body {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 16px 32px;
}
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 8px 0 16px;
  padding: 26px 22px;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--primary), var(--primary-container));
  color: var(--on-primary);
  text-align: center;
}
.hero__avatar {
  display: grid;
  place-items: center;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.18);
}
.hero__avatar img {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 6px rgb(255 255 255 / 0.32);
}
.hero__name { margin-top: 16px; font: var(--headline-medium); font-weight: 700; }
.hero__role {
  margin-top: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.22);
  font: var(--label-large);
}
.hero__tagline { margin-top: 14px; max-width: 520px; color: rgb(255 255 255 / 0.92); font: var(--body-medium); }
.about-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.about-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 8px;
  border-radius: 18px;
  background: var(--surface-variant);
  text-align: center;
}
.about-stat__value { font: var(--headline-small); font-weight: 700; }
.about-stat__label { font: var(--label-small); color: var(--on-surface-variant); }
.about__section { padding: 18px 0 10px; font: var(--title-medium); font-weight: 700; }
.own-apps { display: flex; flex-direction: column; gap: 10px; }
.own-app {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 20px;
  background: var(--surface-variant);
  color: var(--on-surface);
  text-decoration: none;
  transition: background-color 0.15s var(--ease);
}
.own-app:hover, .connect__tile:hover { background: color-mix(in srgb, var(--on-surface) 6%, var(--surface-variant)); }
.own-app img { width: 54px; height: 54px; border-radius: 16px; object-fit: cover; }
.own-app__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.own-app__name { font: var(--title-medium); font-weight: 600; }
.own-app__sub { font: var(--body-small); color: var(--on-surface-variant); }
.own-app__btn {
  flex: none;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font: var(--label-large);
}
.connect { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.connect__tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border-radius: 18px;
  background: var(--surface-variant);
  color: var(--on-surface);
  text-decoration: none;
  transition: background-color 0.15s var(--ease);
}
.connect__tile--row { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 12px; }
.connect__text { display: flex; flex-direction: column; min-width: 0; }
.connect__title { font: var(--title-small); font-weight: 600; }
.connect__sub { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: var(--label-small); color: var(--on-surface-variant); }
.icon-chip {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  color: var(--primary);
}
.feedback-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-top: 18px;
  padding: 20px;
  border: 0;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--tertiary), var(--primary));
  color: var(--on-primary);
  text-align: left;
  transition: filter 0.15s var(--ease);
}
.feedback-card:hover { filter: brightness(1.05); }
.feedback-card:focus-visible { border-radius: 22px; }
.feedback-card__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--on-primary) 15%, transparent);
}
.feedback-card__text { display: flex; flex-direction: column; }
.feedback-card__title { font: var(--title-medium); font-weight: 600; }
.feedback-card__sub { font: var(--body-small); opacity: 0.85; }

/* ---------------------------------------------------------------- print (only shown by print.css) */

.print-report { display: none; }

/* ---------------------------------------------------------------- medium: rail, one column */

@media (min-width: 960px) {
  .shell--split .column { height: 100vh; height: 100dvh; overflow: hidden; }
  .shell--split .main { overflow: hidden; }
  .topbar { padding-left: 24px; padding-right: 20px; }
}

@media (min-width: 600px) and (max-width: 959.98px) {
  .detail { min-height: 0; }
  .pane--detail-page { max-width: 820px; }
}

/* ---------------------------------------------------------------- compact: phone width */

@media (max-width: 599.98px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .topbar { padding: 8px 4px 8px 12px; }
  .topbar__logo { display: block; }
  .only-pointer { display: none; }
  .main { padding-bottom: 96px; }
  .bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 7;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    background: var(--surface-container);
  }
  .bottom-nav .nav-item { width: auto; }
  .fab { right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); padding: 0; width: 56px; justify-content: center; }
  .fab__label { display: none; }
  .toast-region { bottom: 104px; }
  .detail { padding: 20px 16px; border-radius: 20px; min-height: 0; }
  .detail__name { font: var(--headline-small); font-weight: 600; }
  .detail__hero { padding: 16px 18px; }
  .move-btns--detail > .btn { flex: 1 1 64px; padding-left: 12px; padding-right: 12px; }
  .dlg--sheet {
    width: 100%;
    margin: auto 0 0;
    border-radius: 28px 28px 0 0;
    max-height: calc(100dvh - 24px);
  }
  .dlg--sheet .dlg__handle {
    display: block;
    width: 32px;
    height: 4px;
    margin: -12px auto 14px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--on-surface-variant) 40%, transparent);
  }
  .dlg__surface { padding: 22px 20px 16px; }
  .groups { columns: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
