:root {
  color-scheme: light;
  --ink: #142127;
  --muted: #61717a;
  --line: #d8e2e4;
  --panel: #ffffff;
  --soft: #f3f7f6;
  --soft-2: #e7efee;
  --blue: #1e6f92;
  --blue-dark: #144d66;
  --green: #29a963;
  --green-dark: #063f49;
  --amber: #a35e00;
  --red: #c23a34;
  --violet: #7057c8;
  --shadow: 0 22px 62px rgba(5, 37, 43, 0.12);
  --shadow-small: 0 10px 28px rgba(5, 37, 43, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(243, 247, 246, 0.92)),
    #e8f0ef;
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(20, 63, 145, 0.72), rgba(18, 130, 90, 0.28)),
    url("https://images.unsplash.com/photo-1497366754035-f200968a6e72?auto=format&fit=crop&w=1800&q=80") center / cover;
}

.login-panel {
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.login-panel h1,
.topbar h2,
.modal-card h3 {
  margin: 0;
  letter-spacing: 0;
}

.login-panel h1 {
  font-size: clamp(2rem, 6vw, 3.2rem);
  line-height: 0.98;
}

.login-copy {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

textarea {
  min-height: 108px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(33, 94, 211, 0.14);
}

.primary-button,
.ghost-button,
.icon-button,
.tabs button,
.login-panel button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  font-weight: 900;
}

.primary-button,
.login-panel button {
  background: var(--blue);
  color: #fff;
  padding: 0 16px;
  box-shadow: 0 8px 18px rgba(33, 94, 211, 0.22);
}

.primary-button:hover,
.login-panel button:hover {
  background: var(--blue-dark);
}

.ghost-button {
  background: #edf2f7;
  color: var(--ink);
  padding: 0 14px;
}

.icon-button {
  width: 34px;
  background: #edf2f7;
  color: var(--ink);
}

.error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-weight: 800;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(160deg, rgba(41, 169, 99, 0.16), rgba(30, 111, 146, 0.08)),
    #062f38;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.mark img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand small {
  display: block;
  max-width: 190px;
  color: #b9d1d5;
}

.tabs {
  display: grid;
  gap: 6px;
}

.tabs button {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  width: 100%;
  padding: 0 11px;
  background: transparent;
  color: #c5d8dc;
  text-align: left;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.tabs button:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  transform: translateX(2px);
}

.tabs button[aria-selected="true"] {
  background: #ffffff;
  color: #06343d;
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.76rem;
  font-weight: 950;
}

.tabs button[aria-selected="true"] .nav-icon {
  background: var(--green);
  color: #fff;
}

.workspace {
  min-width: 0;
  padding: 30px clamp(18px, 3vw, 38px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-small);
}

.topbar h2 {
  font-size: clamp(1.8rem, 4vw, 3.1rem);
  line-height: 1;
}

.grid {
  display: grid;
  gap: 16px;
}

.stats {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.columns {
  grid-template-columns: repeat(4, minmax(210px, 1fr));
}

.columns.three {
  grid-template-columns: repeat(3, minmax(230px, 1fr));
}

.two {
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
}

.panel,
.card,
.tool,
.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-small);
}

.panel {
  padding: 20px;
}

.panel-header,
.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.panel h3,
.column h3 {
  margin: 0;
  font-size: 1rem;
}

.panel-subtitle,
.column-count {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.stat {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 16px;
}

.stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--accent, var(--blue));
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 2.2rem;
  line-height: 1;
}

.stat span,
.meta,
.empty {
  color: var(--muted);
}

.board-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.board-tools p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.board-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.search-input {
  width: min(320px, 48vw);
  min-height: 40px;
}

.result-note {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.command-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid rgba(30, 111, 146, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(6, 63, 73, 0.96), rgba(30, 111, 146, 0.9)),
    #063f49;
  color: #fff;
  box-shadow: var(--shadow);
}

.command-hero h3 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 0.95;
}

.command-hero p {
  max-width: 820px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
}

.command-hero .eyebrow {
  color: #9ee0c2;
}

.hero-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.hero-actions button:not(.primary-button) {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 0 14px;
  font-weight: 900;
}

.command-stats {
  margin-bottom: 16px;
}

