@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Sans+Condensed:wght@600;700&display=swap");

:root {
  --paper: #f5f7f4;
  --card: #ffffff;
  --ink: #0d2233;
  --slate: #5b6b7a;
  --line: #e4e9e3;
  --navy: #0d3049;
  --navy-deep: #0a2536;
  --navy-pale: #e7ecef;
  --green: #5fae47;
  --green-deep: #3e7f34;
  --green-pale: #eaf4e5;
  --amber: #b4530a;
  --danger: #a4161a;
  --danger-bg: #fbeaea;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(13, 35, 51, 0.07);
  --shadow-md: 0 6px 20px rgba(13, 35, 51, 0.09);
  --shadow-lg: 0 16px 40px rgba(13, 35, 51, 0.14);
  --sans:
    "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cond: "IBM Plex Sans Condensed", "IBM Plex Sans", system-ui, sans-serif;
  --mono:
    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
button {
  font: inherit;
  cursor: pointer;
}
[hidden] {
  display: none !important;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
}

.bar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top);
  background-image: linear-gradient(90deg, var(--navy), var(--green) 130%);
  background-size: 100% 3px;
  background-repeat: no-repeat;
  background-position: bottom;
}
.bar-in {
  max-width: 900px;
  margin: 0 auto;
  padding: 13px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-logo {
  height: 30px;
  width: auto;
  display: block;
  flex: none;
}
.brand-sep {
  width: 1px;
  height: 24px;
  background: var(--line);
  flex: none;
}
.brand-tag {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--slate);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hdr-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.hdr-btn {
  width: 38px;
  height: 38px;
  flex: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--slate);
  display: grid;
  place-items: center;
  border-radius: 999px;
  transition: 0.14s;
}
.hdr-btn:hover {
  border-color: var(--navy);
  color: var(--navy);
  background: var(--navy-pale);
}
.hdr-btn.primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.hdr-btn.primary:hover {
  background: var(--green-deep);
  border-color: var(--green-deep);
}

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 26px 20px calc(80px + env(safe-area-inset-bottom));
}

.searchbox {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 0 14px 0 18px;
  box-shadow: var(--shadow-md);
  transition:
    box-shadow 0.16s,
    border-color 0.16s;
}
.searchbox:focus-within {
  border-color: var(--green);
  box-shadow:
    0 0 0 3px var(--green-pale),
    var(--shadow-md);
}
.searchbox svg {
  color: var(--slate);
  flex: none;
}
#q {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: 16.5px;
  font-weight: 500;
  color: var(--ink);
  padding: 17px 0;
  min-width: 0;
}
#q::placeholder {
  color: #9aa9b4;
  font-weight: 400;
}
.icon-btn {
  border: 0;
  background: transparent;
  color: var(--slate);
  display: grid;
  place-items: center;
  padding: 7px;
  border-radius: var(--r-sm);
  transition:
    color 0.14s,
    background 0.14s;
}
.icon-btn:hover {
  color: var(--navy);
  background: var(--navy-pale);
}

.notice {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  border: 1px solid var(--line);
  background: var(--card);
  line-height: 1.45;
  box-shadow: var(--shadow-sm);
}
.notice.ok {
  border-color: var(--green);
  background: var(--green-pale);
  color: var(--green-deep);
}
.notice.warn,
.notice.error {
  border-color: var(--amber);
  background: #fbf0e6;
  color: var(--amber);
}
.notice span {
  flex: 1;
}

.rescount {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 20px 0 10px;
}
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.row {
  display: flex;
  align-items: stretch;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  transition:
    border-color 0.14s,
    transform 0.14s,
    box-shadow 0.14s;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.row:hover {
  border-color: var(--navy);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.plate {
  flex: none;
  width: 190px;
  padding: 12px 16px;
  background: var(--green-pale);
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
  transition: background 0.14s;
}
.code {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.01em;
  line-height: 1.15;
  color: var(--green-deep);
  word-break: break-word;
}
.row:hover .plate,
.row.featured .plate {
  background: var(--green);
}
.row:hover .code,
.row.featured .code {
  color: #fff;
}
.row:hover .plate .eyebrow,
.row.featured .plate .eyebrow {
  color: rgba(255, 255, 255, 0.75);
}
.row:hover .plate mark,
.row.featured .plate mark {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}
.info {
  flex: 1;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}
.name {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.32;
}
.cip {
  margin: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--slate);
  letter-spacing: 0.04em;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.dim {
  color: #9aa9b4;
  font-weight: 400;
  font-style: italic;
}
mark {
  background: #ffe9a8;
  color: inherit;
  border-radius: 2px;
}
.edit {
  align-self: center;
  margin-right: 10px;
  opacity: 0;
  flex: none;
}
.row:hover .edit,
.edit:focus-visible {
  opacity: 1;
}
.more {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--slate);
  text-align: center;
  margin: 18px 0 0;
}

.empty {
  text-align: center;
  padding: 56px 24px;
  border: 1px dashed #c9d3cc;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.6);
  margin-top: 20px;
}
.empty h2 {
  font-family: var(--cond);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--navy);
}
.empty p {
  margin: 0 auto 20px;
  max-width: 44ch;
  font-size: 14px;
  line-height: 1.6;
  color: var(--slate);
}

