:root {
	--sidebar: #1f2430;
	--sidebar-icon: #c5cad6;
	--bg: #f4f5f8;
	--settings-bg: #e6e1f7;
	--card: #ffffff;
	--text: #1c2333;
	--muted: #6b7385;
	--line: #e4e7ee;
	--topbar-border: #dddfe2;
	--util-bg: #e4e6eb;
	--primary: #6d5efc;
	--primary-hover: #5b4ee8;
	--ai-avatar: #e8913a;
	--radius: 10px;
	--select-radius: 12px;
	--select-border: #c5cad6;
	--select-panel: #eceef3;
	--select-trigger: #ffffff;
	--sg-bottom-nav-h: 60px;
	font-family: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body.tt-page-board,
body.tt-page-settings {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
body.tt-page-settings { background: var(--settings-bg); }
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.app-topbar {
	position: relative;
	flex: 0 0 56px;
	z-index: 30;
	height: 56px;
	background: #fff;
	border-bottom: 1px solid var(--topbar-border);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: stretch;
	padding: 0 16px;
}
.topbar-left,
.topbar-right {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}
.topbar-right { justify-content: flex-end; }
.topbar-logo {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--primary);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
	font-size: 20px;
	text-decoration: none;
	flex-shrink: 0;
	letter-spacing: -0.04em;
}
.topbar-search-wrap {
	position: relative;
	flex: 1 1 180px;
	max-width: 360px;
	min-width: 0;
}
.topbar-search-wrap > i {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: #65676b;
	font-size: 13px;
	pointer-events: none;
}
.topbar-search {
	width: 100%;
	height: 40px;
	border: 0;
	border-radius: 999px;
	background: #f0f2f5;
	padding: 0 14px 0 38px;
	font-size: 15px;
	color: var(--text);
	min-width: 0;
}
.topbar-search::placeholder { color: #65676b; font-weight: 400; }
.topbar-search:focus {
	outline: none;
	background: #fff;
	box-shadow: 0 0 0 2px var(--primary);
}
.topbar-center {
	display: flex;
	align-items: stretch;
	justify-content: center;
	height: 56px;
	gap: 4px;
}
.topbar-tab {
	width: 112px;
	max-width: 20vw;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #65676b;
	text-decoration: none;
	position: relative;
	font-size: 22px;
	border-radius: 8px;
}
.topbar-tab:hover { background: #f0f2f5; }
.topbar-tab.active {
	color: var(--primary);
	background: transparent;
}
.topbar-tab.active:hover { background: transparent; }
.topbar-tab.active::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: var(--primary);
	border-radius: 3px 3px 0 0;
}
.topbar-util {
	position: relative;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 0;
	background: var(--util-bg);
	color: #050505;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	text-decoration: none;
	font-size: 16px;
	flex-shrink: 0;
}
.topbar-util:hover { background: #d8dadf; }
.topbar-util.is-current { color: var(--primary); }
.topbar-avatar-btn {
	position: relative;
	width: 40px;
	height: 40px;
	border: 0;
	background: none;
	padding: 0;
	cursor: pointer;
	flex-shrink: 0;
}
.topbar-avatar-caret {
	position: absolute;
	right: -2px;
	bottom: -2px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--util-bg);
	color: #050505;
	font-size: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid #fff;
	line-height: 1;
}

.nav-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #6d5efc;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	margin-top: 0;
}

.app-main { min-height: 100%; display: flex; flex-direction: column; }
body.tt-page-board .app-main,
body.tt-page-settings .app-main {
	margin-left: 0;
	min-height: 0;
	flex: 1;
	height: auto;
	overflow: hidden;
}
body.tt-page-settings .app-content { background: var(--settings-bg); }

.app-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 28px 8px;
}
.header-title-block { min-width: 0; }
.app-brand {
	margin: 0;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: var(--primary);
	line-height: 1.2;
}
.app-header h1 { margin: 2px 0 0; font-size: 28px; font-weight: 700; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.header-bell-wrap { position: relative; }
.header-bell {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: var(--util-bg);
	color: #050505;
	cursor: pointer;
}
.header-bell:hover { background: #d8dadf; }
.header-bell-dot {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #e5484d;
	box-shadow: 0 0 0 2px #fff;
}
.header-bell-panel {
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	width: min(360px, calc(100vw - 24px));
	background: var(--card);
	border: 1px solid var(--select-border);
	border-radius: var(--select-radius);
	box-shadow: 0 12px 32px rgba(28,35,51,.16);
	z-index: 40;
	overflow: hidden;
}
.header-bell-all {
	display: block;
	padding: 12px 14px;
	font-size: 13px;
	font-weight: 700;
	color: var(--primary);
	text-decoration: none;
	border-bottom: 1px solid var(--line);
}
.header-bell-all:hover { background: var(--select-panel); }
.header-bell-item {
	padding: 10px 14px 8px;
	border-bottom: 1px solid var(--line);
}
.header-bell-item:last-child { border-bottom: 0; }
.header-bell-toggle {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	font: inherit;
	text-align: left;
	color: inherit;
}
.header-bell-title {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.35;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.header-bell-toggle > i {
	flex: 0 0 auto;
	margin-top: 2px;
	color: var(--muted);
	font-size: 11px;
}
.header-bell-body {
	margin-top: 8px;
	font-size: 13px;
	font-weight: 400;
	color: var(--text);
	line-height: 1.4;
	word-break: break-word;
}
.header-bell-body p { margin: 0; }
.header-bell-mark {
	display: block;
	width: 100%;
	margin-top: 6px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--muted);
	font-size: 11px;
	font-weight: 600;
	text-align: right;
	cursor: pointer;
}
.header-bell-mark:hover { color: var(--primary); }
.header-bell-empty {
	margin: 0;
	padding: 14px;
	color: var(--muted);
	font-size: 13px;
}
.notify-create { margin: 16px 0 24px; max-width: 640px; }
.notify-create-body { grid-column: 1 / -1; }
.notify-full-list { list-style: none; margin: 0; padding: 0; }
.notify-full-item { border-bottom: 1px solid var(--line); }
.notify-full-toggle {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	width: 100%;
	margin: 0;
	padding: 12px 0;
	border: 0;
	background: none;
	cursor: pointer;
	font: inherit;
	text-align: left;
}
.notify-full-title {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.notify-full-item.is-unread .notify-full-title { color: var(--text); }
.notify-full-toggle > i { color: var(--muted); font-size: 12px; margin-top: 4px; }
.notify-full-body { padding: 0 0 12px; font-size: 14px; line-height: 1.45; }
.notify-full-body p { margin: 0 0 8px; }
.notify-mark-form { margin: 0 0 8px; text-align: right; }
.notify-mark-read {
	border: 0;
	background: none;
	color: var(--muted);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
}
.notify-mark-read:hover { color: var(--primary); }

.btn-primary {
	background: var(--primary);
	color: #fff;
	border: 0;
	border-radius: 10px;
	padding: 10px 18px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	display: inline-block;
	text-decoration: none;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-primary:disabled {
	background: #cfd3de;
	color: #f4f5f8;
	cursor: not-allowed;
	opacity: 1;
}

.app-pagehead {
	flex-shrink: 0;
	padding: 14px 28px 0;
	background: #fff;
}
.app-pagehead h1 {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
}
.app-subheader {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	padding: 8px 28px 12px;
	border-bottom: 1px solid var(--topbar-border);
	background: #fff;
	gap: 12px;
	flex-shrink: 0;
}
.view-tabs { display: flex; gap: 18px; }
.view-tabs a {
	color: var(--muted);
	text-decoration: none;
	padding-bottom: 8px;
	font-weight: 600;
}
.view-tabs a.active { color: var(--text); border-bottom: 2px solid var(--primary); }
.date-nav { display: flex; gap: 8px; justify-content: center; }
.subheader-actions { display: flex; gap: 8px; justify-content: flex-end; }
.ghost, .date-range {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 6px 12px;
	cursor: pointer;
	color: var(--text);
}
#add-bucket-btn {
	gap: 6px;
}
.date-range { min-width: 180px; font-weight: 600; }

.app-content { padding: 24px 28px; flex: 1; min-height: 0; overflow-y: auto; }
.app-content.board-fill {
	padding: 0;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

/* Large glass already has "Back to board" in the settings subheader. */
.settings-close { display: none; }
.settings-close:hover { background: #d8dadf; }
.ghost.active-settings,
.ghost.is-current { border-color: var(--primary); color: var(--text); }

.storyboard-list { display: grid; gap: 16px; max-width: 720px; }
.storyboard-card {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 18px 20px;
	display: flex;
	justify-content: space-between;
	gap: 16px;
	align-items: center;
}
.storyboard-card.is-active { border-color: var(--primary); }
.storyboard-card h3 { margin: 0 0 4px; }
.storyboard-card .meta { color: var(--muted); font-size: 13px; }
.storyboard-card-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.invite-link { word-break: break-all; font-size: 13px; }
.member-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.member-row form { display: inline-flex; gap: 6px; align-items: center; }

.foundation-panel {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 24px;
	max-width: 920px;
}
body.tt-page-settings .foundation-panel {
	border-color: #d4ccec;
	box-shadow: 0 8px 20px rgba(88, 70, 180, .08);
}
.foundation-panel h2 { margin-top: 0; }
.foundation-panel li { margin: 8px 0; }
.hint { color: var(--muted); font-size: 13px; }
code { background: #eef0f6; padding: 1px 6px; border-radius: 4px; }

.auth-body {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #1f2430;
}
.auth-card {
	background: #fff;
	width: 100%;
	max-width: 420px;
	padding: 32px;
	border-radius: 12px;
}
.auth-card h1.app-brand { margin-top: 0; margin-bottom: 4px; font-size: 22px; letter-spacing: 0.02em; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.auth-form input, .auth-form select {
	border: 1px solid var(--select-border);
	border-radius: var(--select-radius);
	padding: 10px 12px;
	font-size: 15px;
}
input[type="date"] {
	position: relative;
	width: 13.5rem;
	max-width: 100%;
	padding-right: 2.25rem;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235c6578' stroke-width='1.6' viewBox='0 0 24 24'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.7rem center;
	background-size: 1rem;
}
input[type="date"]::-webkit-calendar-picker-indicator {
	position: absolute;
	inset: 0;
	width: auto;
	height: auto;
	margin: 0;
	padding: 0;
	cursor: pointer;
	opacity: 0;
}
.auth-form input[type="date"] {
	align-self: flex-start;
	padding-right: 2.25rem;
}
.integ-host-form input[type="password"],
.integ-host-form input[type="email"] {
	width: 100%;
	max-width: 22rem;
	align-self: flex-start;
}
.form-error { color: #e5484d; font-weight: 600; }
.form-ok { color: #30a46c; font-weight: 600; }
.auth-switch { color: var(--muted); }
.auth-switch a { color: var(--primary); font-weight: 600; }
.settings-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 20px;
	align-items: start;
	width: 100%;
}
.settings-grid > .foundation-panel {
	max-width: none;
	min-width: 0;
}
.settings-grid-board {
	display: flex;
	flex-wrap: wrap;
	align-items: start;
}
.settings-grid-board > .foundation-panel {
	flex: 1 1 240px;
}
.settings-grid-board > .board-story-panel {
	flex: 2 1 400px;
}
.auth-form.board-story-form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	grid-template-areas:
		"name days"
		"desc days"
		"hours days"
		"hours-hint days"
		"tz days"
		"save days";
	gap: 10px 20px;
	align-items: start;
}
.board-story-name { grid-area: name; }
.board-story-desc { grid-area: desc; }
.board-story-hours { grid-area: hours; }
.board-story-hours-hint { grid-area: hours-hint; margin: 0; }
.board-story-tz { grid-area: tz; }
.board-story-days-col {
	grid-area: days;
	align-self: start;
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}
.board-story-days-col .work-days-fieldset { margin: 0; }
.board-story-days-col .hint { margin: 0; }
.board-story-save { grid-area: save; justify-self: start; }
.board-story-form > input[type="hidden"] { display: none; }
.settings-tab-intro {
	max-width: 760px;
	margin: 0 0 20px;
}
.settings-tab-intro h2 { margin: 0 0 8px; }
.env-must-connect {
	margin: 12px 0 0;
	padding: 10px 12px;
	border: 1px solid #f0c36d;
	background: #fff8e8;
	border-radius: 8px;
	font-size: 13px;
	line-height: 1.45;
}
.env-git-setup { margin: 0 0 20px; }
.env-git-setup .foundation-panel { margin-top: 16px; }
.env-git-setup .env-url-precheck { padding: 16px 24px; }
.env-setup-progress {
	margin: 12px 0 8px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
}
.env-must-connect a { font-weight: 600; }
.settings-tab-actions { margin: 12px 0 0; }
.agent-wizard {
	display: grid;
	grid-template-columns: 240px minmax(0, 1fr);
	gap: 24px;
	align-items: start;
	width: 100%;
	padding-bottom: 40px;
}
.agent-wizard-rail {
	position: sticky;
	top: 8px;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 16px;
}
.agent-wizard-rail h2 { margin: 0 0 8px; font-size: 16px; }
.agent-wizard-nav {
	list-style: none;
	margin: 16px 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.wizard-nav-btn {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	text-align: left;
	border: 0;
	background: transparent;
	color: var(--muted);
	font: inherit;
	font-size: 13px;
	line-height: 1.3;
	padding: 8px 6px;
	border-radius: 8px;
	cursor: pointer;
}
.wizard-nav-btn:hover:not(:disabled) { background: #f4f5f8; color: var(--text); }
.wizard-nav-btn.is-current { background: #eceef8; color: var(--text); font-weight: 600; }
.wizard-nav-btn.is-done { color: var(--text); }
.wizard-nav-btn:disabled,
.wizard-nav-btn.is-locked { opacity: 0.45; cursor: not-allowed; }
.wizard-nav-mark {
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 2px solid var(--select-border);
	background: #fff;
	position: relative;
}
.wizard-nav-btn.is-done .wizard-nav-mark {
	border-color: #30a46c;
	background: #30a46c;
}
.wizard-nav-btn.is-done .wizard-nav-mark::after {
	content: '';
	position: absolute;
	left: 4px;
	top: 1px;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}
.wizard-nav-btn.is-current .wizard-nav-mark { border-color: var(--primary); }
.agent-wizard-exit { margin: 16px 0 0; font-size: 13px; }
.agent-wizard.is-resume .wizard-nav-btn { pointer-events: none; opacity: 0.45; }
.wizard-key-preview {
	display: block;
	margin: 8px 0 0;
	padding: 10px 12px;
	background: #f4f5f8;
	border-radius: 8px;
	font-size: 12px;
	word-break: break-all;
	white-space: pre-wrap;
}
.wizard-resume { margin-bottom: 16px; }
.agent-wizard-pane > #wizard-env-create-host { display: none; }
.wizard-env-choice {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-top: 16px;
}
.wizard-env-choice > .foundation-panel { margin-top: 0; }
.wizard-env-or {
	margin: 0;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	color: var(--muted);
	text-align: center;
}
#wizard-env-create-fold { margin-top: 0; }
#wizard-env-choose-slot .settings-item-card {
	margin-top: 0;
	box-shadow: none;
	border: none;
	background: transparent;
	padding: 0;
}
#wizard-env-choose-slot .settings-item-card > h3 { display: none; }
#wizard-env-first-slot .settings-item-card { margin-top: 16px; }
.agent-wizard-step > h2 { margin: 0 0 10px; }
.agent-wizard-step > p { line-height: 1.5; }
.agent-wizard-step .foundation-panel { margin-top: 16px; }
details.wizard-fold { padding: 0; }
details.wizard-fold > *:not(summary) { margin-left: 18px; margin-right: 18px; }
details.wizard-fold > *:not(summary):last-child { margin-bottom: 18px; }
details.wizard-fold > summary {
	list-style: none;
	cursor: pointer;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 42%) auto;
	align-items: center;
	column-gap: 12px;
	row-gap: 6px;
	padding: 14px 18px;
	user-select: none;
}
details.wizard-fold > summary::-webkit-details-marker { display: none; }
details.wizard-fold > summary .wizard-fold-title {
	grid-column: 1;
	grid-row: 1;
	min-width: 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
}
details.wizard-fold > summary .wizard-fold-blurb {
	grid-column: 2;
	grid-row: 1;
	min-width: 0;
	color: var(--muted);
	font-size: 13px;
	font-weight: 400;
	text-align: right;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
details.wizard-fold > summary > i {
	grid-column: 3;
	grid-row: 1;
	color: var(--primary);
	font-size: 13px;
	transition: transform .15s ease;
	justify-self: end;
}
details.wizard-fold[open] > summary > i { transform: rotate(180deg); }
details.wizard-fold > summary .host-mini-steps {
	grid-column: 1 / -1;
	margin: 0;
	padding: 0 0 0 18px;
	color: var(--muted);
	font-size: 13px;
	font-weight: 400;
	line-height: 1.45;
}
details.wizard-fold[open] > summary .host-mini-steps { display: none; }
details.wizard-fold[open] > summary {
	border-bottom: 1px solid var(--line);
	margin-bottom: 16px;
}
details.wizard-fold > h3 {
	margin: 0 0 10px;
	font-size: 15px;
}
.agent-wizard-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin-top: 16px;
}
.wizard-field {
	display: block;
	margin: 12px 0;
	font-size: 13px;
	font-weight: 600;
}
.wizard-field input { display: block; width: 100%; margin-top: 6px; font-weight: 400; }
#wizard-key-status, #wizard-git-status, #wizard-env-wait { min-height: 1.2em; }
@media (max-width: 900px) {
	.agent-wizard {
		grid-template-columns: 1fr;
	}
	.agent-wizard-rail { position: static; }
	.agent-wizard-nav { flex-direction: row; flex-wrap: wrap; }
	.wizard-nav-btn { width: auto; }
}
.help-doc {
	max-width: 760px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding-bottom: 32px;
}
.help-lead { margin: 0; line-height: 1.5; }
.help-toc {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	font-size: 13px;
	font-weight: 600;
}
.help-url-list { margin: 6px 0 12px; padding-left: 22px; }
.help-url-ok li { color: #1a6b3c; }
.help-url-bad li { color: #8a2b2b; }
.help-url-list code { font-size: 13px; }
.help-check-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0 0 8px;
}
.help-check-row h2 { margin: 0; font-size: 16px; }
.help-check-row input { margin-top: 4px; }
.help-checklist {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.help-checklist > li {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 20px 24px;
}
.help-checklist h2 { margin: 0; font-size: 16px; }
.help-checklist ul { margin: 8px 0 0; padding-left: 20px; }
.help-checklist pre {
	margin: 10px 0 0;
	padding: 10px 12px;
	background: #eef0f6;
	border-radius: 6px;
	overflow-x: auto;
	font-size: 13px;
}
.help-doc .foundation-panel { max-width: none; }
.help-doc .foundation-panel h3 { margin-top: 16px; }
.help-doc ol { margin: 8px 0 0; padding-left: 22px; }
.help-doc li { margin: 6px 0; line-height: 1.45; }
.settings-cards {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: stretch;
	width: 100%;
}
.settings-list-heading {
	margin: 12px 0 2px;
	font-size: 13px;
	font-weight: 700;
	color: var(--muted);
	letter-spacing: 0.02em;
	text-transform: uppercase;
}
.settings-item-card {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 20px;
	min-width: 0;
}
.settings-item-card.settings-fold {
	padding: 0;
}
.settings-fold-toggle {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 42%) auto;
	align-items: center;
	column-gap: 12px;
	row-gap: 6px;
	width: 100%;
	margin: 0;
	padding: 14px 18px;
	border: 0;
	background: none;
	cursor: pointer;
	font: inherit;
	color: inherit;
	text-align: left;
}
.settings-fold-title {
	grid-column: 1;
	grid-row: 1;
	min-width: 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
}
.settings-fold-meta {
	grid-column: 2;
	grid-row: 1;
	min-width: 0;
	color: var(--muted);
	font-size: 13px;
	font-weight: 400;
	text-align: right;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.settings-fold-toggle > i {
	grid-column: 3;
	grid-row: 1;
	color: var(--primary);
	font-size: 13px;
	transition: transform .15s ease;
	justify-self: end;
}
.settings-fold.is-open .settings-fold-toggle > i { transform: rotate(180deg); }
.settings-fold-body { display: none; padding: 0 18px 18px; }
.settings-fold.is-open .settings-fold-body { display: block; }
.settings-fold.is-open .settings-fold-toggle {
	border-bottom: 1px solid var(--line);
	margin-bottom: 16px;
}
.settings-fold-preview {
	display: block;
	padding: 0 18px 16px;
}
.settings-fold.is-open .settings-fold-preview { display: none; }
.integ-mini-steps {
	margin: 0;
	padding-left: 18px;
	color: var(--muted);
	font-size: 13px;
	font-weight: 400;
	line-height: 1.45;
}
.integ-mini-steps li { margin: 4px 0; }
.integ-host-form .settings-item-actions { margin-top: 4px; }
.integ-full-steps {
	margin-top: 8px;
	padding-top: 16px;
	border-top: 1px solid var(--line);
	grid-column: 1 / -1;
}
.integ-full-steps h3 {
	margin: 0 0 8px;
	font-size: 15px;
}
.integ-full-steps ol {
	margin: 0;
	padding-left: 18px;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.45;
}
.integ-full-steps li { margin: 6px 0; }
.settings-item-card-add { border-style: dashed; }
.settings-item-card h3 { margin: 0 0 12px; font-size: 16px; }
.settings-item-summary { margin: 0 0 12px; line-height: 1.45; }
.settings-item-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin-top: 4px;
}
.settings-item-card > form:not(.auth-form) { margin-top: 8px; }
.settings-item-delete-form { display: none; }
.settings-item-delete { color: #c0392b; }

.agents-layout {
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: 100%;
}
@media (min-width: 1200px) {
	body.tt-page-settings .app-content {
		align-self: center;
		width: 70%;
		max-width: 70%;
		box-sizing: border-box;
	}
	body.tt-page-settings .foundation-panel,
	body.tt-page-settings .help-doc,
	body.tt-page-settings .storyboard-list,
	body.tt-page-settings .env-layout,
	body.tt-page-settings .env-git-setup,
	body.tt-page-settings .settings-cards,
	body.tt-page-settings .agents-layout,
	body.tt-page-settings .settings-tab-intro {
		width: 100%;
		max-width: none;
	}
	body.tt-page-board .tags-page {
		width: 70%;
		max-width: 70%;
	}
}
.agent-card { width: 100%; max-width: none; }
.auth-form.agent-form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 12px 20px;
	align-items: start;
}
.agent-form > input[type="hidden"] { display: none; }
.agent-form-triggers {
	grid-column: 1 / -1;
}
.agent-form-triggers .hint { margin: 0 0 8px; }
.agent-trigger-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
}
.agent-form > input[type="hidden"] { display: none; }
.agent-form .settings-item-actions {
	grid-column: 1 / -1;
	margin-top: 0;
}
.agent-form.is-cloud .agent-local-row,
.agent-form .agent-local-row[hidden] { display: none !important; }
.agent-form.is-local .agent-cloud-row { display: none; }
.agent-form .agent-local-row > label { margin: 0; }
.env-confirm-copy { text-align: left; font-size: 14px; line-height: 1.45; color: var(--text); }
.env-confirm-copy p { margin: 0 0 10px; }
.env-confirm-copy ul { margin: 0; padding-left: 18px; }
.env-confirm-copy li { margin: 6px 0; }
.env-form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 12px 20px;
	align-items: start;
}
.env-form > input[type="hidden"] { display: none; }
.env-form .env-field-key,
.env-form .env-primary-block,
.env-form .env-additional-block,
.env-form .settings-item-actions,
.env-form .settings-item-summary {
	grid-column: 1 / -1;
}
.env-blurb {
	display: block;
	margin: 4px 0 0;
	font-size: 12px;
	font-weight: 400;
	color: var(--muted);
	line-height: 1.4;
}
.env-section-title {
	margin: 0 0 6px;
	font-size: 14px;
}
.env-additional-block .env-add-repo {
	margin-top: 10px;
}
.env-extra-list { display: flex; flex-direction: column; gap: 0; }
.env-primary-block {
	padding-bottom: 14px;
	margin-bottom: 8px;
	border-bottom: 1px solid var(--line);
}
.env-extra-row {
	padding: 12px 0;
	border-bottom: 1px solid var(--line);
}
.env-extra-row:last-child {
	border-bottom: 0;
	padding-bottom: 2px;
}
.env-field.is-invalid input,
.env-field.is-invalid select,
.env-field.is-invalid .tt-select-trigger,
.env-field-repo-branch.is-invalid input,
.env-field-repo-branch.is-invalid select,
.env-field-repo-branch.is-invalid .tt-select-trigger {
	border: 2px solid #e5484d;
	box-shadow: 0 0 0 3px rgba(229, 72, 77, .2);
}
.field-error {
	display: block;
	color: #c43437;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
	margin-top: 6px;
}
.env-form .form-error,
.env-form .env-key-status.form-error {
	font-size: 14px;
	font-weight: 700;
}
.env-key-line {
	display: flex;
	gap: 8px;
	align-items: center;
}
.env-key-line .env-key { flex: 1; min-width: 0; }
.env-key-line .env-check-key { white-space: nowrap; }
.env-key-status { display: block; margin: 6px 0 0; }
.env-check {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
}
.env-check-dot {
	flex: 0 0 auto;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #c5c9d4;
}
.env-check[data-state="pending"] .env-check-dot { background: #e5a100; }
.env-check[data-state="ok"] .env-check-dot { background: #30a46c; }
.env-check[data-state="fail"] .env-check-dot { background: #e5484d; }
.env-check-label {
	font-size: 12px;
	font-weight: 600;
	color: var(--muted);
	max-width: 11rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.env-check[data-state="ok"] .env-check-label { color: #218358; }
.env-check[data-state="fail"] .env-check-label {
	color: #c43437;
	font-size: 13px;
	font-weight: 700;
	max-width: none;
	white-space: normal;
	overflow: visible;
	text-overflow: unset;
}
.env-retry-repo { white-space: nowrap; }
.env-retry-repo:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}
.env-form .env-save:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}
.env-save-hint {
	flex: 1 1 100%;
	margin: 8px 0 0;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
	color: #c43437;
}
.env-repo-line {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(8rem, 11rem) minmax(8rem, auto) auto;
	gap: 8px 10px;
	align-items: end;
	justify-content: start;
}
.env-extra-row .env-repo-line,
.agent-origin-row .env-repo-line {
	align-items: center;
}
.env-repo-line > .env-url,
.env-repo-line .env-repo-url input {
	width: 100%;
	min-width: 0;
}
.env-repo-line .env-repo-head input,
.env-repo-line .env-repo-head select,
.env-repo-line .env-field-repo-branch input,
.env-repo-line .env-field-repo-branch select {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}
.env-repo-line .env-repo-url,
.env-repo-line .env-repo-head,
.env-repo-line .env-field-repo-branch {
	min-width: 0;
	margin: 0;
}
.env-repo-line .env-repo-head,
.env-repo-line .env-field-repo-branch {
	width: auto;
	max-width: 12rem;
}
.env-repo-headings {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(8rem, 11rem) minmax(8rem, auto) auto;
	gap: 8px 10px;
	align-items: end;
	justify-content: start;
	margin: 10px 0 4px;
	font-size: 12px;
	font-weight: 600;
}
.env-repo-headings-branch { max-width: 12rem; }
.env-repo-headings-action { min-width: 4.75rem; }
.env-repo-line .env-remove-repo {
	justify-self: start;
	white-space: nowrap;
	margin: 0;
}
@media (min-width: 900px) {
	.env-repo-line,
	.env-repo-headings {
		grid-template-columns: minmax(0, 50%) minmax(8rem, 12rem) minmax(8rem, auto) auto;
	}
}
.agent-cloud-row {
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 12px 20px;
	align-items: start;
}
.agent-repo-line {
	display: flex;
	gap: 8px;
	align-items: center;
}
.agent-repo-line select { flex: 1; min-width: 0; }
.agent-catalog-status { grid-column: 1 / -1; margin: 0; min-height: 1.2em; }
.agent-cloud-row > .hint,
.agent-origins { grid-column: 1 / -1; }

.account-menu { position: relative; margin-top: 0; }
.account-menu .nav-avatar { border: 0; cursor: pointer; margin-top: 0; }
.account-dropdown {
	position: absolute;
	right: 0;
	left: auto;
	top: calc(100% + 8px);
	bottom: auto;
	width: 280px;
	background: #fff;
	color: var(--text);
	border: 1px solid #d8d4ea;
	border-radius: 12px;
	box-shadow: 0 12px 28px rgba(28, 35, 51, .18), 0 2px 4px rgba(28, 35, 51, .08);
	padding: 12px;
	z-index: 60;
}
.account-dropdown-head {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-bottom: 10px;
	padding: 8px 10px 12px;
	border-bottom: 1px solid var(--line);
	font-size: 12px;
	color: var(--muted);
}
.account-dropdown-head strong { color: var(--text); font-size: 15px; }
.account-dropdown a, .account-switch { display: block; margin-top: 4px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 13px; }
.account-dropdown a {
	padding: 10px 12px;
	border-radius: 8px;
}
.account-dropdown a:hover { background: #f0f2f5; }
.account-switch { padding: 8px 10px 4px; }
.account-switch label { display: flex; flex-direction: column; gap: 4px; }
.account-switch select { width: 100%; }

.kanban-board {
	display: flex;
	align-items: stretch;
	flex: 1;
	min-height: 0;
	height: 100%;
	background: #eef0f6;
}
.kanban {
	display: flex;
	gap: 0;
	align-items: stretch;
	overflow-x: hidden;
	overflow-y: hidden;
	padding: 0;
	flex: 1;
	min-width: 0;
	min-height: 0;
	height: 100%;
}
.kanban-track {
	display: flex;
	align-items: stretch;
	height: 100%;
	min-height: 0;
	transition: transform .35s ease;
	will-change: transform;
}
.kanban-col {
	--kanban-col-min: 308px;
	min-width: var(--kanban-col-min);
	max-width: none;
	background: #eef0f6;
	border-radius: 0;
	border-right: 1px solid #e2e5ec;
	padding: 0;
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	min-height: 0;
	position: relative;
	color: var(--text);
}
.kanban-col:last-child { border-right: 0; }
.kanban-col header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 14px 12px;
	min-height: 56px;
	flex: 0 0 auto;
	color: #1c2333;
}
.kanban-col header em,
.kanban-col header .bucket-count {
	color: inherit;
	font-style: normal;
	margin-left: auto;
	font-size: 12px;
	font-weight: 700;
	min-width: 26px;
	height: 26px;
	padding: 0 8px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .16);
	line-height: 1;
	flex-shrink: 0;
}
body.tt-bucket-header-white .kanban-col header,
body.tt-bucket-header-white .kanban-col header .bucket-name,
body.tt-bucket-header-white .kanban-col header .bucket-icon,
body.tt-bucket-header-white .kanban-col header em,
body.tt-bucket-header-white .kanban-col header .bucket-count,
body.tt-bucket-header-white .kanban-col .bucket-handle,
body.tt-bucket-header-white .kanban-col .bucket-dots {
	color: #fff;
}
body.tt-bucket-header-white .kanban-col header .bucket-count,
body.tt-bucket-header-white .kanban-col header em {
	background: rgba(0, 0, 0, .22);
	color: #fff;
}
.kanban-col.wip-full { outline: 0; }
.kanban-col.wip-full header { box-shadow: inset 0 0 0 2px #E5484D; }
.kanban-col.wip-full header em,
.kanban-col.wip-full header .bucket-count { color: #E5484D; background: rgba(255,255,255,.7); }
.kanban-page-btn {
	flex: 0 0 48px;
	width: 48px;
	height: 88px;
	margin: 0 10px;
	align-self: center;
	border: 2px solid var(--primary);
	border-radius: 16px;
	background: #fff;
	color: var(--primary);
	font-size: 20px;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(109, 94, 252, .14);
	z-index: 6;
}
.kanban-page-btn:hover:not(:disabled) { background: #f4f2ff; }
.kanban-page-btn.is-disabled {
	visibility: hidden;
	pointer-events: none;
}
.kanban-page-btn[hidden] { display: none; }
.kanban.share-kanban { overflow-x: auto; }
.bucket-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.bucket-icon { width: 22px; text-align: center; font-size: 16px; }
.bucket-name { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bucket-handle, .bucket-dots {
	border: 0;
	background: transparent;
	color: inherit;
	padding: 4px 6px;
	cursor: grab;
	line-height: 1;
}
.bucket-dots { cursor: pointer; }
.bucket-handle:active { cursor: grabbing; }
.kanban-cards-wrap {
	position: relative;
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
}
.kanban-cards {
	min-height: 48px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 8px 8px 28px;
	position: relative;
	scrollbar-width: none;
}
.kanban-cards::-webkit-scrollbar { width: 0; height: 0; display: none; }
.kanban-scroll-hint {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 4;
	pointer-events: none;
	background: rgba(226, 228, 234, 0.78);
	color: #5a6170;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-align: center;
	padding: 8px 10px 10px;
}
.kanban-scroll-hint[hidden] { display: none !important; }
.kanban-scroll-hint i { margin-left: 4px; font-size: 10px; }
.kanban-col .add-card {
	width: calc(100% - 16px);
	margin: 0 8px 10px;
	border: 0;
	background: #fff;
	border-radius: 6px;
	padding: 8px;
	cursor: pointer;
	color: var(--text);
	flex: 0 0 auto;
	box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.kanban-col .add-card:hover { background: #f7f8fb; }
.kanban-add-col {
	background: #eceef3;
	align-items: stretch;
	justify-content: flex-start;
	min-width: 200px;
	flex-basis: 200px;
}
.add-bucket-btn {
	margin: 10px;
	border: 0;
	background: rgba(255,255,255,.7);
	padding: 10px 12px;
	cursor: pointer;
	font-weight: 600;
	text-align: left;
}
.bucket-menu {
	position: absolute;
	top: 60px;
	right: 8px;
	z-index: 25;
	background: #fff;
	border: 1px solid var(--line);
	box-shadow: 0 8px 24px rgba(0,0,0,.18);
	padding: 12px;
	width: 268px;
	max-height: calc(100% - 56px);
	overflow: auto;
}
.bucket-menu label { display: block; margin: 8px 0; font-size: 13px; }
.bucket-menu input[type="text"], .bucket-menu input[type="number"], .bucket-rename {
	width: 100%;
	padding: 6px 8px;
	border: 1px solid var(--line);
	border-radius: 6px;
}
.bucket-menu-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.check-inline { display: flex; align-items: center; gap: 6px; }
.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.color-swatch {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 3px solid transparent;
	box-shadow: inset 0 0 0 1px rgba(28, 35, 51, .16);
	cursor: pointer;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: relative;
}
.color-swatch.selected {
	border-color: #fff;
	box-shadow: 0 0 0 2px var(--primary);
	transform: scale(1.08);
}
.color-swatch.selected::after {
	content: "\2713";
	color: #fff;
	font-size: 13px;
	font-weight: 800;
	line-height: 1;
	text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}
.tags-page {
	width: 100%;
	max-width: 1040px;
	margin: 0 auto;
}
.tag-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; }
.tags-layout {
	display: grid;
	grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.15fr);
	gap: 24px;
	align-items: start;
}
.tags-pane {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 24px;
	min-width: 0;
}
.tags-pane h2 { margin-top: 0; }
.tags-layout .color-swatches {
	display: grid;
	grid-template-columns: repeat(10, 28px);
	gap: 8px;
	width: max-content;
	max-width: 100%;
}
.tag-row {
	padding: 8px 12px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: #fafbfe;
}
.tag-row.is-open {
	padding: 12px;
}
.tag-row-summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	margin: 0;
	padding: 4px 0;
	border: 0;
	background: none;
	cursor: pointer;
	font: inherit;
	color: inherit;
	text-align: left;
}
.tag-row-summary .tag-preview { max-width: calc(100% - 72px); }
.tag-edit-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
	color: var(--primary);
	font-size: 13px;
	font-weight: 700;
}
.tag-edit-label i { transition: transform .15s ease; }
.tag-row.is-open .tag-edit-label i { transform: rotate(180deg); }
.tag-row-editor { display: none; }
.tag-row.is-open .tag-row-editor {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 12px;
	align-items: start;
	margin-top: 8px;
	padding-top: 12px;
	border-top: 1px solid var(--line);
}
.tag-edit { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tag-edit-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.tag-preview {
	display: inline-block;
	align-self: flex-start;
	width: fit-content;
	max-width: 100%;
	box-sizing: border-box;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 999px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-shadow: 0 1px 1px rgba(0,0,0,.15);
}
.tag-edit input[name="tag_name"],
.tag-name-label input {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 10px;
	border: 1px solid var(--line);
	border-radius: 8px;
	font: inherit;
}
.tag-name-label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; width: 100%; }
.tag-row-actions { display: flex; gap: 8px; }
.tag-delete { margin-top: 2px; }
.foundation-panel h3 { margin: 8px 0 12px; font-size: 16px; }
.icon-picker { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 10px; }
.icon-pick {
	width: 32px;
	height: 32px;
	border: 1px solid var(--line);
	background: #fff;
	cursor: pointer;
	border-radius: 6px;
}
.icon-pick.selected { border-color: var(--primary); background: #f3f0ff; }
.task-card {
	background: #fff;
	border-radius: 14px;
	padding: 10px 40px 10px 12px;
	box-shadow: 0 1px 2px rgba(0,0,0,.06);
	cursor: pointer;
	position: relative;
}
.kanban-cards .task-card {
	flex: 0 0 auto;
	min-height: 96px;
	max-height: 168px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	padding: 0 40px 10px 12px;
}
.kanban-cards .task-card strong {
	flex-shrink: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	line-height: 1.3;
	font-size: 14px;
}
.task-card-desc {
	margin: 4px 0 0;
	font-size: 12px;
	line-height: 1.35;
	color: var(--muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	flex: 1 1 auto;
	min-height: 0;
}
.task-card-foot {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	margin-top: auto;
	padding-top: 6px;
	font-size: 11px;
	color: var(--muted);
	flex-shrink: 0;
}
.kanban-cards .task-tags {
	max-height: 22px;
	overflow: hidden;
	flex-shrink: 0;
	margin-top: 6px;
}
.task-card-bar { height: 4px; border-radius: 4px; margin: -10px -40px 8px -12px; }
.kanban-cards .task-card-bar {
	height: 6px;
	margin: 0 -40px 10px -12px;
	border-radius: 0;
}
.task-card-meta { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; margin-top: 6px; }
.task-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.task-tags em { color: #fff; font-style: normal; font-size: 11px; padding: 2px 6px; border-radius: 999px; }
.card-av, .mini-av {
	display: inline-flex;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--primary);
	color: #fff;
	align-items: center;
	justify-content: center;
	font-size: 10px;
	font-weight: 700;
}
.mini-av.is-ai,
.card-av.is-ai {
	background: var(--ai-avatar);
}
.card-av {
	position: absolute;
	top: 10px;
	right: 10px;
}
.card-agent-lock {
	position: absolute;
	top: 34px;
	right: 12px;
	width: 16px;
	height: 16px;
	color: #22a06b;
	font-size: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
}
.card-agent-lock i {
	animation: tt-spin 0.9s linear infinite;
}
@keyframes tt-spin {
	to { transform: rotate(360deg); }
}
.kanban-cards .task-card.is-agent-locked {
	cursor: not-allowed;
}
.card-blocked {
	position: absolute;
	top: 12px;
	left: 8px;
	width: 18px;
	height: 18px;
	background: #e5484d;
	color: #fff;
	clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
	z-index: 1;
	pointer-events: none;
}
.card-blocked::after {
	content: '';
	position: absolute;
	left: 3px;
	right: 3px;
	top: 8px;
	height: 2px;
	background: #fff;
	border-radius: 1px;
}
.kanban-cards .task-card.is-blocked {
	padding-left: 34px;
}
.kanban-cards .task-card.is-blocked .task-card-bar {
	margin-left: -34px;
}
.list-view { display: flex; flex-direction: column; gap: 8px; }
.list-row {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr 80px;
	gap: 12px;
	align-items: center;
	padding: 12px 16px;
}
.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.data-table tr { cursor: pointer; }

.timeline-board {
	--label-col: 220px;
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
}
.timeline-head,
.timeline-member-row {
	display: grid;
	grid-template-columns: var(--label-col) 1fr;
	align-items: stretch;
}
.timeline-tools {
	padding: 12px 14px;
	border-right: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 8px;
}
.timeline-tools input[type="search"] {
	width: 100%;
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 8px 10px;
	font: inherit;
}
.timeline-effort-hint {
	margin: 0;
	font-size: 12px;
	color: var(--muted);
	line-height: 1.35;
}
.timeline-days-wrap {
	display: flex;
	align-items: stretch;
	min-width: 0;
	border-bottom: 1px solid var(--line);
}
.timeline-days-clip,
.timeline-lane-clip {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
}
.timeline-days {
	display: grid;
	grid-template-columns: repeat(var(--days, 7), 1fr);
	width: 100%;
	will-change: transform;
	transition: transform 0.35s ease;
	transform: translateX(calc(-100% * var(--day-start, 0) / var(--days, 7)));
}
.timeline-day {
	padding: 10px 6px 22px;
	border-right: 1px solid var(--line);
	font-size: 13px;
	position: relative;
}
.timeline-day strong { display: block; font-size: 13px; }
.timeline-ticks { position: absolute; left: 0; right: 0; bottom: 2px; height: 16px; }
.timeline-ticks span {
	position: absolute;
	bottom: 0;
	font-size: 10px;
	color: var(--muted);
	font-weight: 400;
	transform: translateX(2px);
}
.timeline-day-btn {
	display: none;
	flex: 0 0 36px;
	width: 36px;
	align-items: center;
	justify-content: center;
	margin: 0;
	border: 0;
	border-right: 1px solid var(--line);
	border-left: 1px solid var(--line);
	background: #fff;
	color: var(--primary);
	font-size: 16px;
	cursor: pointer;
	z-index: 2;
}
.timeline-day-btn:hover { background: #f4f2ff; }
.timeline-day-btn[hidden] { display: none !important; }
.timeline-member-row { min-height: 52px; }
.timeline-row-member {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 8px 14px;
	border-right: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	background: #fff;
}
.timeline-row-member small { display: block; color: var(--muted); }
.timeline-lane {
	position: relative;
	min-height: 52px;
	width: 100%;
	border-bottom: 1px solid var(--line);
	will-change: transform;
	transition: transform 0.35s ease;
	transform: translateX(calc(-100% * var(--day-start, 0) / var(--days, 7)));
	background-image:
		repeating-linear-gradient(
			to right,
			transparent 0,
			transparent calc(100% / var(--days, 7) - 1px),
			#d5d9e2 calc(100% / var(--days, 7) - 1px),
			#d5d9e2 calc(100% / var(--days, 7))
		),
		repeating-linear-gradient(
			to right,
			transparent 0,
			transparent calc(100% / (var(--days, 7) * var(--ticks-per-day, 4)) - 1px),
			#eceef2 calc(100% / (var(--days, 7) * var(--ticks-per-day, 4)) - 1px),
			#eceef2 calc(100% / (var(--days, 7) * var(--ticks-per-day, 4)))
		);
}
.timeline-block {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	height: 32px;
	border-radius: 8px;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	padding: 6px 10px;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	box-shadow: 0 2px 6px rgba(0,0,0,.12);
	box-sizing: border-box;
}
.work-days-fieldset {
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 10px 12px 12px;
	margin: 8px 0;
}
.work-days-fieldset legend { padding: 0 6px; font-weight: 600; }
.auth-form .work-day-opt,
.work-day-opt {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 4px 0;
	font-weight: 400;
	font-size: 14px;
}
.auth-form .work-day-opt:has(input:checked),
.work-day-opt:has(input:checked) {
	font-weight: 700;
}
.work-day-opt input { margin: 0; flex-shrink: 0; width: auto; padding: 0; border: 0; border-radius: 0; }

.modal {
	position: fixed;
	inset: 0;
	background: rgba(20,24,36,.45);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 48px 16px;
	z-index: 40;
	overflow: auto;
}
.modal[hidden] { display: none; }
.modal-card {
	background: #fff;
	width: min(960px, 96vw);
	border-radius: 24px;
	padding: 28px;
	position: relative;
	box-shadow: 0 24px 64px rgba(28,35,51,.18);
}
.modal-close {
	position: absolute;
	top: 10px;
	right: 12px;
	border: 0;
	background: transparent;
	font-size: 24px;
	cursor: pointer;
}
.bucket-edit, .inline-del { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin: 6px 0; }
.list-row.task-card { padding-right: 12px; }
.note-list { list-style: none; padding: 0; }
.note-list li { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.note-list .unread { font-weight: 600; }
.auth-form textarea { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; }
.ghost { text-decoration: none; display: inline-flex; align-items: center; }
.kanban-cards.drag-over { outline: 2px dashed var(--primary); }
.kanban-col.drag-over-col { outline: 2px dashed #1c2333; }
.timeline-lane.drag-over { background-color: #f3f0ff; }
.tt-insert-line {
	position: absolute;
	background: #111;
	pointer-events: none;
	z-index: 6;
	border-radius: 2px;
}
.kanban-cards .tt-insert-line {
	left: 8px;
	right: 8px;
	height: 3px;
}
.timeline-lane .tt-insert-line {
	top: 8px;
	bottom: 8px;
	width: 3px;
}
.kanban-cards .task-card.is-dragging,
.timeline-block.is-dragging { opacity: 0.35; }
.cal-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-dow { font-weight: 700; font-size: 12px; color: var(--muted); }
.cal-cell { min-height: 110px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.cal-cell.empty { background: transparent; border: 0; }
.cal-chip { display: block; width: 100%; border: 0; color: #fff; border-radius: 6px; padding: 4px 6px; margin-top: 4px; font-size: 11px; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.menu-toggle {
	display: none;
	position: static;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: var(--util-bg);
	color: #050505;
	font-size: 18px;
	cursor: pointer;
	flex-shrink: 0;
}
.sidebar-backdrop {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.35);
	z-index: 25;
}

@media (max-width: 800px) {
	/* Two tracks: search fills the left; bell + avatar stay content-width on the right.
	   Primary icon nav is fixed to the bottom (mobile-app style). */
	.app-topbar {
		grid-template-columns: minmax(0, 1fr) auto;
		overflow: visible;
	}
	.topbar-help { display: none; }
	/* Small glass: compact × aligned with bell/avatar (no LG Back to board in the drawer until opened). */
	.settings-close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		border-radius: 50%;
		border: 0;
		background: var(--util-bg);
		color: #050505;
		font-size: 22px;
		line-height: 1;
		text-decoration: none;
		font-weight: 500;
		flex-shrink: 0;
	}
	.topbar-left {
		flex: 1 1 auto;
		min-width: 0;
		gap: 10px;
	}
	.topbar-right {
		flex: 0 0 auto;
		justify-self: end;
		gap: 6px;
	}
	.menu-toggle { display: flex; align-items: center; justify-content: center; }
	.topbar-center {
		display: flex;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		height: calc(var(--sg-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
		padding: 0 4px env(safe-area-inset-bottom, 0px);
		z-index: 34;
		align-items: stretch;
		justify-content: space-evenly;
		gap: 0;
		background: linear-gradient(180deg, #ffffff 0%, #f4f5fb 100%);
		box-shadow:
			0 -10px 28px rgba(28, 35, 51, 0.1),
			0 -1px 0 rgba(109, 94, 252, 0.12);
	}
	.topbar-center::before {
		content: "";
		position: absolute;
		top: 0;
		left: 8%;
		right: 8%;
		height: 2px;
		border-radius: 2px;
		background: linear-gradient(
			90deg,
			rgba(109, 94, 252, 0) 0%,
			rgba(109, 94, 252, 0.45) 20%,
			rgba(91, 78, 232, 0.75) 50%,
			rgba(109, 94, 252, 0.45) 80%,
			rgba(109, 94, 252, 0) 100%
		);
		pointer-events: none;
	}
	.topbar-tab {
		width: auto;
		max-width: none;
		flex: 1 1 0;
		border-radius: 12px;
		margin: 6px 2px;
		font-size: 20px;
	}
	.topbar-tab.active::after {
		left: 18%;
		right: 18%;
		bottom: auto;
		top: 0;
		height: 3px;
		border-radius: 0 0 3px 3px;
	}
	body.tt-page-board .app-main,
	body.tt-page-settings .app-main {
		margin-left: 0;
		padding-bottom: calc(var(--sg-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
	}
	/* Hamburger opens the LG sub-nav (views + actions), not the primary icons. */
	.app-subheader {
		display: none;
		position: fixed;
		top: 56px;
		left: 0;
		right: 0;
		bottom: calc(var(--sg-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
		z-index: 32;
		grid-template-columns: none;
		padding: 12px 16px 20px;
		overflow-x: hidden;
		overflow-y: auto;
		background: linear-gradient(180deg, #ffffff 0%, #f7f8fc 100%);
		border-bottom: 0;
		box-shadow: 0 12px 32px rgba(28, 35, 51, 0.14);
		gap: 16px;
	}
	body.nav-open .app-subheader {
		display: flex;
		flex-direction: column;
		align-items: stretch;
	}
	body.nav-open .sidebar-backdrop {
		display: block;
		z-index: 31;
	}
	.app-subheader .date-nav { display: none; }
	.app-subheader .view-tabs {
		display: flex;
		flex-direction: column;
		overflow-x: visible;
		gap: 0;
	}
	.app-subheader .view-tabs a {
		padding: 14px 4px;
		border-bottom: 1px solid var(--line);
		font-size: 16px;
	}
	.app-subheader .view-tabs a.active {
		color: var(--primary);
		border-bottom: 1px solid var(--line);
		box-shadow: inset 3px 0 0 var(--primary);
		padding-left: 10px;
	}
	.app-subheader .subheader-actions {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
		gap: 10px;
	}
	.app-subheader .subheader-actions .btn-primary,
	.app-subheader .subheader-actions .ghost {
		width: 100%;
		text-align: center;
		justify-content: center;
	}
	.app-header { padding: 12px 16px 8px; }
	.app-header h1 { font-size: 20px; }
	.topbar-search-wrap {
		flex: 1 1 auto;
		max-width: none;
		min-width: 0;
	}
	.app-pagehead { padding: 10px 16px 0; }
	.app-pagehead h1 { font-size: 18px; }
	.date-range { min-width: 0; width: 100%; }
	.app-content { padding: 12px; }
	.app-content.board-fill { padding: 0; }
	.kanban-page-btn { display: none !important; }
	/* One bucket = one screen; horizontal move is transform paging (swipe), not free scroll. */
	.kanban {
		overflow-x: hidden;
		overflow-y: hidden;
		touch-action: pan-y;
	}
	.kanban-col, .kanban-add-col {
		min-width: 100%;
		max-width: 100%;
		flex: 0 0 100%;
	}
	.timeline-board { --label-col: 140px; --visible-days: 3; }
	.timeline-days,
	.timeline-lane {
		width: calc(100% * var(--days, 7) / var(--visible-days, 3));
	}
	.timeline-day-btn {
		display: inline-flex;
	}
	.modal-card { width: calc(100vw - 16px); margin: 8px; max-height: calc(100vh - 16px); }
	/* Title + purple caret stay on one row; meta wraps under the title. */
	.settings-fold-toggle {
		grid-template-columns: minmax(0, 1fr) auto;
	}
	.settings-fold-title {
		grid-column: 1;
		grid-row: 1;
	}
	.settings-fold-toggle > i {
		grid-column: 2;
		grid-row: 1;
	}
	.settings-fold-meta {
		grid-column: 1 / -1;
		grid-row: 2;
		text-align: left;
		white-space: normal;
		overflow: visible;
		text-overflow: unset;
	}
	details.wizard-fold > summary {
		grid-template-columns: minmax(0, 1fr) auto;
	}
	details.wizard-fold > summary .wizard-fold-title {
		grid-column: 1;
		grid-row: 1;
	}
	details.wizard-fold > summary > i {
		grid-column: 2;
		grid-row: 1;
	}
	details.wizard-fold > summary .wizard-fold-blurb {
		grid-column: 1 / -1;
		grid-row: 2;
		text-align: left;
		white-space: normal;
		overflow: visible;
		text-overflow: unset;
	}
	details.wizard-fold > summary .host-mini-steps {
		grid-column: 1 / -1;
	}
	.settings-grid-board { display: flex; flex-direction: column; }
	.settings-grid-board > .foundation-panel,
	.settings-grid-board > .board-story-panel {
		flex: 1 1 auto;
	}
	.auth-form.board-story-form {
		display: flex;
		flex-direction: column;
	}
	.auth-form.agent-form {
		display: flex;
		flex-direction: column;
	}
	.agent-cloud-row {
		display: flex;
		flex-direction: column;
	}
	.board-story-tz { order: 5; }
	.board-story-days-col { order: 6; }
	.board-story-save { order: 7; }
	.tags-layout { grid-template-columns: 1fr; }
	.tags-layout .color-swatches { grid-template-columns: repeat(5, 28px); }
	.cal-grid { grid-template-columns: repeat(7, minmax(40px, 1fr)); overflow-x: auto; }
	.cal-cell { min-height: 72px; }
	.tt-task-grid, .tt-swal-grid { grid-template-columns: 1fr; }
}

.swal-modal {
	position: relative;
	border-radius: 24px !important;
	box-shadow: 0 24px 64px rgba(28,35,51,.22) !important;
}
.swal-modal.tt-swal-wide {
	width: min(720px, 96vw);
	max-width: 96vw;
	padding: 12px 16px 20px;
}
.swal-modal .tt-swal-close {
	z-index: 3;
	top: 14px;
	right: 16px;
}
.swal-overlay {
	background-color: rgba(20, 24, 36, .5) !important;
}
.swal-footer {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 8px;
}
.swal-button--confirm {
	margin-left: auto;
}
.swal-button {
	border-radius: 999px !important;
	padding: 10px 22px !important;
}
.swal-title { font-size: 22px !important; }
.tt-swal-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px 20px;
	text-align: left;
}
.tt-swal-grid .tt-span-2 { grid-column: 1 / -1; }
.tt-swal-grid label, .tt-swal-grid .hint { display: block; }
.tt-swal-grid label.bucket-allowed-autos {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-weight: 600;
	font-size: 14px;
}
.tt-swal-grid input[type="text"],
.tt-swal-grid input[type="number"],
.tt-bucket-form .bucket-rename {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--line);
	border-radius: 12px;
	box-sizing: border-box;
}
.tt-task-grid {
	display: grid;
	grid-template-columns: 1.15fr .85fr;
	gap: 20px 28px;
	align-items: start;
}
.tt-task-notes {
	margin-top: 24px;
	border-top: 1px solid var(--line);
	padding-top: 16px;
}
.assignee-notify-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	font-size: 13px;
	margin: 6px 0;
}
.kanban-cards .task-card.drop-target { outline: 2px dashed var(--primary); }
@media (max-width: 800px) {
	.tt-task-grid, .tt-swal-grid { grid-template-columns: 1fr; }
	.mt-task-body { grid-template-columns: 1fr; }
	/*
	 * Small glass SweetAlert: top-align the white box, keep it within the
	 * viewport, and scroll the body — never scroll the overlay to find the box.
	 * Injected sweetalert CSS uses vertical-align:middle + overlay overflow-y:scroll,
	 * which opens tall dialogs scrolled to the bottom.
	 */
	.swal-overlay {
		overflow: hidden !important;
		padding: 8px !important;
		padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
		box-sizing: border-box !important;
	}
	.swal-overlay:before {
		content: none !important;
		display: none !important;
		height: 0 !important;
	}
	.swal-modal {
		vertical-align: top !important;
		margin: 0 auto !important;
		width: calc(100vw - 16px) !important;
		max-width: calc(100vw - 16px) !important;
		max-height: calc(100vh - 16px) !important;
		max-height: calc(100dvh - 16px - env(safe-area-inset-bottom, 0px)) !important;
		display: inline-flex !important;
		flex-direction: column !important;
		overflow: hidden !important;
		box-sizing: border-box !important;
	}
	.swal-modal.tt-swal-wide {
		width: calc(100vw - 16px) !important;
		height: calc(100vh - 16px);
		height: calc(100dvh - 16px - env(safe-area-inset-bottom, 0px));
		max-height: calc(100vh - 16px) !important;
		max-height: calc(100dvh - 16px - env(safe-area-inset-bottom, 0px)) !important;
	}
	.swal-modal .swal-title,
	.swal-modal .swal-icon,
	.swal-modal .swal-text,
	.swal-modal .swal-footer {
		flex-shrink: 0;
	}
	.swal-modal .swal-content {
		flex: 1 1 auto;
		min-height: 0;
		overflow-x: hidden;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}
}

#task-modal.modal {
	align-items: center;
	padding: 24px 16px;
	overflow: hidden;
}
#task-modal .modal-card {
	width: min(1100px, 96vw);
	max-height: calc(100vh - 48px);
	padding: 0;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	border-radius: 20px;
}
#task-modal #task-modal-body {
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
	display: flex;
}
/* Task overlay: × stays top-right; labeled Close floats bottom-right (right pane). */
#task-modal .modal-close { z-index: 4; top: 14px; right: 16px; }
#task-modal .mt-close {
	position: absolute;
	z-index: 4;
	right: 16px;
	bottom: 16px;
	background: #fff;
	color: var(--text);
	border: 1px solid var(--line);
	border-radius: 999px;
	padding: 8px 16px;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
	box-shadow: 0 2px 10px rgba(28, 35, 51, 0.14);
}
#task-modal .mt-close:hover { background: #f3f4f8; }
.mt-task {
	flex: 1;
	min-height: 0;
	max-height: 100%;
	display: flex;
	flex-direction: column;
	width: 100%;
}
.mt-task-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 52px 12px 18px;
	border-bottom: 1px solid var(--line);
	flex-shrink: 0;
}
.mt-advance {
	background: #4c8dff;
	color: #fff;
	border: 0;
	border-radius: 999px;
	padding: 8px 16px;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
}
.mt-advance.is-done { background: #c5cad6; cursor: default; }
.mt-block {
	background: #fff;
	color: #c62828;
	border: 1px solid #c62828;
	border-radius: 999px;
	padding: 8px 16px;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
}
.mt-block.is-blocked {
	background: #c62828;
	color: #fff;
}
.mt-blocked-banner {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0 0 10px;
	padding: 8px 12px;
	border-radius: 10px;
	background: #fdecea;
	color: #8a1f1f;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.35;
}
.mt-blocked-banner,
.mt-agent-lock-banner,
.mt-setup-block-banner {
	flex-shrink: 0;
}
.mt-agent-lock-banner {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0 0 10px;
	padding: 8px 12px;
	border-radius: 10px;
	background: #e8f8ee;
	color: #166534;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.35;
}
.mt-task.is-agent-locked .mt-title,
.mt-task.is-agent-locked .mt-desc,
.mt-task.is-agent-locked .mt-ac,
.mt-task.is-agent-locked .mt-playbooks,
.mt-task.is-agent-locked .mt-task-side details,
.mt-task.is-agent-locked .mt-assignee,
.mt-task.is-agent-locked .mt-color-wrap,
.mt-task.is-agent-locked .mt-more-wrap,
.mt-task.is-agent-locked .mt-advance,
.mt-task.is-agent-locked .mt-run-auto,
.mt-task.is-agent-locked #add-attachment,
.mt-task.is-agent-locked .mt-files {
	opacity: 0.55;
	pointer-events: none;
}
.kanban-cards .task-card.is-setup-blocked {
	opacity: 0.72;
	filter: grayscale(0.55);
	border: 2px solid #c62828;
	cursor: not-allowed;
}
.card-setup-alert {
	position: absolute;
	top: 10px;
	right: 8px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #c62828;
	color: #fff;
	z-index: 1;
	pointer-events: none;
}
.card-setup-alert::before {
	content: '!';
	display: block;
	text-align: center;
	font-size: 12px;
	font-weight: 800;
	line-height: 18px;
}
.mt-setup-block-banner {
	margin: 0 0 12px;
	padding: 10px 12px;
	border: 1px solid #c62828;
	background: #fdecea;
	color: #8b1515;
	font-size: 13px;
	line-height: 1.4;
	border-radius: 8px;
}
.mt-setup-block-banner strong { display: block; margin-bottom: 4px; }
.mt-setup-block-banner p { margin: 0 0 6px; }
.mt-setup-block-banner a { color: #8b1515; font-weight: 700; }
.mt-task.is-setup-blocked .mt-title,
.mt-task.is-setup-blocked .mt-desc,
.mt-task.is-setup-blocked .mt-ac,
.mt-task.is-setup-blocked .mt-playbooks,
.mt-task.is-setup-blocked .mt-task-side details,
.mt-task.is-setup-blocked .mt-color-wrap,
.mt-task.is-setup-blocked .mt-more-wrap,
.mt-task.is-setup-blocked .mt-advance,
.mt-task.is-setup-blocked .mt-block,
.mt-task.is-setup-blocked .mt-run-auto,
.mt-task.is-setup-blocked #add-attachment,
.mt-task.is-setup-blocked .mt-files {
	opacity: 0.55;
	pointer-events: none;
}
.settings-item-card.is-setup-flagged {
	border: 2px solid #c62828;
	box-shadow: 0 0 0 1px rgba(198, 40, 40, 0.2);
}
.setup-flag-banner {
	margin: 0 0 14px;
	padding: 10px 12px;
	border: 1px solid #c62828;
	background: #fdecea;
	color: #8b1515;
	border-radius: 8px;
	font-size: 13px;
	line-height: 1.4;
}
.setup-flag-banner strong { display: block; margin-bottom: 4px; }
.setup-flag-banner p { margin: 0 0 8px; }
.env-branch-hint {
	display: block;
	margin-top: 4px;
	font-size: 12px;
	color: var(--muted);
	line-height: 1.35;
}
.env-branch-hint[hidden] { display: none; }
.env-field-repo-branch { margin-top: 0; }
.agent-origins {
	margin: 10px 0 14px;
	padding: 12px 14px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: #f6f7fb;
}
.agent-origins-title {
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: 700;
	color: var(--text);
}
.agent-origin-row {
	display: block;
	margin: 12px 0 0;
	padding-top: 10px;
	border-top: 1px solid var(--line);
}
.agent-origin-label {
	display: block;
	margin: 6px 0 0;
	font-size: 13px;
	font-weight: 600;
}
.agent-origin-label .agent-origin-branch,
.agent-origin-label select,
.agent-origin-label input {
	display: block;
	width: 100%;
	max-width: 22rem;
	margin-top: 4px;
}
.agent-origin-url {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 13px;
	font-weight: 500;
}
.mt-run-auto {
	margin: 0;
	padding: 10px 16px 12px;
	border-top: 1px solid var(--line);
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
	box-sizing: border-box;
}
.mt-run-auto label {
	display: block;
	font-size: 13px;
	color: var(--muted);
	margin: 0;
}
.mt-run-auto .hint {
	margin: 0;
}
.mt-run-auto select,
.mt-run-auto .tt-select,
.mt-run-auto .btn-primary {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	flex: none;
}
.mt-run-auto .btn-primary {
	margin: 0;
	text-align: center;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}
.mt-run-auto .btn-primary.is-working {
	cursor: wait;
}
.mt-git-meta {
	margin: 12px 0 0;
	font-size: 12px;
	color: var(--muted);
	line-height: 1.45;
}
.mt-git-meta .mt-git-repo {
	margin-top: 6px;
}
.mt-git-meta .mt-git-repo-name {
	color: var(--text);
	font-weight: 600;
}
.mt-blocked-banner::before {
	content: '';
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
	margin-top: 1px;
	background: #e5484d;
	clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
}
.mt-color-wrap { position: relative; }
.mt-color-btn {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px var(--line);
	cursor: pointer;
	padding: 0;
}
.mt-color-drop { min-width: 196px; padding: 10px; }
.mt-assignee { position: relative; display: flex; align-items: center; gap: 8px; }
.mt-av, .mt-icon {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 1px solid var(--line);
	background: #f4f5f8;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
}
.mt-av {
	background: var(--primary);
	color: #fff;
	border-color: transparent;
}
.mt-av.is-ai {
	background: var(--ai-avatar);
}
.mt-av.is-empty {
	background: #f4f5f8;
	color: var(--muted);
	border-color: var(--line);
}
.mt-icon { color: var(--muted); }
.mt-icon.is-on { background: #e8f0ff; color: #4c8dff; border-color: #4c8dff; }
.mt-assignee-name {
	border: 0;
	background: transparent;
	cursor: pointer;
	font: inherit;
	color: var(--muted);
}
.mt-bar-spacer { flex: 1; }
.mt-more-wrap { position: relative; }
.mt-dropdown {
	position: absolute;
	top: 40px;
	left: 0;
	z-index: 5;
	background: var(--select-panel);
	border: 1px solid var(--select-border);
	border-radius: var(--select-radius);
	box-shadow: none;
	min-width: 200px;
	padding: 8px;
}
.mt-dropdown-right { left: auto; right: 0; }
.mt-drop-item {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	border: 0;
	background: transparent;
	padding: 8px 10px;
	border-radius: 10px;
	cursor: pointer;
	text-align: left;
	font: inherit;
}
.mt-drop-item:hover { background: rgba(255,255,255,.7); }
.mt-drop-item.danger { color: #c0392b; }
.mt-task-body {
	display: grid;
	grid-template-columns: 1fr 280px;
	flex: 1;
	min-height: 0;
}
.mt-task-main {
	padding: 18px 24px 20px;
	overflow-x: hidden;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
}
.mt-task-side {
	border-left: 1px solid var(--line);
	padding: 8px 0 72px;
	overflow: auto;
}
/* Small glass: stacked single scroll; labeled Close centered at bottom of the card. */
@media (max-width: 800px) {
	#task-modal .mt-close {
		left: 50%;
		right: auto;
		transform: translateX(-50%);
		bottom: 12px;
	}
	#task-modal #task-modal-body {
		overflow-x: hidden;
		overflow-y: auto;
	}
	#task-modal .mt-task {
		max-height: none;
		flex: 0 0 auto;
	}
	#task-modal .mt-task-body {
		display: flex;
		flex-direction: column;
		flex: 0 0 auto;
		min-height: 0;
		overflow: visible;
	}
	#task-modal .mt-task-main,
	#task-modal .mt-task-side {
		overflow: visible;
		flex: 0 0 auto;
	}
	#task-modal .mt-task-side {
		border-left: 0;
		border-top: 1px solid var(--line);
		padding-bottom: 80px;
	}
	#task-modal .mt-task-main {
		padding-bottom: 24px;
	}
	#task-modal .mt-task-bar {
		flex-wrap: wrap;
	}
}
.mt-tag-banners { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 0; flex-shrink: 0; }
.mt-banner {
	color: #fff;
	font-style: normal;
	font-size: 11px;
	padding: 3px 8px;
	border-radius: 999px;
}
.mt-title {
	margin: 0 0 8px;
	font-size: 28px;
	font-weight: 700;
	outline: none;
	line-height: 1.2;
	flex-shrink: 0;
}
.mt-desc {
	min-height: 72px;
	max-height: 180px;
	overflow-y: auto;
	color: var(--text);
	outline: none;
	margin-bottom: 16px;
	white-space: pre-wrap;
	border: 1px solid var(--line);
	border-radius: 14px;
	padding: 12px 14px;
	cursor: text;
	flex-shrink: 0;
	transition: border-color .15s ease, box-shadow .15s ease;
	scrollbar-width: thin;
	scrollbar-color: #c5cad6 transparent;
}
.mt-desc:focus {
	border-color: #4c8dff;
	box-shadow: 0 0 0 3px rgba(76, 141, 255, .22);
}
.mt-desc:empty:before {
	content: attr(data-placeholder);
	color: #b0b6c3;
}
.mt-ac { margin: 8px 0 12px; flex-shrink: 0; }
.mt-ac-row {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	width: 100%;
	margin: 4px 0;
	padding: 4px 0;
	font-size: 14px;
	color: var(--text);
}
.mt-ac-toggle {
	border: 0;
	background: transparent;
	padding: 0;
	cursor: pointer;
	color: inherit;
	flex-shrink: 0;
	margin-top: 5px;
}
.mt-ac-mark {
	width: 26px;
	height: 26px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	font-size: 22px;
	line-height: 1;
}
.mt-ac-open { color: #c5cad6; }
.mt-ac-done { color: #2ecc71; display: none; }
.mt-ac-row.is-done .mt-ac-open { display: none; }
.mt-ac-row.is-done .mt-ac-done { display: inline-block; }
.mt-ac-row.is-done textarea.mt-ac-text {
	color: var(--muted);
	text-decoration: line-through;
}
.mt-ac-row.is-draft .mt-ac-toggle {
	visibility: hidden;
	pointer-events: none;
}
.mt-ac-row .mt-row-remove {
	margin-top: 8px;
}
textarea.mt-ac-text {
	flex: 1;
	min-width: 0;
	min-height: 36px;
	height: 36px;
	resize: none;
	overflow: hidden;
	outline: none;
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 8px 10px;
	font: inherit;
	line-height: 1.35;
	color: var(--text);
	background: #fff;
	box-sizing: border-box;
	transition: border-color .15s ease, box-shadow .15s ease;
}
textarea.mt-ac-text:hover {
	border-color: #c5cad6;
}
textarea.mt-ac-text:focus {
	border-color: #4c8dff;
	box-shadow: 0 0 0 3px rgba(76, 141, 255, .22);
}
textarea.mt-ac-text[readonly] {
	background: #f7f8fb;
	cursor: default;
}
.mt-ac-text {
	flex: 1;
	min-width: 0;
	outline: none;
}
.mt-row-remove {
	border: 0;
	background: transparent;
	color: var(--muted);
	cursor: pointer;
	padding: 0;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	flex-shrink: 0;
}
.mt-row-remove:hover { color: #c0392b; }
.mt-playbooks { margin: 4px 0 12px; flex-shrink: 0; }
.mt-playbooks h3 { margin: 12px 0 6px; font-size: 15px; }
.mt-playbooks .mt-add-form select,
.mt-playbook-select {
	min-width: 220px;
}
.mt-files { list-style: none; padding: 0; margin: 8px 0 16px; font-size: 13px; flex-shrink: 0; }
.mt-add-link {
	border: 0;
	background: transparent;
	color: #4c8dff;
	cursor: pointer;
	padding: 0;
	font: inherit;
	font-weight: 600;
	flex-shrink: 0;
	align-self: flex-start;
}
.mt-add-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-top: 8px; }
.mt-add-form input,
.mt-add-form textarea {
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 10px 12px;
	font: inherit;
	min-width: 220px;
	flex: 1 1 220px;
	background: #fff;
	color: var(--text);
	transition: border-color .15s ease, box-shadow .15s ease;
}
.mt-add-form textarea {
	resize: vertical;
	min-height: 52px;
	line-height: 1.4;
}
.mt-add-form input:focus,
.mt-add-form textarea:focus {
	outline: none;
	border-color: #4c8dff;
	box-shadow: 0 0 0 3px rgba(76, 141, 255, .22);
}
.mt-activity {
	flex: 0 0 auto;
	min-height: 160px;
	display: flex;
	flex-direction: column;
	overflow: visible;
}
.mt-activity h3 { margin: 16px 0 8px; font-size: 15px; flex-shrink: 0; }
.mt-activity-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	flex-shrink: 0;
}
.mt-activity-head h3 { margin: 16px 0 8px; }
.mt-activity-toggle {
	background: none;
	border: 0;
	padding: 0;
	color: var(--primary);
	cursor: pointer;
	font-size: 12px;
	font-weight: 600;
}
.mt-activity-toggle:hover { text-decoration: underline; }
.block-reason-input {
	width: 100%;
	min-height: 72px;
	margin-top: 8px;
	padding: 8px 10px;
	border: 1px solid var(--line);
	border-radius: 12px;
	box-sizing: border-box;
	font: inherit;
	resize: vertical;
}
.mt-composer { position: relative; flex-shrink: 0; }
.mt-composer textarea {
	width: 100%;
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 10px 44px 10px 12px;
	font: inherit;
	resize: vertical;
	min-height: 52px;
}
.mt-push {
	position: absolute;
	right: 8px;
	bottom: 8px;
	width: 28px;
	height: 28px;
	border: 0;
	border-radius: 50%;
	background: #4c8dff;
	color: #fff;
	cursor: pointer;
}
.mt-feed {
	margin-top: 12px;
	flex: 0 0 auto;
	min-height: 0;
	overflow: visible;
	padding-right: 6px;
}
.mt-feed::-webkit-scrollbar,
.mt-desc::-webkit-scrollbar {
	width: 8px;
}
.mt-feed::-webkit-scrollbar-track,
.mt-desc::-webkit-scrollbar-track {
	background: transparent;
}
.mt-feed::-webkit-scrollbar-thumb,
.mt-desc::-webkit-scrollbar-thumb {
	background: #c5cad6;
	border-radius: 999px;
}
.mt-feed::-webkit-scrollbar-thumb:hover,
.mt-desc::-webkit-scrollbar-thumb:hover {
	background: #a8b0c0;
}
.mt-feed-item { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.mt-feed-item p { margin: 4px 0 0; }
.mt-feed-system { color: var(--muted); }
.mt-when { font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.mt-side-row { border-bottom: 1px solid var(--line); }
.mt-side-row summary {
	list-style: none;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	cursor: pointer;
	color: var(--muted);
}
.mt-side-row summary::-webkit-details-marker { display: none; }
.mt-side-row summary span { margin-left: auto; color: var(--text); font-size: 12px; }
.mt-watch-avs { display: inline-flex; gap: 4px; margin-left: 6px; }
.mt-side-body { padding: 0 16px 12px; display: flex; flex-direction: column; gap: 6px; }
.mt-check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.mt-status-hint { padding: 12px 16px; color: var(--muted); font-size: 12px; }
.mt-side-row input[type="date"],
.mt-side-row input[type="number"] {
	margin: 0 16px 12px;
	padding: 8px;
	border: 1px solid var(--line);
	border-radius: 10px;
}
.mt-side-row input[type="date"] {
	width: 13.5rem;
	max-width: calc(100% - 32px);
	padding-right: 2.25rem;
}
.mt-side-row input[type="number"] {
	width: calc(100% - 32px);
}
.archive-results { display: flex; flex-direction: column; gap: 8px; }
.archive-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	text-align: left;
	border: 1px solid var(--line);
	background: #fff;
	padding: 12px 16px;
	border-radius: 12px;
	cursor: pointer;
}
.archive-row:hover { border-color: var(--primary); }

select:not([multiple]) {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	margin: 0;
	border: 1px solid var(--select-border);
	border-radius: var(--select-radius);
	background-color: var(--select-trigger);
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%236b7385' d='M1.2 1.3L6 6.1l4.8-4.8 1.2 1.2L6 8.4 0 2.5z'/></svg>");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 12px 8px;
	padding: 10px 38px 10px 14px;
	color: var(--text);
	font: inherit;
	font-size: 14px;
	line-height: 1.35;
	cursor: pointer;
}
select:not([multiple]):hover,
select:not([multiple]):focus {
	border-color: #9aa3b5;
	outline: none;
}
select:not([multiple]):disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.tt-select {
	position: relative;
	display: block;
	width: 100%;
	min-width: 0;
}
.tt-select-native {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	border: 0 !important;
	opacity: 0 !important;
	pointer-events: none !important;
	background: none !important;
}
.tt-select-trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	min-height: 42px;
	padding: 9px 14px;
	border: 1px solid var(--select-border);
	border-radius: var(--select-radius);
	background: var(--select-trigger);
	color: var(--text);
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.35;
	text-align: left;
	cursor: pointer;
}
.tt-select-trigger:hover,
.tt-select-trigger:focus {
	border-color: #9aa3b5;
	outline: none;
}
.tt-select-trigger:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}
.tt-select-label {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.tt-select-caret {
	flex-shrink: 0;
	font-size: 11px;
	color: var(--muted);
	transition: transform .15s ease;
}
.tt-select.is-open .tt-select-caret {
	transform: rotate(180deg);
}
.tt-select-panel {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 6px);
	z-index: 12000;
	max-height: 216px;
	overflow: auto;
	padding: 8px;
	background: var(--select-panel);
	border: 1px solid var(--select-border);
	border-radius: var(--select-radius);
	box-shadow: none;
}
.tt-select-panel[hidden] { display: none; }
.tt-select.is-up .tt-select-panel {
	top: auto;
	bottom: calc(100% + 6px);
}
.tt-select-option {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-height: 40px;
	border: 0;
	background: transparent;
	padding: 8px 10px;
	border-radius: 10px;
	color: var(--text);
	font: inherit;
	font-size: 14px;
	text-align: left;
	cursor: pointer;
}
.tt-select-option:hover,
.tt-select-option.is-active {
	background: rgba(255,255,255,.72);
}
.tt-select-dot {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #d4d8e0;
	flex-shrink: 0;
}
.tt-select-option.is-active .tt-select-dot {
	background: var(--primary);
}
.tt-select-option-text {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}
.mt-run-auto .tt-select {
	width: 100%;
	max-width: 100%;
	flex: none;
}
.mt-add-form .tt-select,
.agent-repo-line .tt-select {
	flex: 1;
	width: auto;
	min-width: 160px;
}
.env-repo-line .env-repo-head .tt-select,
.env-repo-line .env-field-repo-branch .tt-select {
	flex: none;
	width: 100%;
	min-width: 0;
}
.mt-add-form .tt-select {
	max-width: 280px;
}
.account-switch .tt-select {
	margin-top: 4px;
}




