:root {
	color-scheme: dark;
	font-family:
		"gg sans", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo,
		sans-serif;
	background: #1e1f22;
	color: #f2f3f5;
	font-synthesis: none;
	text-rendering: optimizeLegibility;
	--rail: #1e1f22;
	--sidebar: #2b2d31;
	--chat: #313338;
	--chat-raised: #383a40;
	--chat-hover: #2e3035;
	--input: #383a40;
	--border: rgba(4, 4, 5, 0.28);
	--text: #f2f3f5;
	--muted: #b5bac1;
	--subtle: #949ba4;
	--faint: #6d727b;
	--brand: #5865f2;
	--green: #23a559;
	--yellow: #f0b232;
	--pink: #eb459e;
}

* {
	box-sizing: border-box;
}

html,
body {
	width: 100%;
	min-width: 320px;
	height: 100%;
	min-height: 100%;
	margin: 0;
	background: var(--rail);
	color: var(--text);
}

body {
	overflow: hidden;
}

button,
input,
a {
	font: inherit;
}

button,
a {
	-webkit-tap-highlight-color: transparent;
}

button {
	cursor: pointer;
}

button:disabled {
	cursor: default;
}

:focus-visible {
	outline: 2px solid #00aff4;
	outline-offset: 2px;
}

.discord-app {
	display: grid;
	grid-template-columns: 72px 240px minmax(0, 1fr);
	width: 100%;
	height: 100vh;
	min-height: 500px;
	background: var(--chat);
}

.server-rail {
	display: flex;
	align-items: center;
	flex-direction: column;
	gap: 8px;
	padding: 12px 0;
	background: var(--rail);
}

.server-rail__server {
	display: grid;
	position: relative;
	width: 48px;
	height: 48px;
	place-items: center;
	border: 0;
	border-radius: 16px;
	background: var(--sidebar);
	color: var(--muted);
	font-size: 1.2rem;
	font-weight: 800;
	text-decoration: none;
	transition:
		border-radius 150ms ease,
		background-color 150ms ease,
		color 150ms ease;
}

.server-rail__server::before {
	position: absolute;
	top: 50%;
	left: -12px;
	width: 4px;
	height: 0;
	border-radius: 0 4px 4px 0;
	background: var(--text);
	content: "";
	transform: translateY(-50%);
	transition: height 150ms ease;
}

.server-rail__server:hover,
.server-rail__server:focus-visible {
	border-radius: 14px;
	background: var(--brand);
	color: #fff;
}

.server-rail__server:hover::before,
.server-rail__server:focus-visible::before,
.server-rail__server--active::before {
	height: 40px;
}

.server-rail__server--active {
	border-radius: 14px;
	background: var(--brand);
	color: #fff;
}

.server-rail__divider {
	display: block;
	width: 32px;
	height: 1px;
	margin: 2px 0;
	background: #35363c;
}

.server-rail__server--add {
	background: var(--sidebar);
	color: var(--green);
	font-size: 1.45rem;
}

.server-rail__server--add:hover {
	background: var(--green);
	color: #fff;
}

.channel-sidebar {
	display: flex;
	min-width: 0;
	flex-direction: column;
	border-right: 1px solid var(--border);
	background: var(--sidebar);
}

