/* activity/src/style.css */
:root {
  --buncss-light: initial;
  --buncss-dark: ;
  color-scheme: light dark;
  --pad: clamp(16px, 5vw, 72px);
  --bg: #fff;
  --fg: #37352f;
  --muted: #787774;
  --faint: #a5a29d;
  --line: #e9e9e7;
  --hover: #f1f1ef;
  --card: #fff;
  --shadow: 0 0 0 1px #0f0f0f14, 0 1px 2px #0f0f0f0f;
  --shadow-lift: 0 0 0 1px #0f0f0f1a, 0 4px 10px #0f0f0f1a;
  --accent: #2383e2;
  --drop: #2383e212;
  --orange: #fadec9;
  --orange-fg: #49290e;
  --blue: #d3e5ef;
  --blue-fg: #183347;
  --purple: #e8deee;
  --purple-fg: #412454;
  --green: #dbeddb;
  --green-fg: #1c3829;
  --yellow: #fdecc8;
  --yellow-fg: #4b3b13;
  --pink: #f5e0e9;
  --pink-fg: #512b3a;
  --teal: #d9edeb;
  --teal-fg: #1c4541;
  --red: #fbe2e2;
  --red-fg: #512b2b;
  --mark-bg: #37352f;
  --mark-fg: #fff;
  --backdrop: #0f0f0f73;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --buncss-light: ;
    --buncss-dark: initial;
    --bg: #191919;
    --fg: #ffffffcf;
    --muted: #ffffff71;
    --faint: #ffffff48;
    --line: #ffffff17;
    --hover: #ffffff0e;
    --card: #252525;
    --shadow: 0 0 0 1px #ffffff0f, 0 1px 2px #00000059;
    --shadow-lift: 0 0 0 1px #ffffff1a, 0 4px 12px #00000073;
    --accent: #78bce6;
    --drop: #529cca1a;
    --orange: #593a2b;
    --orange-fg: #f3d1bc;
    --blue: #28456c;
    --blue-fg: #d9eaff;
    --purple: #492f64;
    --purple-fg: #efdbff;
    --green: #2b593f;
    --green-fg: #d8f4dc;
    --yellow: #635124;
    --yellow-fg: #faedc8;
    --pink: #633a4a;
    --pink-fg: #f5dce7;
    --teal: #225553;
    --teal-fg: #d7f2ed;
    --red: #663d3a;
    --red-fg: #f8dfdc;
    --mark-bg: #ffffffcf;
    --mark-fg: #191919;
    --backdrop: #0009;
  }
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--fg);
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

button, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

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

.shell {
  padding: 0 var(--pad);
  max-width: 1600px;
  min-height: 100vh;
  margin: auto;
}

.topbar {
  position: sticky;
  z-index: 4;
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  justify-content: space-between;
  align-items:  center;
  height: 48px;
  top: 0;
}

.brand, .top-actions, .brand-mark, .avatar, .brand i, .column-head > div, .card-meta, .refresh, .foot {
  display: flex;
  align-items:  center;
}

.brand {
  letter-spacing: 0;
  color: var(--muted);
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
}

.brand > span:nth-child(2) {
  color: var(--fg);
}

.brand-mark {
  background: var(--mark-bg);
  color: var(--mark-fg);
  border-radius: 5px;
  justify-content: center;
  width: 21px;
  height: 21px;
  font-size: 13px;
}

.brand i {
  border-left: 1px solid var(--line);
  height: 16px;
  margin: 0 3px;
}