.command-layout {
  grid-template-columns: minmax(360px, 1.1fr) minmax(280px, 0.8fr) minmax(320px, 0.9fr);
}

.project-board {
  display: grid;
  grid-template-columns: minmax(280px, 1.15fr) minmax(260px, 0.95fr) minmax(240px, 0.82fr) minmax(260px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.project-menu {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.project-tile {
  min-height: 190px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 18px;
  text-align: left;
  box-shadow: var(--shadow-small);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.project-tile:hover {
  border-color: rgba(30, 111, 146, 0.42);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.project-tile span {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.project-tile strong {
  font-size: 2.4rem;
  line-height: 1;
}

.project-tile small {
  color: var(--muted);
  line-height: 1.45;
}

.project-tile em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 900;
}

.project-detail-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-small);
}

.project-detail-head h3 {
  margin: 0;
  font-size: 1.45rem;
}

.project-detail-head p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.project-detail-head > button,
.ticket-toolbar button,
.project-detail-head .board-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 900;
}

.ticket-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 16px;
}

.ticket-toolbar .search-input {
  margin-right: auto;
}

.ticket-project-groups {
  display: grid;
  gap: 14px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-box {
  display: grid;
  gap: 8px;
  min-height: 126px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow-small);
  cursor: pointer;
}

.summary-box:hover,
.summary-box.active {
  border-color: rgba(30, 111, 146, 0.5);
  box-shadow: var(--shadow);
}

.summary-box span {
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.summary-box strong {
  font-size: 2.1rem;
  line-height: 1;
}

.summary-box small {
  color: var(--muted);
  line-height: 1.35;
}

.brief-list {
  display: grid;
  gap: 8px;
}

.brief-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.brief-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
}

.brief-main span {
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.brief-main strong {
  overflow-wrap: anywhere;
}

.brief-main small {
  color: var(--muted);
  line-height: 1.35;
}

.brief-side {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.link-select {
  display: grid;
  gap: 4px;
  min-width: 168px;
  color: var(--muted);
  font-size: 0.72rem;
}

.link-select select {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 0.78rem;
}

.menu-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  display: grid;
  gap: 10px;
  width: min(260px, 78vw);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-small);
}

.menu-actions {
  display: grid;
  gap: 7px;
}

.menu-popover button {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafb;
  color: var(--ink);
  font-weight: 900;
  text-align: left;
  padding: 0 10px;
}

.project-lane {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(243, 247, 246, 0.92);
}

.project-list,
.focus-stack,
.compact-list,
.timeline,
.action-list,
.report-list {
  display: grid;
  gap: 10px;
}

.project-card header {
  align-items: start;
}

.project-source {
  display: block;
  margin-bottom: 5px;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.compact-row,
.action-row,
.achievement,
.report-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.report-row {
  color: var(--ink);
  text-align: left;
}

.report-row.active {
  border-color: rgba(30, 111, 146, 0.5);
  box-shadow: var(--shadow-small);
}

.report-row span {
  color: var(--muted);
  line-height: 1.35;
}

.compact-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.compact-row strong,
.action-row strong,
.achievement strong {
  display: block;
  color: var(--ink);
}

.compact-row span,
.achievement p,
.action-row p,
.review-summary p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.action-library {
  margin-top: 16px;
}

.action-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.achievement {
  grid-template-columns: 92px minmax(0, 1fr);
}

.achievement time {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.review-summary ul {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--ink);
  line-height: 1.65;
}

.column {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(243, 247, 246, 0.92);
}

.column .card-list {
  padding-right: 4px;
}

.dashboard-list {
  padding-right: 4px;
}

.card-list {
  display: grid;
  gap: 10px;
}

.card {
  padding: 14px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.card:hover {
  border-color: #b9cdcf;
  box-shadow: 0 12px 30px rgba(5, 37, 43, 0.11);
  transform: translateY(-1px);
}

.card[draggable="true"] {
  cursor: grab;
}

.card.dragging {
  opacity: 0.55;
  transform: rotate(1deg);
}

.card header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.card h4 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.28;
}

.card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
  font-size: 0.78rem;
  font-weight: 800;
}

.meta-label {
  color: #8894a5;
  font-weight: 900;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  gap: 5px;
  padding: 0 8px;
  border-radius: 999px;
  background: #edf2f7;
  color: var(--muted);
}

.inline-select {
  padding-right: 4px;
}

.inline-select select {
  max-width: 138px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  outline: 0;
  cursor: pointer;
}

.pill.id {
  background: #101827;
  color: #fff;
}

.pill.priority-urgent,
.pill.priority-boss-panic-mode,
.pill.status-blocked {
  background: #fae8e7;
  color: var(--red);
}

.pill.priority-normal,
.pill.status-live,
.pill.status-done,
.pill.status-used,
.pill.status-received,
.pill.status-approved {
  background: #e5f5ee;
  color: var(--green);
}

.pill.status-in-progress,
.pill.status-planned,
.pill.status-plan,
.pill.status-active,
.pill.status-this-week,
.pill.status-considering,
.pill.status-requested,
.pill.status-scheduled {
  background: #e7eefc;
  color: var(--blue);
}

.pill.status-waiting-on-someone,
.pill.status-needed,
.pill.status-inbox,
.pill.status-idea {
  background: #fff1dc;
  color: var(--amber);
}

.pill.status-posted {
  background: #e5f5ee;
  color: var(--green);
}

.pill.status-parked,
.pill.status-carry-on-tomorrow,
.pill.status-no-reply,
.pill.status-rejected {
  background: #eef1ef;
  color: var(--muted);
}

.pill.status-human-review,
.pill.status-flag-human {
  background: #fae8e7;
  color: var(--red);
}

.pill.status-easy {
  background: #e5f5ee;
  color: var(--green);
}

.pill.status-medium {
  background: #fff1dc;
  color: var(--amber);
}

.pill.status-complex {
  background: #fae8e7;
  color: var(--red);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.actions button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  padding: 0 10px;
}

.actions button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.actions .danger-action {
  border-color: #edc3c0;
  color: var(--red);
}

.actions .danger-action:hover {
  border-color: var(--red);
  background: #fae8e7;
  color: var(--red);
}

.priority-actions {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.priority-actions button {
  background: #f8fafb;
}

.note-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.note-mark {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #edf2f7;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.note-mark.has-notes {
  background: var(--blue);
  color: #fff;
}

.card-menu {
  position: relative;
}

.card-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
  list-style: none;
  cursor: pointer;
}

.card-menu summary::-webkit-details-marker {
  display: none;
}

.card-menu[open] summary {
  border-color: var(--blue);
  color: var(--blue);
}

.card-menu[open] > button {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 112px;
  box-shadow: var(--shadow-small);
}

.column.drag-over {
  outline: 2px solid var(--blue);
  outline-offset: -4px;
  background: #f4f8ff;
}

.section-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
}

