:root {
  color-scheme: light;
  --bg: #f3f4f6;
  --panel: #ffffff;
  --line: #d7dde5;
  --text: #18212f;
  --muted: #5d6978;
  --accent: #0072c6;
  --accent-strong: #00599c;
  --danger: #c2352f;
  --success: #157347;
  --shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

body {
  min-height: 100vh;
}

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

.content {
  padding: 24px;
  max-width: 1320px;
  margin: 0 auto;
}

h1,
h2,
p {
  margin-top: 0;
}

.page-header,
.toolbar,
.entry-top,
.entry-meta,
.modal-header,
.actions,
.header-actions,
.share-box-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.page-header {
  margin-bottom: 18px;
}

.panel,
.entry-card,
.empty-card,
.empty-state,
.banner,
.install-card,
.modal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.toolbar {
  margin-bottom: 14px;
}

.toolbar input {
  flex: 1;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
}

textarea {
  resize: vertical;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button.primary {
  background: var(--accent);
  color: #fff;
}

button.primary:hover {
  background: var(--accent-strong);
}

button.ghost {
  background: #e8edf3;
  color: var(--text);
}

button.ghost.small,
.chip,
.flag,
.tag-pill {
  padding: 6px 10px;
  font-size: 13px;
}

button.small-action {
  padding: 8px 12px;
}

button.danger {
  background: #fde8e7;
  color: var(--danger);
}

.banner {
  margin-bottom: 16px;
  padding: 14px 16px;
  background: #fff8e2;
}

.banner ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.banner.hidden,
.hidden {
  display: none !important;
}

.entries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.empty-state {
  padding: 18px 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--muted);
  font-size: 15px;
}

.entry-card {
  padding: 14px;
}

.entry-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.entry-address {
  margin: 8px 0;
  color: var(--muted);
}

.entry-meta {
  font-size: 13px;
  color: var(--muted);
}

.entry-meta.subdued {
  margin-top: 8px;
}

.entry-tags,
.tag-cloud,
.tag-selector,
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.entry-tags {
  margin-top: 10px;
}

.reveal-line {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.revealed-value {
  font-family: Consolas, "Courier New", monospace;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #eef3f8;
  color: var(--text);
}

.tag-filter {
  border: 0;
  cursor: pointer;
}

.tag-manage-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tag-delete-inline {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 14px;
}

.tag-delete-inline:hover {
  background: #fde8e7;
  color: var(--danger);
}

.tag-cloud {
  margin-top: 8px;
}

.tag-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tag-option input {
  width: auto;
}

.tags-strip {
  margin-bottom: 18px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 780px);
  padding: 18px;
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.modal-card.modal-lg {
  width: min(100%, 1080px);
}

.form-panel,
.audit-panel,
.tag-form {
  display: grid;
  gap: 14px;
}

.password-preview {
  padding: 12px;
}

.revealed-password {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  font-family: Consolas, "Courier New", monospace;
  font-size: 15px;
  word-break: break-all;
}

.form-panel label,
.tag-form label {
  display: grid;
  gap: 6px;
}

.grid.two,
.share-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.share-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f9fbfd;
}

.sharing-row {
  margin-top: 6px;
}

.top-gap {
  margin-top: 12px;
}

.toggle,
.group-option {
  display: flex;
  gap: 10px;
  align-items: center;
}

.toggle input,
.group-option input {
  width: auto;
}

.group-list {
  display: grid;
  gap: 8px;
}

.modal-group-list {
  margin-top: 8px;
}

.flag {
  border-radius: 999px;
  background: #e8edf3;
}

.flag.danger {
  background: #fde8e7;
  color: var(--danger);
}

.share-note,
.share-scope-hint,
.status,
.empty-inline {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.status.ok {
  color: var(--success);
}

.status.error {
  color: var(--danger);
}

.status.hint {
  color: var(--muted);
}

.audit-list {
  display: grid;
  gap: 10px;
}

.audit-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef3f8;
  color: var(--text);
}

.chip-list.info {
  display: block;
}

.actions.end {
  justify-content: flex-end;
}

.eyebrow,
.label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.install-body {
  display: grid;
  place-items: center;
  padding: 24px;
}

.install-card {
  max-width: 760px;
  padding: 24px;
}

@media (max-width: 980px) {
  .grid.two,
  .share-grid {
    grid-template-columns: 1fr;
  }

  .reveal-line,
  .page-header,
  .toolbar,
  .header-actions,
  .modal-header {
    flex-direction: column;
    align-items: stretch;
  }
}