.workspace {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.top-actions {
  gap: 8px;
}

.count {
  color: var(--muted);
  padding: 0 8px;
  font-size: 12px;
}

.avatar {
  background: var(--hover);
  color: var(--fg);
  overflow: hidden;
  border-radius: 50%;
  justify-content: center;
  width: 23px;
  height: 23px;
  margin-left: 4px;
  font-size: 10px;
  font-weight: 600;
}

.avatar img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.board-head {
  display: flex;
  justify-content: space-between;
  align-items:  flex-end;
  max-width: 1600px;
  margin: auto;
  padding: 38px 0 20px;
}

.eyebrow {
  color: var(--muted);
  letter-spacing: 1.2px;
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 600;
}

.board-head h1, .empty h1 {
  letter-spacing: -1.1px;
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.18;
}

.subhead {
  color: var(--muted);
  margin: 6px 0 0;
  font-size: 13px;
}

.refresh, .icon-button {
  display: flex;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 5px;
  justify-content: center;
  align-items:  center;
  gap: 7px;
  padding: 6px 9px;
  transition: background .12s, color .12s;
  font-size: 12px;
}

.refresh:hover, .icon-button:hover {
  background: var(--hover);
  color: var(--fg);
}

.refresh span {
  font-size: 15px;
}

.board {
  display: grid;
  grid-auto-columns: minmax(230px, 1fr);
  grid-auto-flow: column;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  gap: 10px;
  padding: 3px 1px 16px;
}

.column {
  --tone: #e3e2e0;
  --tone-fg: #32302c;
  display: flex;
  background: color-mix(in srgb, var(--tone) 38%, transparent);
  border: 0;
  border-radius: 8px;
  flex-direction: column;
  min-height: calc(100vh - 250px);
  padding: 7px;
  transition: background .15s;
}

.column:nth-child(8n+1) {
  --tone: var(--orange);
  --tone-fg: var(--orange-fg);
}

.column:nth-child(8n+2) {
  --tone: var(--blue);
  --tone-fg: var(--blue-fg);
}

.column:nth-child(8n+3) {
  --tone: var(--purple);
  --tone-fg: var(--purple-fg);
}

.column:nth-child(8n+4) {
  --tone: var(--green);
  --tone-fg: var(--green-fg);
}

.column:nth-child(8n+5) {
  --tone: var(--yellow);
  --tone-fg: var(--yellow-fg);
}

.column:nth-child(8n+6) {
  --tone: var(--pink);
  --tone-fg: var(--pink-fg);
}

.column:nth-child(8n+7) {
  --tone: var(--teal);
  --tone-fg: var(--teal-fg);
}

.column:nth-child(8n) {
  --tone: var(--red);
  --tone-fg: var(--red-fg);
}

.column.drop-active {
  background: color-mix(in srgb, var(--tone) 75%, transparent);
}

.column-head {
  padding: 2px 2px 10px;
}

.column-head > div {
  gap: 7px;
}

.column-dot {
  display: none;
}

.column-head h2 {
  background: var(--tone);
  color: var(--tone-fg);
  border-radius: 4px;
  order: 0;
  margin: 0;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 21px;
}

.column-count {
  color: var(--faint);
  order: 1;
  margin-left: 0;
  padding: 0;
  font-size: 12px;
}

.card-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 7px;
  min-height: 48px;
}

.card {
  overflow: hidden;
  background: color-mix(in srgb, var(--tone) 43%, var(--card));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--tone-fg) 10%, transparent), 0 1px 2px #0f0f0f0d;
  cursor: grab;
  border: 0;
  border-radius: 6px;
  transition: box-shadow .15s, transform .15s;
}

.card:hover {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--tone-fg) 22%, transparent), 0 4px 10px #0f0f0f1f;
  transform: translateY(-1px);
}

.card.dragging {
  opacity: .4;
}

.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card-body {
  padding: 10px 12px;
}

.card h3 {
  color: var(--fg);
  overflow-wrap: anywhere;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.45;
}

.card-meta {
  color: color-mix(in srgb, var(--tone-fg) 72%, transparent);
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}

.card-meta > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta time {
  flex: none;
}

.media-preview {
  display: flex;
  overflow: hidden;
  background: color-mix(in srgb, var(--tone) 70%, var(--card));
  color: var(--muted);
  justify-content: center;
  align-items:  center;
  gap: 8px;
  height: 100px;
  font-size: 11px;
}

.media-preview img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.play {
  display: grid;
  color: var(--fg);
  background: #0002;
  border-radius: 50%;
  place-items:  center;
  width: 27px;
  height: 27px;
  font-size: 11px;
}

.drop-hint {
  display: none;
  border: 1px dashed color-mix(in srgb, var(--tone-fg) 55%, transparent);
  text-align: center;
  color: var(--tone-fg);
  opacity: .8;
  border-radius: 6px;
  padding: 10px 0;
  font-size: 11px;
}

.drop-active .drop-hint {
  display: block;
}

.foot {
  color: var(--faint);
  justify-content: space-between;
  padding: 12px 2px 26px;
  font-size: 11px;
}