.server-header {
	display: flex;
	height: 52px;
	align-items: center;
	justify-content: space-between;
	padding: 0 16px;
	border-bottom: 1px solid var(--border);
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.server-header__name {
	overflow: hidden;
	color: var(--text);
	font-size: 0.9rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.server-header__chevron {
	color: var(--muted);
	font-size: 1.15rem;
	line-height: 1;
}

.channel-nav {
	flex: 1;
	padding: 18px 8px 12px;
	overflow-y: auto;
}

.channel-category {
	margin: 0 8px 5px;
	color: var(--subtle);
	font-size: 0.68rem;
	font-weight: 800;
	letter-spacing: 0.04em;
	line-height: 1.4;
	text-transform: uppercase;
}

.channel-category:not(:first-child) {
	margin-top: 22px;
}

.channel-link {
	display: flex;
	min-height: 34px;
	align-items: center;
	gap: 7px;
	margin: 1px 0;
	padding: 0 8px;
	border-radius: 4px;
	color: var(--subtle);
	font-size: 0.86rem;
	font-weight: 500;
	text-decoration: none;
	transition:
		background-color 120ms ease,
		color 120ms ease;
}

.channel-link:hover,
.channel-link:focus-visible {
	background: #35373c;
	color: var(--text);
}

.channel-link--active {
	background: #404249;
	color: var(--text);
	font-weight: 650;
}

.channel-link__hash {
	color: var(--faint);
	font-size: 1.35rem;
	font-weight: 400;
	line-height: 0.8;
}

.channel-link--active .channel-link__hash {
	color: var(--muted);
}

.sidebar-note {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 58px;
	margin-top: auto;
	padding: 8px 14px;
	background: #232428;
	color: var(--muted);
}

.sidebar-note__dot,
.mock-badge__dot {
	width: 8px;
	height: 8px;
	flex: 0 0 auto;
	border-radius: 50%;
	background: var(--green);
	box-shadow: 0 0 0 3px rgba(35, 165, 89, 0.12);
}

.sidebar-note strong,
.sidebar-note span {
	display: block;
}

.sidebar-note strong {
	color: var(--text);
	font-size: 0.72rem;
	line-height: 1.4;
}

.sidebar-note div span {
	margin-top: 2px;
	color: var(--subtle);
	font-size: 0.62rem;
	line-height: 1.4;
}

.chat-app {
	display: flex;
	min-width: 0;
	min-height: 0;
	flex-direction: column;
	background: var(--chat);
}

.chat-state[hidden],
.chat-timeline[hidden],
.week-chip[hidden] {
	display: none;
}

.channel-header {
	display: flex;
	min-height: 52px;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	padding: 0 24px;
	border-bottom: 1px solid var(--border);
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.channel-header__identity,
.channel-header__meta {
	display: flex;
	align-items: center;
}

.channel-header__identity {
	min-width: 0;
	gap: 10px;
}

.channel-header__hash {
	color: var(--faint);
	font-size: 1.7rem;
	font-weight: 400;
	line-height: 1;
}

.channel-header h1 {
	overflow: hidden;
	margin: 0;
	color: var(--text);
	font-size: 0.98rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	line-height: 1.4;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.channel-header p {
	margin: 2px 0 0;
	overflow: hidden;
	color: var(--subtle);
	font-size: 0.66rem;
	line-height: 1.35;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.channel-header__meta {
	flex: 0 0 auto;
	gap: 12px;
}

.week-chip,
.mock-badge {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	white-space: nowrap;
}

.week-chip {
	padding: 5px 8px;
	border: 1px solid rgba(88, 101, 242, 0.45);
	border-radius: 4px;
	background: rgba(88, 101, 242, 0.13);
	color: #c9cdfb;
	font-size: 0.65rem;
	font-weight: 650;
}

.week-chip__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #7f8cff;
}

.mock-badge {
	color: var(--subtle);
	font-size: 0.68rem;
	font-weight: 600;
}

.channel-intro {
	display: flex;
	max-width: 980px;
	align-items: flex-start;
	gap: 12px;
	margin: 20px auto 0;
	padding: 13px 15px;
	border: 1px solid rgba(88, 101, 242, 0.2);
	border-radius: 6px;
	background: rgba(35, 37, 42, 0.58);
}

.channel-intro__icon {
	width: 24px;
	height: 24px;
	flex: 0 0 auto;
	border-radius: 50%;
	background: rgba(88, 101, 242, 0.2);
	color: #9ba5ff;
	font-size: 0.9rem;
	line-height: 24px;
	text-align: center;
}

.channel-intro strong {
	display: block;
	color: var(--text);
	font-size: 0.8rem;
	line-height: 1.5;
}

.channel-intro p {
	max-width: 820px;
	margin: 3px 0 0;
	color: var(--muted);
	font-size: 0.74rem;
	line-height: 1.65;
}

.chat-scroll {
	min-height: 0;
	flex: 1;
	overflow-y: auto;
	padding: 6px 24px 28px;
	scroll-behavior: smooth;
	scrollbar-color: #1f2023 transparent;
	scrollbar-width: thin;
}

.chat-scroll::-webkit-scrollbar,
.channel-nav::-webkit-scrollbar {
	width: 8px;
}

.chat-scroll::-webkit-scrollbar-thumb,
.channel-nav::-webkit-scrollbar-thumb {
	border: 2px solid transparent;
	border-radius: 8px;
	background: #1f2023;
	background-clip: padding-box;
}

.chat-timeline {
	max-width: 980px;
	margin: 0 auto;
}

.topic-block {
	padding: 22px 8px 12px;
}

.topic-block + .topic-block {
	margin-top: 14px;
	border-top: 1px solid rgba(148, 155, 164, 0.16);
	padding-top: 30px;
}

.topic-block--recommended {
	border-left: 2px solid rgba(240, 178, 50, 0.62);
	padding-left: 18px;
}

.topic-divider {
	display: flex;
	align-items: center;
	gap: 11px;
	margin: 0 0 17px;
}

.topic-divider__line {
	height: 1px;
	flex: 1;
	background: rgba(148, 155, 164, 0.17);
}

.topic-divider__label {
	color: var(--faint);
	font-size: 0.62rem;
	font-weight: 750;
	letter-spacing: 0.12em;
	white-space: nowrap;
}

.topic-block__pinned {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px 9px;
	margin: 0 0 18px;
	padding: 8px 11px;
	border-radius: 4px;
	background: rgba(240, 178, 50, 0.08);
	color: var(--muted);
	font-size: 0.7rem;
	line-height: 1.5;
}

.topic-block__pinned-icon {
	font-size: 0.83rem;
}

.topic-block__pinned-title {
	color: #f7d77f;
	font-weight: 700;
}

.topic-block__pinned-copy {
	color: var(--subtle);
}

.topic-block__heading {
	display: grid;
	grid-template-columns: 42px minmax(0, 1fr);
	gap: 12px;
	align-items: start;
}

.topic-block__hash {
	display: grid;
	width: 42px;
	height: 42px;
	place-items: center;
	border-radius: 50%;
	background: #404249;
	color: #b5bac1;
	font-size: 1.45rem;
	font-weight: 400;
}

.topic-block__heading-copy {
	min-width: 0;
}

.topic-block__title {
	margin: 0;
	color: var(--text);
	font-size: clamp(1rem, 1.8vw, 1.22rem);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.4;
	word-break: break-word;
}

.topic-block__summary {
	max-width: 760px;
	margin: 4px 0 0;
	color: var(--muted);
	font-size: 0.82rem;
	line-height: 1.7;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.topic-block__privacy-note {
	margin: 12px 0 15px 54px;
	color: var(--faint);
	font-size: 0.65rem;
	line-height: 1.5;
}

.chat-message-list {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.chat-message {
	display: grid;
	grid-template-columns: 40px minmax(0, 1fr);
	gap: 13px;
	min-width: 0;
	margin-left: 0;
	padding: 4px 8px;
	border-radius: 4px;
	transition: background-color 120ms ease;
}

.chat-message:hover {
	background: var(--chat-hover);
}

.chat-message__avatar {
	display: grid;
	width: 40px;
	height: 40px;
	place-items: center;
	border-radius: 50%;
	background: #5865f2;
	color: #fff;
	font-size: 0.9rem;
	font-weight: 750;
}

.chat-message:nth-child(3n + 2) .chat-message__avatar {
	background: #3ba55d;
}

.chat-message:nth-child(3n) .chat-message__avatar {
	background: #eb459e;
}

.chat-message__body {
	min-width: 0;
	padding: 1px 0 3px;
}

.chat-message__meta {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 8px;
	line-height: 1.4;
}

.chat-message__speaker {
	color: var(--text);
	font-size: 0.82rem;
	font-weight: 700;
}

.chat-message__timestamp {
	color: var(--subtle);
	font-size: 0.64rem;
	font-variant-numeric: tabular-nums;
}

.chat-message__content {
	margin: 2px 0 0;
	color: #dbdee1;
	font-size: 0.87rem;
	line-height: 1.7;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.topic-block__no-messages {
	margin: 0 0 0 54px;
	padding: 11px 13px;
	border-radius: 4px;
	background: rgba(35, 37, 42, 0.6);
	color: var(--subtle);
	font-size: 0.76rem;
}

.chat-state {
	display: flex;
	min-height: 250px;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin: 18px auto;
	padding: 24px;
	border-radius: 6px;
	text-align: center;
}

.chat-state--loading {
	color: var(--muted);
	font-size: 0.85rem;
}

.chat-state--error,
.chat-state--empty {
	max-width: 620px;
	justify-content: flex-start;
	border: 1px solid rgba(148, 155, 164, 0.14);
	background: rgba(35, 37, 42, 0.58);
	text-align: left;
}

.chat-state__icon {
	display: grid;
	width: 42px;
	height: 42px;
	flex: 0 0 auto;
	place-items: center;
	border-radius: 50%;
	font-size: 1.15rem;
	font-weight: 800;
}

.chat-state__icon--error {
	background: rgba(237, 66, 69, 0.16);
	color: #f38688;
}

.chat-state__icon--empty {
	background: rgba(88, 101, 242, 0.16);
	color: #aeb6ff;
}

.chat-state__copy h2 {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.5;
}

.chat-state__copy p {
	margin: 5px 0 15px;
	color: var(--muted);
	font-size: 0.78rem;
	line-height: 1.65;
}

.retry-button {
	padding: 7px 12px;
	border: 0;
	border-radius: 3px;
	background: var(--brand);
	color: #fff;
	font-size: 0.75rem;
	font-weight: 650;
	transition: background-color 120ms ease;
}

.retry-button:hover {
	background: #4752c4;
}

.composer {
	display: flex;
	min-inline-size: 0;
	min-height: 68px;
	align-items: center;
	gap: 10px;
	padding: 10px 24px 18px;
	border: 0;
	background: var(--chat);
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	border: 0;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

.composer__plus {
	display: grid;
	width: 24px;
	height: 24px;
	flex: 0 0 auto;
	place-items: center;
	border-radius: 50%;
	background: var(--muted);
	color: var(--input);
	font-size: 1.15rem;
	line-height: 1;
}

.composer__input {
	min-width: 0;
	height: 44px;
	flex: 1;
	padding: 0 13px;
	border: 0;
	border-radius: 8px;
	outline: 0;
	background: var(--input);
	color: var(--subtle);
	font-size: 0.79rem;
	text-overflow: ellipsis;
}

.composer__input:focus {
	box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.45);
}

.composer__hint {
	padding-right: 7px;
	color: var(--faint);
	font-size: 0.65rem;
	white-space: nowrap;
}

.loading-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(148, 155, 164, 0.25);
	border-top-color: #aeb6ff;
	border-radius: 50%;
	animation: spin 760ms linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

@media (max-width: 900px) {
	.discord-app {
		grid-template-columns: 60px minmax(0, 1fr);
	}

	.channel-sidebar {
		display: none;
	}

	.server-rail__server {
		width: 42px;
		height: 42px;
	}

	.server-rail__server::before {
		left: -9px;
	}

	.server-rail__server:hover::before,
	.server-rail__server:focus-visible::before,
	.server-rail__server--active::before {
		height: 34px;
	}

	.channel-intro,
	.chat-timeline {
		max-width: none;
	}
}

@media (max-width: 600px) {
	body {
		overflow: auto;
	}

	.discord-app {
		display: block;
		height: 100dvh;
		min-height: 500px;
	}

	.server-rail {
		display: none;
	}

	.channel-header {
		min-height: 58px;
		padding: 0 15px;
	}

	.channel-header__meta {
		gap: 8px;
	}

	.mock-badge {
		font-size: 0.6rem;
	}

	.channel-intro {
		margin: 12px 12px 0;
		padding: 11px 12px;
	}

	.channel-intro p {
		font-size: 0.7rem;
	}

	.chat-scroll {
		padding: 3px 12px 20px;
	}

	.topic-block {
		padding-right: 2px;
		padding-left: 2px;
	}

	.topic-block + .topic-block {
		padding-top: 24px;
	}

	.topic-block--recommended {
		padding-left: 12px;
	}

	.topic-block__privacy-note,
	.topic-block__no-messages {
		margin-left: 47px;
	}

	.composer {
		min-height: 64px;
		padding: 8px 12px 14px;
	}

	.composer__hint {
		display: none;
	}
}

@media (max-width: 420px) {
	.channel-header__hash {
		font-size: 1.45rem;
	}

	.channel-header p,
	.week-chip {
		display: none;
	}

	.channel-intro__icon {
		width: 21px;
		height: 21px;
		font-size: 0.78rem;
		line-height: 21px;
	}

	.channel-intro strong {
		font-size: 0.74rem;
	}

	.chat-message {
		grid-template-columns: 34px minmax(0, 1fr);
		gap: 10px;
		padding-right: 2px;
		padding-left: 2px;
	}

	.chat-message__avatar {
		width: 34px;
		height: 34px;
		font-size: 0.78rem;
	}

	.topic-block__heading {
		grid-template-columns: 36px minmax(0, 1fr);
		gap: 10px;
	}

	.topic-block__hash {
		width: 36px;
		height: 36px;
		font-size: 1.2rem;
	}

	.topic-block__privacy-note,
	.topic-block__no-messages {
		margin-left: 46px;
	}

	.composer__input {
		font-size: 0.72rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.server-rail__server,
	.channel-link,
	.chat-message,
	.retry-button,
	.loading-spinner {
		transition: none;
		animation: none;
	}

	.chat-scroll {
		scroll-behavior: auto;
	}
}
