/* Ed's Desk. Light theme only. Built for large, clear reading.
   Palette and card language borrowed from Jules Tools. */

:root {
  --green: #2f7d4f;
  --green-dark: #1f5c39;
  --green-light: #e8f3ec;
  --ink: #1a2420;
  --muted: #667a70;
  --line: #e2e8e4;
  --bg: #f7faf8;
  --card: #ffffff;
  --amber: #b8860b;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20,40,30,.06), 0 4px 14px rgba(20,40,30,.05);

  /* aliases used throughout */
  --accent: var(--green);
  --accent-dark: var(--green-dark);
  --accent-soft: var(--green-light);
  --text: var(--ink);
  --border: var(--line);
  --panel: var(--card);
  --success: var(--green-dark);
  --success-soft: var(--green-light);
}

* { box-sizing: border-box; }

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 12px; }
h1 { font-size: 25px; }
h2 { font-size: 19px; }
h3 { font-size: 17px; }
p { margin: 0 0 12px; }

a { color: var(--green-dark); }

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

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

.muted { color: var(--muted); }
.hidden { display: none !important; }

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}
.wordmark {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.15;
}
.wordmark:hover { text-decoration: none; color: var(--green-dark); }
.tagline {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

/* Tabs */
.tabs {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.tabs-inner {
  display: flex;
  gap: 8px;
}
.tab {
  flex: 1 1 0;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 4px solid transparent;
  padding: 8px 12px;
  border-radius: 8px 8px 0 0;
}
.tab:hover { color: var(--green-dark); background: var(--green-light); text-decoration: none; }
.tab[aria-current="page"] {
  color: var(--green-dark);
  border-bottom-color: var(--green);
}

/* Main */
main {
  padding-top: 22px;
  padding-bottom: 72px;
}
.page-title {
  font-size: 25px;
  margin: 0 0 6px;
}
.page-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.today-line {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 16px;
}
.loading {
  color: var(--muted);
  padding: 24px 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 18px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--green-dark); border-color: var(--green-dark); text-decoration: none; }
.btn-secondary { background: #fff; color: var(--green-dark); border-color: var(--line); }
.btn-secondary:hover { background: var(--green-light); border-color: var(--green); }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--line); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #9e2f24; border-color: #9e2f24; }
.btn-text {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  padding: 8px 12px;
  font-weight: 600;
}
.btn-text:hover { background: var(--green-light); border-color: transparent; color: var(--green-dark); }
.btn-block { width: 100%; }
.btn-lg { font-size: 18px; min-height: 50px; padding: 10px 24px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: default; }
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

/* Forms */
.field { margin-bottom: 14px; }
.field label, .label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.hint {
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
}
input[type="text"],
input[type="search"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="password"],
select,
textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0;
}
input::placeholder, textarea::placeholder { color: #8a9a91; }
textarea {
  line-height: 1.5;
  resize: vertical;
  min-height: 96px;
}
textarea[readonly] {
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 0 4px rgba(47,125,79,.15);
}
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 48px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%231f5c39' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M4 7l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 20px 20px;
}
input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.form-grid .field-wide { grid-column: 1 / -1; }
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}
.form-error {
  color: var(--danger);
  font-weight: 600;
  margin: 0 0 16px;
}
.form-notice {
  background: var(--green-light);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}
.form-notice p { margin: 0 0 12px; }
.inline-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-top: 4px;
}
.inline-form .field { flex: 1 1 260px; margin: 0; }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.card > h2 { margin-bottom: 12px; }
.card-lead { margin-bottom: 14px; }
.card-white { background: #fff; }
.card-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.card-actions .btn { flex: 1 1 220px; }

/* Rows inside cards (Today) */
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; padding-top: 4px; }
.row:last-child { padding-bottom: 4px; }
.row-main { flex: 1 1 auto; min-width: 0; }
.row-name { font-size: 17px; font-weight: 650; }
.row-sub { color: var(--muted); font-size: 14px; }
.row-reason { margin-top: 2px; }
.row .btn { flex: 0 0 auto; min-width: 110px; }

/* Where everyone stands: tiles */
.stand-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
}
.stand-row {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 68px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}
.stand-row:hover { background: var(--green-light); border-color: var(--green); text-decoration: none; }
.stand-row .count { font-size: 24px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stand-row .stand-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.stand-row.stand-all { background: var(--green-light); }

/* Recent activity */
.recent { list-style: none; margin: 0; padding: 0; }
.recent li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.recent li:first-child { border-top: 0; }
.recent a { color: var(--ink); text-decoration: none; display: block; }
.recent a:hover { color: var(--green-dark); }
.recent .when { color: var(--muted); }

/* Contacts toolbar and list */
.toolbar {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
  align-items: end;
  margin-bottom: 8px;
}
.toolbar .field { margin-bottom: 0; }
.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0 20px;
}
.list-count {
  color: var(--muted);
  margin: 0 0 12px;
}
.contact-list { display: block; }
.contact-row {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  margin-bottom: 10px;
  color: var(--ink);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}
