/* Ibeazy Passwords: the messenger's look (its tokens, Inter, Lucide), so the vault feels part of the app it opens in. */
:root {
  --bg: #f4f6f5;
  --panel: #ffffff;
  --text: #111815;
  --muted: #56605b;
  --faint: #66706b;
  --line: #e2e7e4;
  --accent: #1e7a52;
  --accent-text: #ffffff;
  --soft: #e4f1ea;
  --soft-text: #155e3d;
  --hover: #edf0ee;
  --warn-bg: #fdf3e1;
  --warn-text: #7a4b00;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --shadow: 0 16px 40px rgba(16, 24, 20, 0.16), 0 2px 6px rgba(16, 24, 20, 0.06);
  --scrim: rgba(16, 24, 20, 0.32);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0f1211;
    --panel: #161a18;
    --text: #e9edeb;
    --muted: #a6afaa;
    --faint: #949e99;
    --line: #2a312e;
    --accent: #3fb07f;
    --accent-text: #04130c;
    --soft: #183a2b;
    --soft-text: #8adbb3;
    --hover: #202724;
    --warn-bg: #3a2e16;
    --warn-text: #f2cf8b;
    --danger: #f59a92;
    --danger-bg: #3a1e1c;
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.3);
    --scrim: rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0f1211;
  --panel: #161a18;
  --text: #e9edeb;
  --muted: #a6afaa;
  --faint: #949e99;
  --line: #2a312e;
  --accent: #3fb07f;
  --accent-text: #04130c;
  --soft: #183a2b;
  --soft-text: #8adbb3;
  --hover: #202724;
  --warn-bg: #3a2e16;
  --warn-text: #f2cf8b;
  --danger: #f59a92;
  --danger-bg: #3a1e1c;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.3);
  --scrim: rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(../fonts/inter-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(../fonts/inter-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  font: 14px/1.5 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
#app {
  height: 100%;
}
h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
}
h1 {
  font-size: 22px;
  font-weight: 700;
}
h2 {
  font-size: 18px;
  font-weight: 700;
}
h3 {
  font-size: 15px;
  font-weight: 600;
}
p {
  margin: 0;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* DESIGN.md's one button: 36 high, radius 10; primary, plain (secondary), ghost, danger. */
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
button:hover:not(:disabled),
.button:hover {
  background: var(--hover);
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}
button.primary:hover:not(:disabled) {
  background: var(--accent);
  filter: brightness(1.06);
}
button.ghost {
  border-color: transparent;
  background: none;
}
button.danger {
  color: var(--danger);
}
button.link {
  height: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--soft-text);
  font-weight: 500;
}
button.link:hover:not(:disabled) {
  background: none;
  text-decoration: underline;
}
.icon-button {
  width: 36px;
  padding: 0;
  border-color: transparent;
  background: none;
  color: var(--muted);
}
.icon-button:hover:not(:disabled) {
  color: var(--text);
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}
textarea {
  min-height: 96px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
label.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
label.field > :is(input, select, textarea),
label.field .with-tools input {
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
}
label.check {
  display: flex;
  align-items: center;
  gap: 8px;
}
label.check input {
  width: 20px;
  min-height: 20px;
  margin: 0;
}
.with-tools {
  display: flex;
  gap: 4px;
}
.with-tools input {
  flex: 1;
  min-width: 0;
}
.mono {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

/* The locked screens: one card in the middle. */
.gate {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 24px 16px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(460px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.card-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--soft);
  color: var(--soft-text);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.actions.start {
  justify-content: flex-start;
}
.actions.between {
  justify-content: space-between;
  align-items: center;
}
.push {
  margin-right: auto;
}
.spaced {
  margin-top: 12px;
  max-width: 640px;
}
.tight {
  margin-bottom: 6px;
}
.error {
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--danger-bg);
  color: var(--danger);
}
.notice {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--warn-bg);
  color: var(--warn-text);
}

/* The strength meter: four bars that fill and colour. */
.meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.meter span {
  height: 4px;
  border-radius: 999px;
  background: var(--hover);
}
.meter[data-score='0'] span:nth-child(-n + 1),
.meter[data-score='1'] span:nth-child(-n + 1) {
  background: var(--danger);
}
.meter[data-score='2'] span:nth-child(-n + 2) {
  background: #c98a1b;
}
.meter[data-score='3'] span:nth-child(-n + 3),
.meter[data-score='4'] span {
  background: var(--accent);
}
.meter-label {
  font-size: 12px;
  color: var(--muted);
}

/* The recovery key: big, in groups, easy to copy by hand. */
.recovery-key {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--bg);
  font-size: 17px;
  letter-spacing: 0.04em;
  text-align: center;
  word-spacing: 0.3em;
  line-height: 1.8;
  user-select: all;
}