.foot b {
  display: inline-block;
  background: #63a979;
  border-radius: 50%;
  width: 6px;
  height: 6px;
  margin-right: 6px;
}

.boot, .empty {
  display: flex;
  color: var(--muted);
  flex-direction: column;
  justify-content: center;
  align-items:  center;
  gap: 10px;
  min-height: 100vh;
}

.empty {
  text-align: center;
  padding: 30px;
}

.empty-icon {
  display: grid;
  background: var(--hover);
  color: var(--fg);
  border-radius: 10px;
  place-items:  center;
  width: 46px;
  height: 46px;
  margin-bottom: 4px;
  font-size: 23px;
}

.empty h1 {
  font-size: 24px;
}

.empty > p:not(.eyebrow) {
  color: var(--muted);
  max-width: 380px;
  margin: 0 0 9px;
  font-size: 13px;
  line-height: 1.6;
}

.save {
  background: var(--fg);
  color: var(--bg);
  border: 0;
  border-radius: 5px;
  padding: 8px 13px;
  transition: opacity .12s;
  font-size: 12px;
  font-weight: 600;
}

.save:hover {
  opacity: .82;
}

.save:disabled {
  opacity: .55;
  cursor: wait;
}

.overlay {
  position: fixed;
  z-index: 8;
  display: grid;
  background: var(--backdrop);
  backdrop-filter: blur(5px);
  place-items:  center;
  padding: 20px;
  inset: 0;
}

.detail, .settings {
  position: relative;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  border-radius: 9px;
  width: min(620px, 100%);
  max-height: 88vh;
  padding: 28px 30px 30px;
  box-shadow: 0 16px 48px #0003;
}

.close {
  position: absolute;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 5px;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 20px;
  top: 10px;
  right: 11px;
}

.close:hover {
  background: var(--hover);
  color: var(--fg);
}

.detail h2, .settings h2 {
  letter-spacing: -.5px;
  margin: 0 28px 16px 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
}

.detail-meta {
  color: var(--muted);
  font-size: 12px;
}

.message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--fg);
  margin: 16px 0;
  padding: 14px 0;
  font-size: 13px;
  line-height: 1.7;
}

.attachments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.attachments img {
  object-fit: cover;
  border-radius: 5px;
  width: 100%;
  max-height: 180px;
}

.file-link, .jump {
  display: flex;
  border: 1px solid var(--line);
  color: var(--fg);
  text-decoration: none;
  border-radius: 5px;
  justify-content: space-between;
  align-items:  center;
  gap: 10px;
  padding: 9px 10px;
  font-size: 12px;
}

.file-link:hover, .jump:hover {
  background: var(--hover);
}

.file-link span {
  color: var(--muted);
}

.jump {
  display: inline-flex;
  color: var(--accent);
  border: 0;
  margin-top: 14px;
}

.settings label {
  display: block;
  color: var(--muted);
  margin: 18px 0 7px;
  font-size: 12px;
}

.settings textarea {
  resize: vertical;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  border-radius: 5px;
  width: 100%;
  padding: 11px;
  font-size: 13px;
  line-height: 1.6;
}

.settings-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}

.remove {
  color: #c15d5d;
  background: none;
  border: 0;
  font-size: 12px;
}

.setup-copy {
  color: var(--muted);
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.6;
}

.setup-hint {
  color: var(--faint);
  margin: 7px 0 0;
  font-size: 11px;
}

.setup-error {
  color: #c15d5d;
  margin: 12px 0 0;
  font-size: 12px;
}

.setup-settings .cancel {
  border: 1px solid var(--line);
  color: var(--muted);
  background: none;
  border-radius: 5px;
  padding: 8px 12px;
  font-size: 12px;
}

.toast {
  position: fixed;
  z-index: 10;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 12px;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 8px 30px #0000001f;
}

@media (max-width: 700px) {
  .shell {
    padding: 0 16px;
  }

  .board-head {
    padding-top: 28px;
  }

  .board-head h1 {
    font-size: 28px;
  }

  .board {
    grid-auto-columns: minmax(245px, 82vw);
    scroll-snap-type: x proximity;
    margin-right: -16px;
    padding-right: 16px;
  }

  .column {
    scroll-snap-align: start;
    min-height: calc(100vh - 220px);
  }

  .workspace {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
  }

  .count {
    display: none;
  }

  .detail, .settings {
    padding: 25px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