.contact-row:hover { border-color: var(--green); background: var(--green-light); text-decoration: none; }
.contact-row .row-meta { color: var(--muted); font-size: 14px; }
.contact-row .row-meta span { margin-right: 18px; }
.contact-row .row-reason { color: var(--muted); }
.empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* Import steps */
.steps {
  padding-left: 28px;
  margin: 0 0 20px;
}
.steps li { margin-bottom: 14px; }
.file-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.file-pick input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.file-pick input[type="file"]:focus-visible + label { outline: 3px solid var(--green); outline-offset: 2px; }
.file-name { font-weight: 600; }
.result-box {
  background: var(--green-light);
  border: 1px solid #bfdccb;
  border-radius: 8px;
  padding: 16px;
  font-size: 17px;
  font-weight: 600;
  margin-top: 14px;
}

/* Contact page */
.contact-head { margin-bottom: 20px; }
.contact-name { font-size: 25px; font-weight: 700; margin: 0 0 4px; }
.contact-sub { color: var(--muted); font-size: 16px; }
.reason { font-size: 16px; margin-bottom: 12px; }
.variants {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.variants .btn { flex: 1 1 120px; }
.variants .btn[aria-pressed="false"] { background: #fff; color: var(--green-dark); border-color: var(--line); }
.variants .btn[aria-pressed="false"]:hover { background: var(--green-light); border-color: var(--green); }
.logged {
  background: var(--green-light);
  border: 1px solid #bfdccb;
  border-radius: 8px;
  padding: 14px 16px;
  font-weight: 600;
  margin-bottom: 14px;
}
.details-list {
  margin: 0;
  padding: 0;
}
.details-list div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 8px 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  align-items: center;
}
.details-list div:first-child { border-top: 0; }
.details-list dt { font-weight: 600; margin: 0; color: var(--muted); }
.details-list dd { margin: 0; overflow-wrap: anywhere; }
.history { list-style: none; margin: 0; padding: 0; }
.history li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.history li:first-child { border-top: 0; }
.history .when { color: var(--muted); }
.history details { margin-top: 4px; }
.history summary { cursor: pointer; color: var(--green-dark); font-weight: 600; }
.history pre {
  white-space: pre-wrap;
  font-family: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0 0;
}

/* Messages tab */
.message-block {
  margin-bottom: 22px;
}
.message-block h2 { margin-bottom: 4px; }
.message-when { color: var(--muted); margin-bottom: 14px; }
.version {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
}
.version-title { font-weight: 700; margin-bottom: 8px; }
.version textarea { margin-bottom: 10px; }
.edit-tools { margin-top: 8px; }
.edited-note { color: var(--muted); font-size: 16px; margin: 0 0 8px; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--green-dark);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  padding: 14px 24px;
  border-radius: 10px;
  width: max-content;
  max-width: calc(100% - 32px);
  text-align: center;
  z-index: 50;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.toast-error { background: var(--danger); }

/* Confirm dialog */
dialog.confirm {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 480px;
  width: calc(100% - 32px);
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow);
}
dialog.confirm::backdrop { background: rgba(26, 36, 32, 0.5); }
dialog.confirm h2 { font-size: 22px; }
.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Login */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.login-card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
  text-align: center;
}
.login-card h1 { color: var(--ink); font-size: 27px; }
.login-card .field { text-align: left; }
.code-input {
  font-size: 28px;
  letter-spacing: 0.25em;
  text-align: center;
  min-height: 60px;
}

/* Small screens */
@media (max-width: 700px) {
  .toolbar { grid-template-columns: 1fr; }
  .toolbar-actions .btn { flex: 1 1 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .row { flex-wrap: wrap; }
  .row .btn { width: 100%; }
  .page-top .btn-row { width: 100%; }
  .page-top .btn-row .btn { flex: 1 1 auto; }
  .details-list div { grid-template-columns: 1fr; gap: 2px; }
  .history li { grid-template-columns: 1fr; gap: 2px; }
  .confirm-actions .btn { flex: 1 1 auto; }
  .tab { font-size: 17px; }
  .btn { white-space: normal; }
  .stand-list { grid-template-columns: 1fr 1fr; }
  .card { padding: 16px; }
  .wrap { padding-left: 14px; padding-right: 14px; }
}

.switcher-label { margin-top: 18px; }
.switcher .btn { flex: 1 1 140px; }

/* Overlay dialog (LinkedIn import) */
dialog.modal {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  max-width: 620px;
  width: calc(100% - 32px);
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 20px 50px rgba(20,40,30,.25);
}
dialog.modal::backdrop { background: rgba(26, 36, 32, 0.5); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.modal-head h2 { margin: 0; }
dialog.modal .steps { margin-bottom: 16px; }
dialog.modal .steps li { margin-bottom: 10px; }