.section-tools h3 {
  margin: 0;
  font-size: 1rem;
}

.guidelines-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.guideline {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.guideline header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.guideline h4 {
  margin: 0 0 8px;
}

.guideline p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.45;
  white-space: pre-wrap;
}

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-small);
}

.table th,
.table td {
  padding: 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.secondary-tools {
  margin-top: 16px;
}

.tool {
  padding: 18px;
}

.tool h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.tool p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.tool-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e7eefc;
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 900;
}

.fenster-tool {
  padding: 18px;
}

.tool-actions {
  margin-top: 0;
}

.fenster-app {
  display: grid;
  gap: 14px;
}

.fenster-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
}

.bot-control,
.queue-panel,
.prompt-panel {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 14px;
}

.bot-control {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 14px;
  align-items: center;
}

.bot-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 10px;
}

.queue-list {
  display: grid;
  gap: 8px;
}

.queue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafb;
}

.queue-item div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.queue-item span,
.queue-item time {
  color: var(--muted);
  font-size: 0.78rem;
}

.prompt-panel {
  display: grid;
  gap: 12px;
}

.prompt-panel textarea {
  min-height: 150px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  line-height: 1.45;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.metric strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1.1;
}

.metric span,
.sync-status {
  color: var(--muted);
  font-size: 0.8rem;
}

.fenster-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fenster-tabs button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0 13px;
  font-weight: 900;
}

