:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1e2924;
  background: #f6f5f1;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --green: #305c48;
  --green-dark: #244735;
  --muted: #6c7770;
  --line: #e5e7df;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 15% 12%, rgba(224, 234, 216, 0.62), transparent 38%),
    #f6f5f1;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.auth-layout {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 20px;
}

.auth-card {
  width: min(100%, 440px);
  padding: 48px;
  border: 1px solid rgba(229, 231, 223, 0.85);
  border-radius: 22px;
  background: rgba(255, 255, 253, 0.92);
  box-shadow: 0 24px 70px rgba(42, 58, 46, 0.08);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Manrope", sans-serif;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -1.4px;
  text-decoration: none;
}

.wordmark-logo {
  width: 32px;
  height: 32px;
}

.wordmark span {
  color: #ba7c4f;
}

.eyebrow {
  margin: 44px 0 10px;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.7px;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -1.3px;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 7vw, 38px);
  line-height: 1.15;
}

.intro {
  margin: 13px 0 28px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

form {
  display: grid;
}

label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
}

input:not([type="hidden"]) {
  width: 100%;
  height: 48px;
  margin-bottom: 21px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: #fff;
  color: #1e2924;
}

input:focus {
  border-color: #6f977c;
  box-shadow: 0 0 0 3px rgba(48, 92, 72, 0.11);
}

button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 49px;
  padding: 0 17px;
  border: 0;
  border-radius: 9px;
  background: var(--green);
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 150ms ease, transform 150ms ease;
}

button:hover {
  transform: translateY(-1px);
  background: var(--green-dark);
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid #9bbda5;
  outline-offset: 3px;
}

.alert {
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid #f1c9bf;
  border-radius: 8px;
  background: #fff4f0;
  color: #883a2a;
  font-size: 13px;
  line-height: 1.5;
}

.alert[hidden] {
  display: none;
}