/* The open vault: a bar, then the kinds, the list and the item side by side. */
.vault {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
}
.bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.bar .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.bar .search {
  position: relative;
  flex: 1;
  max-width: 420px;
  margin-left: 8px;
}
.bar .search svg {
  position: absolute;
  left: 12px;
  top: 11px;
  color: var(--faint);
}
.bar .search input {
  padding-left: 38px;
}
.grow {
  flex: 1;
}
.columns {
  display: grid;
  grid-template-columns: 210px minmax(240px, 340px) 1fr;
  min-height: 0;
}
.kinds {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 8px;
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.kinds button {
  justify-content: flex-start;
  border: 0;
  background: none;
  color: var(--muted);
}
.kinds button.on {
  background: var(--soft);
  color: var(--soft-text);
}
.kinds-label {
  margin: 14px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
}
.kinds .count {
  margin-left: auto;
  font-size: 12px;
  color: var(--faint);
}
.list {
  border-right: 1px solid var(--line);
  overflow-y: auto;
  padding: 8px;
}
.row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  height: auto;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  text-align: left;
}
.row.on {
  background: var(--soft);
}
.row .tile,
.tile {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--hover);
  color: var(--muted);
  font-weight: 700;
}
.row .name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row .sub {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row > div {
  min-width: 0;
}
.detail {
  overflow-y: auto;
  padding: 24px;
}
.detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.fields {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 640px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.fields .line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 8px 8px 8px 16px;
  border-bottom: 1px solid var(--line);
}
.fields .line:last-child {
  border-bottom: 0;
}
.fields .line > div {
  flex: 1;
  min-width: 0;
}
.fields .label {
  font-size: 12px;
  color: var(--muted);
}
.fields .value {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 640px;
}
.empty {
  display: grid;
  place-items: center;
  gap: 10px;
  height: 100%;
  min-height: 300px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}
.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--hover);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.badge.warn {
  background: var(--warn-bg);
  color: var(--warn-text);
}
.badge.good {
  background: var(--soft);
  color: var(--soft-text);
}
.health {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 640px;
}
.score {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.score strong {
  font-size: 32px;
}

/* A window over the vault. */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--scrim);
}
.dialog {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(460px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 20px 24px 24px;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.dialog-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dialog-head h2 {
  flex: 1;
}
.generated {
  padding: 12px;
  border-radius: 10px;
  background: var(--bg);
  font-size: 17px;
  overflow-wrap: anywhere;
}
input[type='range'] {
  min-height: 0;
  padding: 0;
  accent-color: var(--accent);
}

details summary {
  cursor: pointer;
  font-weight: 600;
}
details p {
  margin: 4px 0 0 16px;
}
[hidden] {
  display: none !important;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--text);
  color: var(--panel);
  box-shadow: var(--shadow);
}

/* The desktop app's menu-bar window (?quick=1): the search and one list. */
.vault.quick .bar .search {
  max-width: none;
  margin-left: 0;
}
.quick-list {
  border-right: 0;
  overflow-y: auto;
}
.quick-row {
  gap: 8px;
}
.quick-row .grow {
  min-width: 0;
}
.quick-row .name,
.quick-row .sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quick-row button.primary {
  height: 30px;
  padding: 0 10px;
}

/* A phone: one column at a time. */
@media (max-width: 760px) {
  .columns {
    grid-template-columns: 1fr;
  }
  .kinds {
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .kinds .count {
    display: none;
  }
  .columns.showing .kinds,
  .columns.showing .list {
    display: none;
  }
  .columns:not(.showing) .detail {
    display: none;
  }
  .bar .brand span {
    display: none;
  }
  .only-phone {
    display: inline-flex;
  }
}
@media (min-width: 761px) {
  .only-phone {
    display: none;
  }
}

/* Files attached to an item: under its fields, the same rows; and the Add dialog's templates, two to a line. */
.attachments {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: 640px;
}
.attachments .kinds-label {
  margin: 0;
}
.attachments .fields {
  align-self: stretch;
}
.attachments .value svg {
  vertical-align: -3px;
}
.add-templates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

/* Documents: the upload buttons above their list; a picture shown above its files. */
.list-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 8px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.list-tools p {
  margin: 0;
  width: 100%;
}
.document-preview {
  max-width: 100%;
  max-height: 420px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  object-fit: contain;
}

/* A new login: popular sites to start from. A login's options. */
.popular-sites {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.chip:hover {
  border-color: var(--accent);
}
.login-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.login-options .check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.login-options .check input {
  margin-top: 3px;
}

.kinds button svg {
  flex: none;
}

/* The Android app's AutoFill, in Settings. */
.autofill-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.autofill-block .name {
  font-weight: 600;
}
.autofill-block .name svg {
  vertical-align: -3px;
}
.autofill-block .sub {
  color: var(--muted);
  font-size: 13px;
}
.autofill-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.autofill-actions button {
  max-width: 100%;
}
