:root {
  --teal: #0d7377;
  --teal-dark: #095a5d;
  --teal-deep: #072a2c;
  --ink: #14201e;
  --muted: #5c6560;
  --line: #c9d4d1;
  --bg: #f2f6f5;
  --white: #ffffff;
  --danger: #b42318;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Sora", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.err {
  color: var(--danger);
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.muted {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.linkish {
  display: block;
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.35rem;
  border: 0;
  background: transparent;
  color: var(--teal-dark, #095a5d);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.linkish:hover {
  color: var(--teal, #0d7377);
}

.hint {
  margin: 1rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

/* —— Auth —— */
.auth-lang {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 2;
}

.board-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.chip {
  min-height: 32px;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

.chip.is-on {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.auth-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(13, 115, 119, 0.55), transparent 55%),
    linear-gradient(180deg, #0a3f42, var(--teal-deep));
  color: var(--white);
}

.back-home {
  position: absolute;
  top: 1.1rem;
  left: 1.1rem;
  z-index: 2;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.auth-card {
  width: min(400px, 100%);
  margin: 0 auto;
  padding: 1.75rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.auth-logo {
  width: 180px;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.25));
}

.auth-card h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.75rem;
}

.auth-card label {
  display: block;
  margin: 0.85rem 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.auth-card input {
  width: 100%;
  min-height: 46px;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
  color: var(--white);
  font: inherit;
}

.auth-card input:focus {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 1px;
}

.auth-card button {
  width: 100%;
  margin-top: 1.15rem;
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: var(--white);
  color: var(--teal-dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.auth-card button:hover {
  filter: brightness(0.97);
}

/* —— App —— */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: var(--teal-deep);
  color: var(--white);
}

.top-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  justify-self: start;
}

.top-brand img {
  height: 28px;
  width: auto;
}

.top-brand .beta-badge {
  flex-shrink: 0;
}

.top-name {
  margin: 0;
  justify-self: center;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  max-width: min(50vw, 280px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.who {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  max-width: 22vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 28px;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
  max-width: min(42vw, 220px);
}

.plan-badge-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-badge-ico {
  font-size: 0.78rem;
  line-height: 1;
}

.plan-badge.plan-free {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
}

.plan-badge.plan-premium {
  color: #16312f;
  background: linear-gradient(135deg, #f2d7a2, #e8c07a 45%, #c9a45a);
  border-color: rgba(255, 236, 200, 0.65);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.plan-card {
  margin: 0 0 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--line, #d7e2e0);
  background: #f7faf9;
}

.plan-card.plan-premium {
  background: linear-gradient(145deg, #fff8ec, #f7faf9);
  border-color: rgba(201, 164, 90, 0.45);
}

.plan-card-label {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #5c6f6c);
}

.plan-card-title {
  margin: 0;
  font-family: var(--font-display, Georgia, serif);
  font-size: 1.15rem;
  color: var(--teal-dark, #095a5d);
}

.plan-card-meta {
  margin: 0.3rem 0 0;
  font-size: 0.88rem;
  color: var(--muted, #5c6f6c);
  line-height: 1.4;
}

.plan-upgrade-btn {
  margin-top: 0.75rem;
  width: 100%;
}

.share-manage {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line, #d7e2e0);
}

.share-manage .mini-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.share-manage .mini-list .share-meta {
  font-size: 0.82rem;
  color: var(--muted, #5c6f6c);
}

.share-manage .btn-text {
  border: 0;
  background: transparent;
  color: #b42318;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.ghost {
  min-height: 36px;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: var(--white);
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  min-height: 0;
}

.side {
  border-right: 1px solid var(--line);
  background: var(--white);
  padding: 1rem;
  overflow: auto;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.tab {
  flex: 1 1 auto;
  min-width: calc(33% - 0.35rem);
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
}

.tab.is-on {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--white);
}

.tab-count:not(:empty)::before {
  content: "(";
}

.tab-count:not(:empty)::after {
  content: ")";
}

.reply-box {
  margin-bottom: 1.25rem;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f7faf9;
  display: grid;
  gap: 0.35rem;
}

.reply-box h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  color: var(--teal-dark);
}

.reply-box textarea {
  width: 100%;
  min-height: 220px;
  padding: 0.75rem;
  border-radius: 9px;
  border: 1px solid var(--line);
  font: inherit;
  line-height: 1.45;
  resize: vertical;
  background: #fff;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(7, 42, 44, 0.55);
}

.modal-card {
  width: min(560px, 100%);
  max-height: min(90vh, 800px);
  overflow: auto;
  padding: 1.35rem;
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.modal-card h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
}

.confirm-dl {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.35rem 0.75rem;
  margin: 1rem 0;
  font-size: 0.92rem;
}

.confirm-dl dt {
  color: var(--muted);
  font-weight: 600;
}

.confirm-dl dd {
  margin: 0;
  font-weight: 600;
  word-break: break-word;
}

.confirm-body {
  margin: 0 0 1rem;
  padding: 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f7faf9;
  white-space: pre-wrap;
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.45;
  max-height: 240px;
  overflow: auto;
}

.confirm-check {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
  line-height: 1.4;
  cursor: pointer;
}

.confirm-check input {
  margin-top: 0.2rem;
}

.pane-hint {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

.search {
  width: 100%;
  min-height: 42px;
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 9px;
  border: 1px solid var(--line);
  font: inherit;
  background: #fafcfb;
}

.pane label {
  display: block;
  margin: 0.65rem 0 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.pane input[type="text"],
.pane input[type="tel"],
.share-box select,
.share-result input {
  width: 100%;
  min-height: 42px;
  padding: 0.55rem 0.75rem;
  border-radius: 9px;
  border: 1px solid var(--line);
  font: inherit;
  background: #fff;
}

.btn.solid {
  width: 100%;
  margin-top: 1rem;
}

.file-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 1rem;
  border-radius: 9px;
  background: var(--teal);
  color: var(--white) !important;
  font-weight: 700;
  cursor: pointer;
}

.ok {
  color: var(--teal-dark);
  font-size: 0.9rem;
}

.share-box {
  margin-bottom: 1.25rem;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f7faf9;
  display: grid;
  gap: 0.55rem;
}

.share-result {
  display: grid;
  gap: 0.5rem;
}

.badge-due {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(180, 35, 24, 0.1);
  color: var(--danger);
}

.badge-soon {
  background: rgba(13, 115, 119, 0.12);
  color: var(--teal-dark);
}

.badge-hot {
  background: rgba(180, 35, 24, 0.16);
  color: #8f1d14;
}

.badge-imp {
  background: rgba(180, 100, 20, 0.14);
  color: #8a4b00;
}

.list-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: -0.25rem 0 0.55rem;
}

.btn-text {
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.25rem 0;
  color: var(--teal-dark);
}

.btn-text.danger,
.btn.danger {
  color: var(--danger);
}

.btn.ghost.danger {
  border-color: rgba(180, 35, 24, 0.35);
  color: var(--danger);
}

.btn-text:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.urgent-strip {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(180, 35, 24, 0.28);
  background: rgba(180, 35, 24, 0.07);
  font-size: 0.82rem;
  line-height: 1.4;
  color: #7a1f18;
}

.urgent-strip button {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  text-align: left;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
  padding: 0.2rem 0;
}

.list li button.is-overdue {
  border-color: rgba(180, 35, 24, 0.45);
  background: rgba(180, 35, 24, 0.06);
}

.list li button.is-due-soon {
  border-color: rgba(180, 100, 20, 0.4);
  background: rgba(180, 100, 20, 0.06);
}

.list li button.is-critical {
  box-shadow: inset 3px 0 0 var(--danger);
}

.urgency-banner {
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

.urgency-banner.is-overdue {
  background: rgba(180, 35, 24, 0.1);
  color: #7a1f18;
  border: 1px solid rgba(180, 35, 24, 0.25);
}

.urgency-banner.is-due-soon {
  background: rgba(180, 100, 20, 0.1);
  color: #8a4b00;
  border: 1px solid rgba(180, 100, 20, 0.28);
}

.urgency-banner.is-critical {
  background: rgba(180, 35, 24, 0.08);
  color: #7a1f18;
  border: 1px solid rgba(180, 35, 24, 0.22);
}

.share-page {
  background: var(--bg);
  min-height: 100vh;
}

.share-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--teal-deep);
  color: var(--white);
}

.share-top img {
  height: 32px;
  width: auto;
}

.share-top .muted {
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
  font-size: 0.82rem;
}

.share-main {
  width: min(720px, calc(100% - 2rem));
  margin: 1.5rem auto 3rem;
}

.share-main h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
}

#shareImage {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.list li button {
  width: 100%;
  text-align: left;
  padding: 0.85rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fafcfb;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.list li button:hover,
.list li button.is-on {
  border-color: var(--teal);
  background: rgba(13, 115, 119, 0.06);
}

.list .item-title {
  display: block;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.list .item-meta {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}

.detail {
  padding: 1.5rem clamp(1rem, 3vw, 2rem);
  overflow: auto;
}

.detail-empty {
  max-width: 36ch;
  padding-top: 2rem;
}

.detail-empty h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
}

.detail-card {
  max-width: 720px;
}

.detail-head {
  margin-bottom: 1rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
}

.detail-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  line-height: 1.2;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.btn {
  min-height: 42px;
  padding: 0.55rem 1rem;
  border-radius: 9px;
  border: 0;
  background: var(--teal);
  color: var(--white);
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--teal-dark);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.block {
  margin-bottom: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.block h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  color: var(--teal-dark);
}

.block p,
.block li {
  margin: 0;
  line-height: 1.55;
  color: var(--ink);
}

.block ul {
  margin: 0;
  padding-left: 1.15rem;
}

.suggestions {
  display: grid;
  gap: 0.65rem;
}

.suggestion-card {
  padding: 0.85rem 0.95rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f7faf9;
}

.suggestion-card strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--teal-dark);
}

.suggestion-card p {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  color: var(--ink);
}

.suggestion-card ol {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.mini-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.mini-list button {
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--white);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.pdf-frame {
  width: 100%;
  min-height: 70vh;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #e8eeec;
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .side {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: 42vh;
  }

  .top {
    grid-template-columns: auto 1fr auto;
  }

  .top-name {
    justify-self: start;
    max-width: 42vw;
    font-size: 1rem;
  }

  .who {
    display: none;
  }
}