.footnote {
  margin: 23px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.footnote a,
.text-link {
  color: var(--green);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.alert--success {
  border-color: #b9d8c2;
  background: #eff8f1;
  color: #28533a;
}

.topbar {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 0 clamp(22px, 7vw, 100px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 253, 0.8);
}

.topbar form {
  display: block;
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar-actions > a {
  color: #334239;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.topbar-actions > a:hover {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.button-secondary {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #334239;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.button-secondary:hover {
  background: #f1f4ee;
}

.button-primary {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.button-primary:hover {
  background: var(--green-dark);
}

.dashboard {
  width: min(100% - 40px, 900px);
  margin: 80px auto;
}

.dashboard .eyebrow {
  margin-top: 0;
}

.welcome-panel {
  display: flex;
  gap: 19px;
  margin-top: 42px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 253, 0.78);
}

.panel-icon {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: #e7efe5;
  color: var(--green);
  font-size: 23px;
}

.welcome-panel h2 {
  margin: 1px 0 8px;
  font-size: 18px;
}

.welcome-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.text-link {
  display: inline-block;
  color: var(--green);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.welcome-panel .text-link {
  margin-top: 16px;
}

.tags-page {
  max-width: 980px;
}

.tags-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.tags-heading .eyebrow {
  margin-bottom: 10px;
}

.tags-heading .intro {
  margin-bottom: 0;
}

.tag-filter {
  display: flex;
  min-width: 180px;
  flex-direction: column;
  gap: 8px;
}

.tag-filter button {
  justify-content: center;
}

.tag-filter label {
  margin: 0;
  color: #48564d;
  font-size: 12px;
}

.tag-filter select {
  height: 42px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #26352c;
  font: inherit;
  font-size: 13px;
}

.tag-list {
  display: grid;
  gap: 12px;
}

.tag-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 253, 0.86);
}

.tag-card-link {
  color: inherit;
  text-decoration: none;
}

.tag-card-link:hover {
  border-color: #b6c8b7;
  background: #fff;
}

.tag-card-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: #e7efe5;
  color: var(--green);
  font-size: 25px;
}

.tag-card-image {
  display: block;
  border: 0;
  object-fit: cover;
}

.tag-card-content {
  min-width: 0;
  flex: 1;
}

.tag-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.tag-card-heading h2 {
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 16px;
}

.tag-type {
  margin: 5px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.tag-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 12px;
}

.tag-status {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.tag-status--active {
  background: #e8f3e9;
  color: #28533a;
}

.tag-status--inactive {
  background: #f0f0ec;
  color: #67716b;
}

.empty-state {
  display: grid;
  justify-items: center;
  padding: 56px 24px;
  border: 1px dashed #cfd6cb;
  border-radius: 16px;
  background: rgba(255, 255, 253, 0.64);
  text-align: center;
}

.empty-state h2 {
  margin: 18px 0 8px;
  font-size: 18px;
}

.empty-state p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.empty-state .text-link {
  margin-top: 15px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 12px;
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-actions .button-secondary {
  min-height: 36px;
  padding: 0 11px;
  font-size: 12px;
}

.pagination .is-disabled {
  color: #9aa29b;
  cursor: default;
}

.pagination .is-disabled:hover {
  transform: none;
  background: #fff;
}

.profile-page {
  max-width: 760px;
}

.profile-card {
  padding: clamp(22px, 5vw, 36px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 253, 0.86);
}

.profile-card h2 {
  margin: 0;
  font-size: 19px;
}

.profile-note {
  margin: 8px 0 26px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.profile-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}

.profile-card input[readonly] {
  background: #f4f5f1;
  color: #68746c;
}

.profile-save {
  width: 100%;
  justify-content: center;
  gap: 8px;
}

.page-count {
  padding: 0 3px;
  white-space: nowrap;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 40px;
}

.metric-card,
.profile-card,
.workspace-row {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 253, 0.88);
}

.metric-card {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.metric-card > span {
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  font-size: 32px;
  letter-spacing: -1px;
}

.metric-card a {
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.workspace-form,
.workspace-section {
  margin-top: 20px;
  padding: clamp(20px, 4vw, 32px);
}

.workspace-form h2,
.workspace-section h2 {
  margin: 0 0 15px;
  font-size: 18px;
}

.workspace-form select,
.inline-filter select {
  min-height: 45px;
  margin-bottom: 20px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #26352c;
  font: inherit;
}

.workspace-form textarea {
  width: 100%;
  min-height: 110px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
  resize: vertical;
}

.inline-filter,
.action-row,
.section-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-filter {
  margin: 20px 0;
}

.inline-filter label {
  margin: 0;
}

.inline-filter select {
  min-width: 120px;
  min-height: 38px;
  margin: 0;
}

.section-heading {
  justify-content: space-between;
}

.section-heading .profile-note {
  margin-bottom: 0;
}

.workspace-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.workspace-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px;
}

.workspace-row form {
  display: block;
}

.workspace-row-main {
  min-width: 180px;
  flex: 1;
}

.workspace-row h2 {
  margin: 0;
  font-size: 15px;
}

.workspace-row p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.workspace-row-link {
  color: inherit;
  text-decoration: none;
}

.workspace-row-link:hover {
  border-color: #b6c8b7;
}

.unread-count {
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.message-thread {
  display: grid;
  gap: 12px;
  margin: 28px 0;
}

.thread-message {
  max-width: 720px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.thread-message--scanner {
  justify-self: start;
  background: #f2f5ef;
}

.thread-message--owner {
  justify-self: end;
}

.thread-message p {
  overflow-wrap: anywhere;
  margin: 0 0 10px;
  line-height: 1.55;
}

.thread-message .thread-sender,
.thread-message time {
  color: var(--muted);
  font-size: 11px;
}

.thread-message time {
  display: block;
  margin-top: 8px;
}

.qr-preview {
  display: block;
  width: min(100%, 260px);
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.scan-layout {
  align-items: start;
  padding-top: 8vh;
}

.scan-card {
  width: min(100%, 540px);
}

.public-type-image {
  display: block;
  width: 100%;
  max-height: 260px;
  margin-bottom: 20px;
  border-radius: 14px;
  background: #e7efe5;
  object-fit: cover;
}

.public-topbar {
  justify-content: center;
}

.message-options {
  display: grid;
  gap: 10px;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

.message-options legend {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
}

.message-option {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.message-option input[type="radio"],
.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--green);
}

.message-option span {
  font-size: 13px;
  line-height: 1.4;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 9px;
}

.empty-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 35px 25px;
  }

  .eyebrow {
    margin-top: 36px;
  }

  .dashboard {
    margin-top: 48px;
  }

  .tags-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 18px;
  }

  .tag-filter {
    max-width: none;
  }

  .tag-card {
    gap: 12px;
    padding: 16px;
  }

  .profile-fields {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    justify-content: center;
    padding: 14px 18px;
  }

  .topbar-actions {
    justify-content: center;
  }

  .tag-card-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination-actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