.fenster-tabs button.active,
.fenster-tabs button:hover {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.fenster-shell {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 14px;
  min-height: 520px;
}

.fenster-list,
.fenster-detail {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.panel-header.compact {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}

.fenster-threads {
  display: grid;
  max-height: 560px;
  overflow: auto;
}

.fenster-thread {
  display: grid;
  gap: 7px;
  width: 100%;
  min-height: 96px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.fenster-thread.active {
  border-left: 4px solid var(--green);
  background: #e5f5ee;
  padding-left: 10px;
}

.thread-top,
.thread-bottom,
.detail-head,
.draft-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.thread-top,
.thread-bottom,
.detail-head {
  justify-content: space-between;
}

.thread-top time,
.thread-bottom,
.detail-head .meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.thread-snippet {
  overflow: hidden;
  color: #34413a;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-empty {
  display: grid;
  min-height: 420px;
  place-items: center;
  color: var(--muted);
}

.detail-head {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.detail-head h3 {
  margin: 0;
}

.decision-banner {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #e5f5ee;
  color: var(--green-dark);
}

.decision-banner.danger {
  background: #fae8e7;
  color: var(--red);
}

.decision-banner.quiet {
  background: #eef1ef;
  color: var(--muted);
}

.decision-banner strong {
  font-size: 0.85rem;
}

.decision-banner span {
  font-size: 0.82rem;
  line-height: 1.35;
}

.message-stream {
  display: grid;
  gap: 9px;
  max-height: 360px;
  min-height: 260px;
  overflow: auto;
  padding: 16px;
  background: #fbfcfa;
}

.message {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.42;
}

.message.inbound {
  background: #eef1ef;
}

.message.outbound {
  justify-self: end;
  background: var(--green);
  color: #fff;
}

.message time {
  display: block;
  margin-top: 6px;
  color: inherit;
  font-size: 0.7rem;
  opacity: 0.72;
}

.draft-box {
  padding: 14px;
  border-top: 1px solid var(--line);
}

.draft-actions {
  flex-wrap: wrap;
  margin-top: 10px;
}

.draft-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  padding: 0 10px;
}

.draft-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

dialog {
  width: min(560px, calc(100% - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(16, 24, 39, 0.42);
}

.modal-card {
  position: relative;
  margin: 0;
  padding: 22px;
}

.modal-intro {
  margin: 10px 42px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.notes-list {
  display: grid;
  gap: 10px;
  max-height: 260px;
  overflow: auto;
  margin: 16px 0;
}

.note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 12px;
}

.note header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

.note p {
  margin: 8px 0 0;
  line-height: 1.45;
}

.action-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-small);
}

.action-hero h3 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1;
}

.action-hero p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.progress-card {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 16px;
  border-radius: 8px;
  background: var(--soft);
}

.bar {
  height: 12px;
  border-radius: 999px;
  background: #dfe6ef;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.plan-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.plan-filters button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0 13px;
  font-weight: 900;
}

.plan-filters button.active,
.plan-filters button:hover {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.plan-summary {
  margin-bottom: 16px;
}

.plan-sections {
  display: grid;
  gap: 14px;
}

.plan-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-small);
}

.plan-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.plan-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 13px;
}

.plan-item.is-done {
  opacity: 0.68;
}

.plan-item.is-done strong {
  text-decoration: line-through;
}

.checkline {
  display: flex;
  grid-template-columns: none;
  align-items: start;
  gap: 10px;
  color: var(--ink);
}

.checkline input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.checkline span {
  display: grid;
  gap: 7px;
}

.checkline small {
  width: fit-content;
}

.plan-item p {
  margin: 10px 0 0 28px;
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 1180px) {
  .stats,
  .columns,
  .columns.three,
  .two,
  .tool-grid,
  .fenster-metrics,
  .fenster-shell,
  .command-layout,
  .project-board,
  .project-menu,
  .project-detail-head,
  .action-hero,
  .command-hero,
  .action-row,
  .plan-items {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .workspace,
  .sidebar {
    padding: 16px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .stats,
  .columns,
  .columns.three,
  .two,
  .tool-grid,
  .fenster-metrics,
  .fenster-shell,
  .command-layout,
  .project-board,
  .project-menu,
  .project-detail-head,
  .brief-card,
  .command-hero,
  .achievement,
  .action-row,
  .action-hero,
  .plan-items,
  .tabs {
    grid-template-columns: 1fr;
  }

  .search-input {
    width: 100%;
  }
}
