/* BlurAccounter — every screen, scoped under .ac-app (docs/SITE.md). */

.ac-app {
  --ac-teal: #00c6cf;
  --ac-teal-dark: #00a3ab;
  --ac-ink: #2f3440;
  --ac-muted: #6b7280;
  --ac-line: #e3e6ec;
  --ac-bg: #f6f8fa;
  --ac-red: #c0392b;
  --ac-amber: #b7791f;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ac-bg);
  color: var(--ac-ink);
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
.ac-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.6rem 1rem; background: #fff; border-bottom: 1px solid var(--ac-line); position: relative; z-index: 20; }
.ac-brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ac-teal); font-size: 1.35rem; text-decoration: none; white-space: nowrap; }
.ac-brand b { font-weight: 700; }
.ac-logo { display: block; width: 28px; height: 28px; border-radius: 4px; }
.ac-nav { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.ac-who { color: var(--ac-muted); font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30vw; }
.ac-inline { display: inline; margin: 0; }
.ac-main { flex: 1 1 auto; width: 100%; max-width: 60rem; margin: 0 auto; padding: 1.5rem 1rem; box-sizing: border-box; }
.ac-wide-main { max-width: 90rem; }
.ac-foot { padding: 1rem; text-align: center; color: var(--ac-muted); font-size: 0.85rem; }
.ac-muted { color: var(--ac-muted); }
.ac-error, .ac-bad { color: var(--ac-red); }

/* Buttons: background, colour, border and radius together — BlurPager's
   baseline `button` rule paints white text and its own corners (its D143). */
.ac-app .ac-button, .ac-app button.ac-button {
  display: inline-block; padding: 0.55rem 1.1rem; border: 1px solid var(--ac-teal); border-radius: 6px;
  background: var(--ac-teal); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.ac-app .ac-button:hover { background: var(--ac-teal-dark); border-color: var(--ac-teal-dark); }
.ac-app .ac-small { padding: 0.35rem 0.9rem; font-size: 0.9rem; }
.ac-app .ac-wide { display: block; width: 100%; text-align: center; }
.ac-app button.ac-quiet, .ac-app button.ac-link, .ac-app button.ac-tab, .ac-app button.ac-status, .ac-app button.ac-row, .ac-app button.ac-bell-button {
  padding: 0.3rem 0.6rem; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--ac-muted); font: inherit; cursor: pointer;
}
.ac-app button.ac-link { color: var(--ac-teal-dark); text-decoration: underline; padding: 0; }
.ac-app button.ac-quiet:hover { background: rgba(0, 0, 0, 0.05); color: var(--ac-ink); }
.ac-app button:disabled { opacity: 0.6; cursor: default; }

.ac-card { background: #fff; border: 1px solid var(--ac-line); border-radius: 10px; padding: 1.25rem; margin-bottom: 1rem; }
.ac-narrow { max-width: 26rem; margin: 2rem auto; }
.ac-card h1 { margin: 0 0 1rem; font-size: 1.4rem; }
.ac-card h2 { margin: 0 0 1rem; font-size: 1.15rem; }
.ac-or { text-align: center; margin: 1rem 0 0; }

.ac-hero { padding: 2rem 0; }
.ac-hero h1 { font-size: 2rem; margin: 0 0 1rem; }
.ac-lead { font-size: 1.1rem; line-height: 1.6; max-width: 40rem; }
.ac-points { line-height: 1.8; padding-left: 1.2rem; }

/* The bell */
.ac-bell { position: relative; }
.ac-app button.ac-bell-button { position: relative; display: inline-flex; padding: 0.35rem; color: var(--ac-ink); }
.ac-bell-count { position: absolute; top: -2px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box; border-radius: 9px; background: var(--ac-red); color: #fff; font-size: 0.72rem; font-weight: 700; line-height: 18px; text-align: center; }
.ac-bell-panel { position: absolute; right: 0; top: calc(100% + 6px); width: min(24rem, 90vw); max-height: 70vh; overflow: auto; background: #fff; border: 1px solid var(--ac-line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12); }
.ac-bell-head { display: flex; justify-content: space-between; align-items: center; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--ac-line); }
.ac-bell-list { list-style: none; margin: 0; padding: 0; }
.ac-bell-list a { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.6rem 0.9rem; color: var(--ac-ink); text-decoration: none; border-bottom: 1px solid var(--ac-line); }
.ac-bell-list a:hover { background: var(--ac-bg); }
.ac-unread a { background: #effcfd; }
.ac-unread .ac-bell-text { font-weight: 600; }
.ac-bell-when { font-size: 0.8rem; color: var(--ac-muted); }
.ac-bell-empty { padding: 0.9rem; margin: 0; }

/* The companies */
.ac-companies h1 { margin-top: 0; }
.ac-company-card { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: 'code name role' 'code counts counts'; gap: 0.2rem 1rem; align-items: center; padding: 1rem 1.25rem; margin-bottom: 0.75rem; background: #fff; border: 1px solid var(--ac-line); border-radius: 10px; color: var(--ac-ink); text-decoration: none; }
.ac-company-card:hover { border-color: var(--ac-teal); }
.ac-company-code { grid-area: code; display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; border-radius: 8px; background: var(--ac-teal); color: #fff; font-weight: 700; }
.ac-company-name { grid-area: name; font-size: 1.15rem; font-weight: 600; }
.ac-company-role { grid-area: role; color: var(--ac-muted); font-size: 0.9rem; }
.ac-company-counts { grid-area: counts; display: flex; gap: 0.75rem; font-size: 0.9rem; }
.ac-late { color: var(--ac-red); }
.ac-new-company summary { cursor: pointer; font-weight: 600; }

/* Forms */
.ac-form { display: grid; gap: 0.75rem; max-width: 40rem; margin-top: 0.75rem; }
.ac-form label { display: grid; gap: 0.3rem; font-size: 0.9rem; color: var(--ac-muted); }
.ac-app input, .ac-app select, .ac-app textarea { font: inherit; color: var(--ac-ink); padding: 0.45rem 0.6rem; border: 1px solid var(--ac-line); border-radius: 6px; background: #fff; box-sizing: border-box; max-width: 100%; }
.ac-app textarea { width: 100%; resize: vertical; }
.ac-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.75rem; }
.ac-inline-form { grid-template-columns: 2fr 1fr auto; align-items: end; max-width: none; }
.ac-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.5rem; }

/* The company page */
.ac-company-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.ac-company-head h1 { margin: 0.25rem 0; }
.ac-company-head p { margin: 0; }
.ac-back { color: var(--ac-teal-dark); text-decoration: none; font-size: 0.9rem; }
.ac-tabs { display: flex; gap: 0.25rem; margin: 1rem 0; border-bottom: 1px solid var(--ac-line); }
.ac-app button.ac-tab { border-radius: 6px 6px 0 0; padding: 0.5rem 1rem; }
.ac-app button.ac-tab.ac-on { color: var(--ac-ink); border-color: var(--ac-line); border-bottom-color: var(--ac-bg); background: var(--ac-bg); margin-bottom: -1px; font-weight: 600; }
.ac-flash { padding: 0.5rem 0.75rem; border-radius: 6px; background: #effcfd; border: 1px solid #b6eef1; }
.ac-flash.ac-bad { background: #fdf0ee; border-color: #f3c4bd; }
.ac-empty { padding: 0.5rem; margin: 0; font-size: 0.9rem; }

.ac-board { display: grid; grid-template-columns: repeat(4, minmax(15rem, 1fr)); gap: 0.75rem; align-items: start; }
.ac-column { background: #eef1f5; border-radius: 10px; padding: 0.5rem; min-height: 12rem; border: 2px dashed transparent; }
.ac-column.ac-over { border-color: var(--ac-teal); background: #e3f8f9; }
.ac-column-head { display: flex; justify-content: space-between; padding: 0.25rem 0.4rem 0.6rem; font-weight: 600; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--ac-muted); }
.ac-column-body { display: grid; gap: 0.5rem; }
.ac-card-ticket { background: #fff; border: 1px solid var(--ac-line); border-left: 4px solid #cbd2dc; border-radius: 8px; padding: 0.6rem 0.7rem; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }
.ac-card-ticket:hover, .ac-card-ticket:focus { border-color: var(--ac-teal); outline: none; }
.ac-card-ticket.ac-p-high { border-left-color: var(--ac-red); }
.ac-card-ticket.ac-p-low { border-left-color: #a0aec0; }
.ac-card-ticket.ac-p-normal { border-left-color: var(--ac-teal); }
.ac-card-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.ac-ref { font-size: 0.8rem; font-weight: 700; color: var(--ac-muted); white-space: nowrap; }
.ac-card-title { margin: 0.25rem 0 0.4rem; line-height: 1.35; overflow-wrap: anywhere; }
.ac-card-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; font-size: 0.8rem; color: var(--ac-muted); }
.ac-person { font-size: 0.8rem; color: var(--ac-muted); }
.ac-due.ac-late { font-weight: 700; }
.ac-chip { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; background: #eef1f5; font-size: 0.78rem; color: var(--ac-ink); white-space: nowrap; }
.ac-chip.ac-high { background: #fdecea; color: var(--ac-red); }
.ac-s-todo.ac-chip { background: #eef1f5; }
.ac-s-doing.ac-chip { background: #e0f2fe; color: #075985; }
.ac-s-waiting.ac-chip { background: #fef3c7; color: #92400e; }
.ac-s-done.ac-chip { background: #dcfce7; color: #166534; }

.ac-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.ac-filters input[type=search] { flex: 1 1 12rem; }
.ac-rows { display: grid; gap: 0.35rem; }
.ac-app button.ac-row { display: grid; grid-template-columns: 5rem 1fr auto 6rem 9rem; gap: 0.75rem; align-items: center; width: 100%; text-align: left; padding: 0.6rem 0.75rem; background: #fff; border-color: var(--ac-line); color: var(--ac-ink); }
.ac-app button.ac-row:hover { border-color: var(--ac-teal); }
.ac-row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-row .ac-person { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ac-settings { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); align-items: start; }
.ac-members { list-style: none; padding: 0; margin: 0 0 1rem; }
.ac-members li { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--ac-line); }
.ac-member-name { font-weight: 600; }

/* The ticket panel */
body.ac-locked { overflow: hidden; }
.ac-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, 0.45); display: flex; justify-content: flex-end; }
.ac-overlay[hidden] { display: none; }
.ac-panel { width: min(44rem, 100vw); height: 100%; overflow-y: auto; background: #fff; padding: 1rem 1.25rem 2rem; box-sizing: border-box; color: var(--ac-ink); }
.ac-panel-head { display: flex; justify-content: space-between; align-items: center; }
.ac-app button.ac-close { font-size: 1.2rem; }
.ac-panel-title h2 { margin: 0.25rem 0 0.75rem; font-size: 1.35rem; overflow-wrap: anywhere; }
.ac-title-input { width: 100%; font-size: 1.2rem !important; margin: 0.25rem 0 0.75rem; }
.ac-status-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.75rem; }
.ac-app button.ac-status { border-color: var(--ac-line); color: var(--ac-ink); }
.ac-app button.ac-status.ac-on { background: var(--ac-teal); border-color: var(--ac-teal); color: #fff; font-weight: 600; }
.ac-app button.ac-status.ac-s-done.ac-on { background: #16a34a; border-color: #16a34a; }
.ac-app button.ac-status.ac-s-waiting.ac-on { background: var(--ac-amber); border-color: var(--ac-amber); }
.ac-facts { display: grid; grid-template-columns: 8rem 1fr; gap: 0.5rem 1rem; align-items: center; margin: 0 0 1rem; font-size: 0.92rem; }
.ac-facts dt { color: var(--ac-muted); }
.ac-facts dd { margin: 0; }
.ac-section-head { display: flex; justify-content: space-between; align-items: baseline; }
.ac-panel h3 { font-size: 0.95rem; margin: 1.25rem 0 0.5rem; }
.ac-text p { margin: 0 0 0.35rem; line-height: 1.5; overflow-wrap: anywhere; }
.ac-file { display: inline-flex; gap: 0.5rem; align-items: baseline; padding: 0.35rem 0.6rem; margin: 0 0.35rem 0.35rem 0; border: 1px solid var(--ac-line); border-radius: 6px; color: var(--ac-ink); text-decoration: none; font-size: 0.9rem; max-width: 100%; }
.ac-file:hover { border-color: var(--ac-teal); }
.ac-file::before { content: '📄'; }
.ac-k-pdf::before { content: '🧾'; }
.ac-k-image::before { content: '🖼'; }
.ac-k-sheet::before { content: '📊'; }
.ac-k-archive::before { content: '🗜'; }
.ac-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-comment { padding: 0.6rem 0; border-top: 1px solid var(--ac-line); }
.ac-comment-head { display: flex; gap: 0.5rem; align-items: baseline; margin-bottom: 0.25rem; }
.ac-comment-head .ac-muted { font-size: 0.8rem; }
.ac-comment-box { margin-top: 0.75rem; padding: 0.75rem; background: var(--ac-bg); border-radius: 8px; }
.ac-chosen { margin: 0.4rem 0 0; padding-left: 1.2rem; font-size: 0.9rem; }
.ac-history { margin-top: 1.25rem; font-size: 0.88rem; }
.ac-history summary { cursor: pointer; color: var(--ac-muted); }
.ac-history ul { padding-left: 1.2rem; }

/* A phone: the list first; the board scrolls sideways, a column at a time. */
@media (max-width: 700px) {
  .ac-main { padding: 1rem 0.75rem; }
  .ac-who { display: none; }
  .ac-board { grid-template-columns: repeat(4, 85vw); overflow-x: auto; scroll-snap-type: x mandatory; }
  .ac-column { scroll-snap-align: start; }
  .ac-app button.ac-row { grid-template-columns: 3.5rem 1fr 5.5rem; gap: 0.5rem; }
  .ac-row .ac-person, .ac-row .ac-chip { display: none; }
  .ac-inline-form { grid-template-columns: 1fr; }
  .ac-facts { grid-template-columns: 6.5rem 1fr; }
  .ac-panel { padding: 0.75rem 0.9rem 2rem; }
}
