/* Layout and Grid */
.page {
width: min(1120px, 94vw);
margin: 0 auto;
padding: 96px 0 48px 0;
display: grid;
gap: 18px;
}

.layout {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
gap: 18px;
align-items: start;
}

.layout-tiling {
grid-template-columns: repeat(2, minmax(0, 1fr));
align-items: stretch;
}

.tile {
min-width: 0;
height: 100%;
}

.tile-term {
grid-column: 1;
grid-row: 1;
}

.tile-specs {
grid-column: 2;
grid-row: 1;
}

.tile-kitty {
grid-column: 1;
grid-row: 2;
}

.tile-playlists {
grid-column: 2;
grid-row: 2;
}

@media (max-width: 900px) {
.layout {
grid-template-columns: 1fr;
}

.layout-tiling {
grid-template-columns: 1fr;
}

.tile-term,
.tile-specs,
.tile-kitty,
.tile-playlists {
grid-column: 1;
grid-row: auto;
}
}

/* Card Styling */
.card {
background: var(--s-w-04);
border: 1px solid var(--s-w-12);
border-radius: 16px;
padding: 18px;
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.card.window {
overflow: hidden;
padding: 0;
display: flex;
flex-direction: column;
height: 100%;
border-radius: 16px;
}

.window-body {
padding: 18px;
flex: 1;
}

.window-body > :first-child {
margin-top: 0;
}

.window-body > :last-child {
margin-bottom: 0;
}

/* Typography */
.card p,
.card li,
.card dd {
color: var(--text);
opacity: 0.92;
line-height: 1.55;
}

a {
color: var(--accent);
text-decoration: underline;
text-decoration-thickness: 2px;
text-underline-offset: 3px;
}

a:hover {
filter: brightness(1.1);
}

/* Terminal Window */
.term {
padding: 0;
overflow: hidden;
}

.window-bar {
padding: 12px 18px;
display: flex;
align-items: center;
gap: 8px;
background: var(--s-w-06);
flex-wrap: wrap;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
}

.window-bar .window-title {
margin-left: 6px;
margin-right: auto;
}

.window-bar .dot.red {
order: 3;
}

.window-bar .dot.yellow {
order: 2;
}

.window-bar .dot.green {
order: 1;
}

.window-title {
font-family: var(--font-accent);
font-size: 0.9rem;
color: var(--muted);
margin-left: 6px;
}

.window-title.accent {
color: var(--accent);
}

.kitty-terminal {
margin: 0;
white-space: pre;
font-family: 'MapleMono NF', var(--font-main), monospace;
font-size: 1.05rem;
line-height: 1.4;
text-align: center;
color: var(--text);
padding: 6px 0 2px;
}

.dot {
width: 10px;
height: 10px;
border-radius: 50%;
opacity: 0.9;
}

.dot.red {
background: #f38ba8;
}

.dot.yellow {
background: #f9e2af;
}

.dot.green {
background: #a6e3a1;
}

.term-body {
margin: 0;
padding: 14px 14px;
font-family: var(--font-main);
font-size: 0.95rem;
line-height: 1.45;
color: var(--text);
white-space: pre;
overflow-x: auto;
}

.kitty-window-body {
display: grid;
place-items: center;
}

/* Side Shell / Tab Panel */
.side-shell {
padding: 0;
overflow: hidden;
border-radius: 16px;
display: flex;
flex-direction: column;
height: 100%;
background: var(--s-w-04);
border: 1px solid var(--s-w-12);
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.panel-bar {
display: flex;
align-items: center;
gap: 8px;
padding: 10px 16px;
background: var(--s-w-06);
border-bottom: 1px solid var(--s-w-08);
}

.panel-tabs {
flex: 1;
overflow-x: auto;
overflow-y: hidden;
scrollbar-width: none;
-ms-overflow-style: none;
}

.panel-tabs::-webkit-scrollbar {
display: none;
}

.panel-tabs-track {
display: inline-flex;
align-items: center;
gap: 6px;
min-width: max-content;
}

.tab-nav {
border: 0;
background: var(--s-w-08);
color: var(--text);
width: 32px;
height: 32px;
border-radius: 8px;
cursor: pointer;
font-size: 1.1rem;
line-height: 1;
display: grid;
place-items: center;
transition: opacity 120ms ease, background 120ms ease;
}

.tab-nav:hover:not(:disabled) {
opacity: 0.9;
background: var(--s-w-14);
}

.tab-nav:disabled {
opacity: 0.25;
cursor: default;
}

.side-body {
padding: 14px;
flex: 1;
overflow-y: auto;
}

/* Tab Styling */
.tab {
border: 1px solid var(--s-w-12);
cursor: pointer;
padding: 7px 11px;
border-radius: 8px;
background: var(--s-w-06);
color: var(--text);
font-family: var(--font-accent);
font-weight: 700;
font-size: 0.9rem;
transition: background 120ms ease, border-color 120ms ease;
}

.tab:hover {
background: var(--s-w-08);
}

.tab.is-active {
border: 1px solid var(--accent);
background: var(--s-w-04);
color: var(--accent);
font-weight: 800;
}

/* Panel Content */
.panel {
display: none;
height: 100%;
}

.panel.is-active {
display: block;
}

.panel[hidden] {
display: none;
}

/* Key-Value Lists */
.kv {
list-style: none;
margin: 0;
padding: 0;
display: grid;
gap: 10px;
}

.kv li {
display: grid;
grid-template-columns: 110px 1fr;
gap: 12px;
}

.kv b {
color: var(--muted);
font-weight: 700;
}

.kv span {
color: var(--text);
}

@media (max-width: 520px) {
.kv li {
grid-template-columns: 1fr;
}

.kv b {
font-size: 0.9rem;
}
}

/* Playlist */
.plist {
list-style: none;
padding: 18px;
margin: 0;
display: grid;
gap: 10px;
}

.plist a {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 14px;
border-radius: 8px;
background: var(--s-w-06);
border: 1px solid var(--s-w-12);
text-decoration: none;
color: var(--text);
transition: background 120ms ease, border-color 120ms ease;
}

.plist a:hover {
background: var(--s-w-08);
}

.plist a::after {
content: '↗';
color: var(--muted);
}

/* Links */
.link-grid {
list-style: none;
margin: 0;
padding: 0;
display: grid;
gap: 12px;
}

.link-card {
display: grid;
grid-template-columns: auto 1fr auto;
align-items: center;
gap: 12px;
padding: 12px 14px;
border-radius: 8px;
background: var(--s-w-06);
border: 1px solid var(--s-w-12);
transition: background 120ms ease, border-color 120ms ease;
}

.link-card:hover {
background: var(--s-w-08);
}

.link-icon {
font-size: 1.2rem;
color: var(--accent);
}

.link-title {
font-family: var(--font-accent);
font-weight: 700;
color: var(--text);
}

.link-chip {
justify-self: end;
display: inline-flex;
align-items: center;
gap: 6px;
padding: 6px 12px;
border-radius: 6px;
background: var(--s-w-08);
color: var(--text);
text-decoration: none;
font-family: var(--font-accent);
font-size: 0.9rem;
overflow-wrap: anywhere;
transition: background 120ms ease;
}

.link-chip:hover {
background: var(--s-w-14);
}

.link-chip::after {
content: '↗';
color: var(--muted);
font-size: 0.85rem;
}

@media (max-width: 600px) {
.link-card {
grid-template-columns: auto 1fr;
grid-template-rows: auto auto;
}

.link-chip {
grid-column: 1 / -1;
justify-self: flex-start;
}
}