.panel {
  margin-top: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 6px;
  color: var(--green-deep);
}
.panel-head h2 {
  font-family: var(--cond);
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.panel-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--slate);
  flex: none;
}
.panel-copy {
  font-size: 13.5px;
  color: var(--slate);
  margin: 0 0 16px;
  line-height: 1.55;
}
.maps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}
.fld {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
select,
.tin {
  font-family: var(--sans);
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--ink);
  width: 100%;
  outline: 0;
}
select:focus,
.tin:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-pale);
}
.tin.mono {
  font-family: var(--mono);
  letter-spacing: 0.03em;
}
.sample {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--slate);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.panel-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}
.panel-foot.spread {
  justify-content: space-between;
}
.grp {
  display: flex;
  gap: 8px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--green);
  color: #fff;
  border: 1px solid var(--green);
  padding: 11px 18px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 600;
  transition: 0.14s;
}
.btn:hover {
  background: var(--green-deep);
  border-color: var(--green-deep);
}
.btn.ghost {
  background: transparent;
  color: var(--slate);
  border-color: var(--line);
}
.btn.ghost:hover {
  color: var(--navy);
  border-color: var(--navy);
  background: transparent;
}
.btn.danger {
  background: var(--amber);
  border-color: var(--amber);
}
.btn.ghost.danger {
  background: transparent;
  color: var(--amber);
  border-color: var(--line);
}
.btn.ghost.danger:hover {
  border-color: var(--amber);
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(13, 35, 51, 0.46);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 40;
  backdrop-filter: blur(2px);
}
.dialog {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  width: min(430px, 100%);
  box-shadow: var(--shadow-lg);
}
.dialog h2 {
  font-family: var(--cond);
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--navy);
}
.fields {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--navy);
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 34px 28px;
  width: min(360px, 100%);
  text-align: center;
}
.login-card.shake {
  animation: login-shake 0.4s;
}
.login-logo {
  height: 34px;
  width: auto;
  margin: 0 auto 22px;
  display: block;
}
.login-card h1 {
  font-family: var(--cond);
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--navy);
}
.login-card p {
  font-size: 13.5px;
  line-height: 1.5;
}
#loginForm {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#loginPass {
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: 0.1em;
  text-align: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  outline: 0;
  width: 100%;
}
#loginPass:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-pale);
}
#loginPass.invalid {
  border-color: var(--danger);
}
#loginPass.invalid:focus {
  box-shadow: 0 0 0 3px var(--danger-bg);
}
#loginForm .btn {
  width: 100%;
  justify-content: center;
}
.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  margin: 22px 0 0;
  padding: 10px 12px;
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: var(--r-sm);
  font-size: 13px;
  line-height: 1.4;
}
.login-error svg {
  flex: none;
}
.login-error span {
  flex: 1;
}

@keyframes login-shake {
  10%,
  90% {
    transform: translateX(-1px);
  }
  20%,
  80% {
    transform: translateX(2px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-4px);
  }
  40%,
  60% {
    transform: translateX(4px);
  }
}

@media (max-width: 560px) {
  .brand-tag {
    display: none;
  }
  .row {
    flex-wrap: wrap;
  }
  .plate {
    width: 100%;
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
    padding: 10px 16px;
  }
  .code {
    font-size: 19px;
  }
  .info {
    width: 100%;
    padding-right: 44px;
  }
  .edit {
    opacity: 1;
    position: absolute;
    top: 8px;
    right: 8px;
    margin: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
  .row:hover {
    transform: none;
  }
}
