/**
 * RoccOS Application Styles
 * Retro interiors: 2px borders, monospace, uppercase labels, hard shadows
 */

/* ── Shared App Layout ── */
.app-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  font-family: var(--font-system);
  color: var(--os-text);
  background: var(--os-surface);
}

.app-toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--os-surface-raised);
  border-bottom: 2px solid var(--os-border);
  flex-shrink: 0;
}

.app-body {
  flex: 1;
  overflow: auto;
  padding: var(--sp-4);
}

.app-sidebar {
  width: 180px;
  flex-shrink: 0;
  border-right: 2px solid var(--os-border);
  background: var(--os-bg-warm);
  padding: var(--sp-3);
  overflow-y: auto;
}

.app-split {
  display: flex;
  height: 100%;
}

/* ── Finder ── */
.finder-main {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ── Carousel ── */
.finder-carousel-wrapper {
  height: 100%;
  position: relative;
}

.finder-carousel {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
}

.finder-carousel-card {
  scroll-snap-align: start;
  width: 100%;
  height: 100%;
  min-height: 100%;
  position: relative;
  border: none;
  padding: 0;
  cursor: pointer;
  display: block;
  background: none;
  font-family: var(--font-system);
  text-align: left;
  flex-shrink: 0;
}

.finder-carousel-thumb {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.3s ease;
}

.finder-carousel-card:hover .finder-carousel-thumb {
  transform: scale(1.03);
}

.finder-carousel-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--sp-4) var(--sp-5);
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.finder-carousel-name {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.finder-carousel-role {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.8);
}

.finder-carousel-team {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.6);
  font-style: italic;
}

/* In-progress badge — carousel overlay */
.finder-carousel-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 3px;
  background: var(--os-accent, #F0A030);
  color: var(--os-bg, #0A0A0A);
  margin-top: 6px;
}

.finder-carousel-counter {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.5);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  pointer-events: none;
  z-index: 2;
}

.finder-phantom {
  pointer-events: none;
}

/* ── Finder Detail ── */
.finder-detail {
  padding: var(--sp-4) var(--sp-6);
  overflow-y: auto;
  height: 100%;
  box-sizing: border-box;
}

.finder-detail-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}

.finder-nav-back {
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--os-accent);
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-system);
}

.finder-nav-back:hover {
  text-decoration: underline;
}

.finder-nav-right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.finder-nav-prev,
.finder-nav-next {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--os-border);
  background: var(--os-surface-raised);
  color: var(--os-text);
  cursor: pointer;
  font-size: var(--text-sm);
  font-family: var(--font-system);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast), border-color var(--duration-fast);
  padding: 0;
}

.finder-nav-prev:hover,
.finder-nav-next:hover {
  background: var(--os-accent);
  border-color: var(--os-accent);
  color: var(--os-accent-text);
}

.finder-nav-count {
  font-size: var(--text-xs);
  color: var(--os-text-muted);
  min-width: 4ch;
  text-align: center;
}

/* ── Team Credit ── */
.finder-detail-team {
  font-size: var(--text-xs);
  color: var(--os-text-muted);
  font-style: italic;
  margin-top: var(--sp-1);
}

/* ── Process List ── */
.finder-process-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--sp-4);
}

.finder-process-list li {
  font-size: var(--text-sm);
  color: var(--os-text-secondary);
  line-height: var(--leading-normal);
  padding: var(--sp-1) 0;
  padding-left: var(--sp-4);
  position: relative;
}

.finder-process-list li::before {
  content: '\2022';
  position: absolute;
  left: var(--sp-1);
  color: var(--os-accent);
}

.finder-detail-header {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.finder-detail-img {
  width: 120px;
  height: 80px;
  border-radius: var(--radius-md);
  border: 2px solid var(--os-border);
  object-fit: cover;
}

.finder-detail-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  margin-bottom: var(--sp-1);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.finder-detail-role {
  font-size: var(--text-sm);
  color: var(--os-text-secondary);
}

.finder-detail-desc {
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--os-text-secondary);
  margin-bottom: var(--sp-4);
}

.finder-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}

.finder-stat {
  padding: var(--sp-3);
  background: var(--os-surface-raised);
  border: 2px solid var(--os-border-subtle);
  border-radius: var(--radius-md);
  text-align: center;
}

.finder-stat-value {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--os-accent);
}

.finder-stat-label {
  font-size: var(--text-xs);
  color: var(--os-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.finder-detail-link {
  display: inline-block;
  margin-top: var(--sp-4);
  padding: var(--sp-2) var(--sp-4);
  background: var(--os-accent);
  color: var(--os-accent-text);
  border: 2px solid var(--os-accent);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  box-shadow: var(--shadow-sm);
  transition: background var(--duration-fast);
}

.finder-detail-link:hover {
  background: var(--os-accent-hover);
  border-color: var(--os-accent-hover);
}

.finder-section-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--os-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: var(--sp-4);
  margin-bottom: var(--sp-1);
}
/* In-progress badge — detail view */
.finder-detail-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--os-accent, #F0A030);
  color: var(--os-bg, #0A0A0A);
  margin-left: 6px;
  vertical-align: middle;
}

.finder-detail-year {
  font-size: var(--text-xs);
  color: var(--os-text-muted);
  background: var(--os-surface-raised);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-top: var(--sp-1);
}
.finder-tech-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}
.finder-tech-pill {
  font-size: var(--text-xs);
  padding: 2px 10px;
  border: 1px solid var(--os-border);
  border-radius: 12px;
  color: var(--os-text-secondary);
}

/* ── Preview (Resume PDF Viewer) ── */
.preview-pdf-embed {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Typing cursor for type-in effect */
.typing-cursor::after {
  content: '\2588';
  animation: pulse 0.8s step-end infinite;
  color: var(--os-accent);
}

/* ── Mail (Contact) ── */
.mail-compose {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.mail-field {
  display: flex;
  align-items: center;
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 2px solid var(--os-border-subtle);
  font-size: var(--text-sm);
}

.mail-field-label {
  color: var(--os-text-muted);
  width: 60px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: var(--weight-bold);
  font-size: var(--text-xs);
}

.mail-field-input {
  flex: 1;
  border: none;
  background: none;
  color: var(--os-text);
  font-family: var(--font-system);
  font-size: var(--text-sm);
  outline: none;
}

.mail-body {
  flex: 1;
  padding: var(--sp-3);
}

.mail-body-textarea {
  width: 100%;
  height: 100%;
  border: none;
  background: none;
  color: var(--os-text);
  font-family: var(--font-system);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  resize: none;
  outline: none;
}

.mail-body-textarea::placeholder {
  color: var(--os-text-muted);
}

.mail-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: var(--sp-2) var(--sp-3);
  border-top: 2px solid var(--os-border);
}

.mail-send-btn {
  padding: var(--sp-2) var(--sp-5);
  border: 2px solid var(--os-accent);
  border-radius: var(--radius-md);
  background: var(--os-accent);
  color: var(--os-accent-text);
  font-weight: var(--weight-bold);
  font-family: var(--font-system);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background var(--duration-fast);
}

.mail-send-btn:hover {
  background: var(--os-accent-hover);
  border-color: var(--os-accent-hover);
}

/* ── About ── */
.about-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-4) var(--sp-6);
  text-align: center;
}

.about-reveal {
  opacity: 0;
  transform: translateY(12px);
}

.about-photo {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  object-position: top;
  margin-bottom: var(--sp-4);
  border-radius: var(--radius-md);
}

.about-name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin-bottom: var(--sp-1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.about-title {
  font-size: var(--text-base);
  color: var(--os-text-secondary);
  margin-bottom: var(--sp-2);
}

.about-subtitle {
  font-size: var(--text-sm);
  color: var(--os-text-muted);
  font-style: italic;
  margin-bottom: var(--sp-6);
}

.about-narrative {
  font-size: var(--text-sm);
  color: var(--os-text-secondary);
  line-height: var(--leading-normal);
  text-align: left;
  width: 100%;
  max-width: 500px;
  margin-bottom: var(--sp-4);
}

.about-highlights {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--sp-4);
  text-align: left;
  width: 100%;
  max-width: 500px;
}

.about-highlights li {
  font-size: var(--text-sm);
  color: var(--os-text-secondary);
  line-height: var(--leading-normal);
  padding: var(--sp-1) 0;
  padding-left: var(--sp-4);
  position: relative;
}

.about-highlights li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--os-accent);
}

.about-quote {
  font-size: var(--text-sm);
  color: var(--os-text-muted);
  font-style: italic;
  margin-bottom: var(--sp-6);
}

.about-section-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--os-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-2);
}

.about-awards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--sp-3);
  width: 100%;
  max-width: 500px;
  margin-top: var(--sp-4);
}

.about-award-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  text-align: center;
}

.about-award {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.about-award-label {
  font-size: var(--text-xs);
  color: var(--os-text-muted);
  line-height: var(--leading-tight, 1.3);
}

/* ── Settings ── */
.settings-container {
  padding: var(--sp-4);
}

.settings-section {
  margin-bottom: var(--sp-6);
}

.settings-section-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--os-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-3);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3);
  background: var(--os-surface-raised);
  border: 2px solid var(--os-border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-2);
}

.settings-row-label {
  font-size: var(--text-base);
}

/* Toggle switch */
.settings-toggle {
  width: 44px;
  height: 24px;
  border-radius: var(--radius-md);
  background: var(--os-border);
  border: 2px solid var(--os-border);
  cursor: pointer;
  position: relative;
  transition: background var(--duration-fast);
}

.settings-toggle.active {
  background: var(--os-accent);
  border-color: var(--os-accent);
}

.settings-toggle::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-sm);
  background: white;
  border: 1px solid rgba(0,0,0,0.1);
  transition: transform var(--duration-fast) var(--ease-out);
}

.settings-toggle.active::after {
  transform: translateX(20px);
}

/* Wallpaper picker */
.settings-wallpapers {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-2);
}

.settings-wallpaper {
  aspect-ratio: 16/9;
  border-radius: var(--radius-md);
  border: 2px solid var(--os-border-subtle);
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--duration-fast);
}

.settings-wallpaper.active {
  border-color: var(--os-accent);
  box-shadow: var(--shadow-sm);
}

/* Custom wallpaper swatch */
.settings-wallpaper-custom {
  aspect-ratio: 16/9;
  border-radius: var(--radius-md);
  border: 2px dashed var(--os-border-subtle);
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--duration-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
}

.settings-wallpaper-custom.active {
  border-color: var(--os-accent);
  border-style: solid;
  box-shadow: var(--shadow-sm);
}

.settings-wallpaper-custom.has-image {
  border-style: solid;
}

.settings-wallpaper-custom .custom-wp-plus {
  font-size: var(--text-xl);
  color: var(--os-text-muted);
  line-height: 1;
}

/* ── Dither Overlay (CSS pattern for video embeds) ── */
.dither-overlay {
  position: relative;
}

.dither-pattern {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0;
  transition: opacity 0.3s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Ccircle cx='1' cy='1' r='0.8' fill='%23000' opacity='0.6'/%3E%3Ccircle cx='5' cy='1' r='0.5' fill='%23000' opacity='0.4'/%3E%3Ccircle cx='3' cy='3' r='0.6' fill='%23000' opacity='0.5'/%3E%3Ccircle cx='7' cy='3' r='0.4' fill='%23000' opacity='0.3'/%3E%3Ccircle cx='1' cy='5' r='0.5' fill='%23000' opacity='0.4'/%3E%3Ccircle cx='5' cy='5' r='0.8' fill='%23000' opacity='0.6'/%3E%3Ccircle cx='3' cy='7' r='0.4' fill='%23000' opacity='0.3'/%3E%3Ccircle cx='7' cy='7' r='0.6' fill='%23000' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 8px 8px;
}

[data-dither="true"] .dither-pattern {
  opacity: 0.15;
}

/* ── Game Shared ── */
.game-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  gap: var(--sp-4);
}

.game-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.game-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-6);
  width: 100%;
  max-width: 500px;
}

.game-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
}

.game-column-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--os-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.game-status {
  font-size: var(--text-base);
  color: var(--os-text-secondary);
  text-align: center;
}

.game-btn {
  padding: var(--sp-2) var(--sp-5);
  border: 2px solid var(--os-border);
  border-radius: var(--radius-md);
  background: var(--os-surface-raised);
  color: var(--os-text);
  font-family: var(--font-system);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background var(--duration-fast), border-color var(--duration-fast), transform var(--duration-fast);
}

.game-btn:hover {
  background: var(--os-accent);
  border-color: var(--os-accent);
  color: var(--os-accent-text);
  transform: translateY(-1px);
}

.game-btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

/* ── Drawing App ── */
.drawing-container {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.drawing-toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2);
  background: var(--os-surface-raised);
  border-bottom: 2px solid var(--os-border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.drawing-tool-group {
  display: flex;
  gap: 1px;
}

.drawing-tool-btn {
  font-family: var(--font-system);
  font-size: 10px;
  padding: 3px 6px;
  background: var(--os-surface);
  border: 1px solid var(--os-border);
  color: var(--os-text);
  cursor: pointer;
  white-space: nowrap;
}

.drawing-tool-btn:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.drawing-tool-btn:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.drawing-tool-btn.active {
  background: var(--os-accent);
  color: var(--os-bg);
  border-color: var(--os-accent);
}

.drawing-sep {
  width: 1px;
  height: 20px;
  background: var(--os-border);
  flex-shrink: 0;
}

.drawing-label {
  font-size: 10px;
  color: var(--os-text-muted);
  white-space: nowrap;
}

.drawing-canvas-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.drawing-canvas {
  position: absolute;
  inset: 0;
  cursor: crosshair;
}

.drawing-cursor {
  position: absolute;
  pointer-events: none;
  border: 1px solid var(--os-text);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.5;
  display: none;
}

.drawing-color-input {
  width: 24px;
  height: 24px;
  border: 2px solid var(--os-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  background: none;
  flex-shrink: 0;
}

.drawing-recent-colors {
  display: flex;
  gap: 2px;
  align-items: center;
}

.drawing-recent-swatch {
  width: 16px;
  height: 16px;
  border: 1px solid var(--os-border);
  border-radius: 2px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.drawing-recent-swatch:hover {
  border-color: var(--os-accent);
  transform: scale(1.2);
}

.drawing-size-input {
  width: 60px;
  accent-color: var(--os-accent);
}

.drawing-action-btn {
  font-family: var(--font-system);
  font-size: 10px;
  padding: 3px 8px;
  background: var(--os-surface);
  border: 1px solid var(--os-border);
  border-radius: var(--radius-sm);
  color: var(--os-text);
  cursor: pointer;
  white-space: nowrap;
}

.drawing-action-btn:hover:not(:disabled) {
  background: var(--os-surface-raised);
}

.drawing-action-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ── Juventus Highlights ── */
.juve-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #000;
}

.juve-match-ticker {
  padding: 8px 12px;
  background: #111;
  border-bottom: 1px solid #333;
  text-align: center;
  flex-shrink: 0;
}

.juve-match-comp {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  margin-bottom: 4px;
}

.juve-match-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.juve-match-team {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

.juve-match-result {
  font-size: 1.15rem;
  font-weight: 800;
  color: #e74c3c;
}

.juve-match-date {
  font-size: 0.55rem;
  color: #666;
  margin-top: 4px;
}

.juve-video-wrapper {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #000;
}

.juve-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.juve-reaction-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: var(--os-surface);
  color: var(--os-text);
  font-family: var(--font-system);
  font-size: 0.85rem;
  font-style: italic;
  text-align: center;
}

/* ══════════════════════════════════════════════════════════════════════
   LIMEWIRE — P2P Client Player
   ══════════════════════════════════════════════════════════════════════ */

.listen-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #D4D0C8;
  font-family: Tahoma, 'Segoe UI', sans-serif;
  font-size: 11px;
  color: #000;
}

/* ── Tab Bar ── */
.lw-tab-bar {
  display: flex;
  gap: 1px;
  padding: 2px 4px 0;
  background: #D4D0C8;
}

.lw-tab {
  padding: 3px 12px;
  background: #C8C4BC;
  border: 1px solid #808080;
  border-bottom: none;
  border-radius: 2px 2px 0 0;
  cursor: default;
  font-size: 11px;
  font-family: inherit;
  color: #000;
}

.lw-tab.active {
  background: #D4D0C8;
  border-bottom: 1px solid #D4D0C8;
  margin-bottom: -1px;
  font-weight: bold;
}

/* ── Toolbar ── */
.lw-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px 4px;
  border-bottom: 1px solid #808080;
}

.lw-toolbar button {
  padding: 2px 8px;
  background: #D4D0C8;
  border: 2px outset #D4D0C8;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  color: #000;
  border-radius: 0;
}

.lw-toolbar button:active {
  border-style: inset;
}

.lw-toolbar-sep {
  width: 1px;
  height: 18px;
  background: #808080;
  margin: 0 4px;
}

/* ── Content Area ── */
.lw-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin: 0 4px;
  border: 2px inset #D4D0C8;
  background: #fff;
  overflow: hidden;
  min-height: 0;
}

/* ── Column Header ── */
.lw-column-header {
  display: grid;
  grid-template-columns: 1fr 60px 70px;
  background: #D4D0C8;
  border-bottom: 1px solid #808080;
  font-size: 11px;
  font-weight: bold;
}

.lw-col {
  padding: 2px 6px;
  border-right: 1px solid #808080;
  cursor: default;
}

.lw-col:last-child {
  border-right: none;
}

/* ── File Row ── */
.lw-file-row {
  display: grid;
  grid-template-columns: 1fr 60px 70px;
  background: #316AC5;
  color: #fff;
  font-size: 11px;
}

.lw-file-row span {
  padding: 2px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lw-file-name {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Video Area ── */
.lw-video-area {
  flex: 1;
  min-height: 0;
}

.listen-video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

.listen-video-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ── Status Bar ── */
.lw-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px;
  border-top: 1px solid #808080;
  font-size: 10px;
  color: #444;
  background: #D4D0C8;
}

.lw-status-left,
.lw-status-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Dark Theme ── */
[data-theme="dark"] .listen-container {
  background: #3C3C3C;
  color: #ddd;
}
[data-theme="dark"] .lw-tab-bar { background: #3C3C3C; }
[data-theme="dark"] .lw-tab { background: #333; border-color: #555; color: #ddd; }
[data-theme="dark"] .lw-tab.active { background: #3C3C3C; border-bottom-color: #3C3C3C; }
[data-theme="dark"] .lw-toolbar { border-bottom-color: #555; }
[data-theme="dark"] .lw-toolbar button { background: #3C3C3C; border-color: #555; color: #ddd; }
[data-theme="dark"] .lw-content { background: #1A1A1A; border-color: #555; }
[data-theme="dark"] .lw-column-header { background: #3C3C3C; border-bottom-color: #555; color: #ddd; }
[data-theme="dark"] .lw-col { border-right-color: #555; }
[data-theme="dark"] .lw-status-bar { background: #3C3C3C; border-top-color: #555; color: #999; }

/* ── Retro Theme ── */
[data-theme="retro"] .listen-container {
  background: #0A0A0A;
  color: #33FF33;
}
[data-theme="retro"] .lw-tab-bar { background: #0A0A0A; }
[data-theme="retro"] .lw-tab { background: #111; border-color: #33FF33; color: #33FF33; }
[data-theme="retro"] .lw-tab.active { background: #0A0A0A; border-bottom-color: #0A0A0A; }
[data-theme="retro"] .lw-toolbar { border-bottom-color: #33FF33; }
[data-theme="retro"] .lw-toolbar button { background: #0A0A0A; border-color: #33FF33; color: #33FF33; }
[data-theme="retro"] .lw-content { background: #000; border-color: #33FF33; }
[data-theme="retro"] .lw-column-header { background: #0A0A0A; border-bottom-color: #33FF33; color: #33FF33; }
[data-theme="retro"] .lw-col { border-right-color: #33FF33; }
[data-theme="retro"] .lw-file-row { background: #33FF33; color: #000; }
[data-theme="retro"] .lw-status-bar { background: #0A0A0A; border-top-color: #33FF33; color: #33FF33; }

/* ══════════════════════════════════════════════════════════════════════
   SNAKE
   ══════════════════════════════════════════════════════════════════════ */

.snake-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--os-surface);
}

.snake-score {
  display: flex;
  justify-content: space-between;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--os-text);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 2px solid var(--os-border);
  background: var(--os-surface-raised);
  flex-shrink: 0;
}

.snake-canvas-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.snake-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.snake-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  background: rgba(10, 10, 10, 0.92);
  z-index: 2;
}

/* ══════════════════════════════════════════════════════════════════════
   MINESWEEPER
   ══════════════════════════════════════════════════════════════════════ */

.mine-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--os-surface);
  padding: var(--sp-3);
  gap: var(--sp-3);
}

.mine-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) var(--sp-3);
  background: var(--os-surface-raised);
  border: 2px solid var(--os-border);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.mine-counter,
.mine-timer {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--os-accent);
  min-width: 3ch;
  text-align: center;
  letter-spacing: 0.1em;
}

.mine-smiley {
  font-size: var(--text-lg);
  font-family: var(--font-mono);
  padding: var(--sp-1) var(--sp-2);
  border: 2px solid var(--os-border);
  border-radius: var(--radius-md);
  background: var(--os-surface);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background var(--duration-fast);
}

.mine-smiley:hover {
  background: var(--os-surface-hover);
}

.mine-smiley:active {
  box-shadow: none;
  transform: translateY(1px);
}

.mine-grid {
  flex: 1;
  display: grid;
  gap: 1px;
  background: var(--os-border);
  border: 2px solid var(--os-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.mine-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  font-family: var(--font-mono);
  background: var(--os-surface-raised);
  cursor: pointer;
  user-select: none;
  aspect-ratio: 1;
  transition: background var(--duration-fast);
  border: 1px outset rgba(255, 255, 255, 0.2);
}

.mine-cell:hover:not(.revealed) {
  background: var(--os-surface-hover);
}

.mine-cell.revealed {
  background: var(--os-surface);
  border: 1px solid var(--os-border-subtle);
  cursor: default;
}

.mine-cell.flagged {
  font-size: var(--text-base);
}

.mine-cell.mine {
  font-size: var(--text-base);
}

.mine-cell.mine.exploded {
  background: var(--os-coral);
  color: var(--os-text-inverse, white);
}

/* ══════════════════════════════════════════════════════════════════════
   PONG
   ══════════════════════════════════════════════════════════════════════ */

.pong-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: var(--sp-2);
  gap: var(--sp-2);
  box-sizing: border-box;
}

.pong-score {
  display: flex;
  justify-content: space-between;
  padding: 0 var(--sp-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--os-text);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.pong-canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  cursor: none;
}

.pong-status {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--os-text-muted);
  min-height: 1.4em;
  font-style: italic;
}

.pong-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  background: var(--os-surface);
  z-index: 2;
  border-radius: var(--radius-md);
}

/* ══════════════════════════════════════════════════════════════════════
   PORTFOLIO SHOWCASE — Multi-Window Project Display
   ══════════════════════════════════════════════════════════════════════ */

.showcase-overlay {
  position: absolute;
  inset: 0;
  z-index: 500;
  pointer-events: none;
}

.showcase-window {
  pointer-events: auto;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* Showcase windows: use focused (light) title bar */
.showcase-window.os-window .window-title-bar {
  background: var(--os-titlebar-bg);
  border-bottom-color: var(--os-titlebar-border);
}

/* Showcase windows: always show traffic-light buttons (override :not(.focused) inactive) */
.showcase-window.os-window .window-btn-close {
  background: var(--os-btn-close);
  border-color: rgba(0, 0, 0, 0.2);
}
.showcase-window.os-window .window-btn-minimize {
  background: var(--os-btn-minimize);
  border-color: rgba(0, 0, 0, 0.2);
}
.showcase-window.os-window .window-btn-maximize {
  background: var(--os-btn-maximize);
  border-color: rgba(0, 0, 0, 0.2);
}

.showcase-window .window-title-bar:hover .window-btn-close::after,
.showcase-window.focused .window-title-bar:hover .window-btn-close::after {
  opacity: 1;
}

.showcase-window-content {
  flex: 1;
  overflow: hidden;
}

/* ── Bio / README ── */
.showcase-bio-content {
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  background: var(--os-titlebar-bg);
  overflow-y: auto;
}

.showcase-bio-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--os-titlebar-text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.showcase-bio-role {
  font-size: var(--text-sm);
  color: var(--os-accent);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.showcase-bio-team {
  font-size: var(--text-xs);
  color: var(--os-titlebar-text);
  font-style: italic;
  opacity: 0.6;
}

/* In-progress badge — showcase bio window */
.showcase-bio-badge {
  display: inline-block;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--os-accent, #F0A030);
  color: var(--os-bg, #0A0A0A);
  margin-top: 4px;
}

.showcase-bio-desc {
  font-size: var(--text-sm);
  color: var(--os-titlebar-text);
  line-height: var(--leading-normal);
  opacity: 0.8;
}

.showcase-bio-link {
  display: inline-block;
  margin-top: auto;
  padding: var(--sp-2) var(--sp-3);
  background: var(--os-accent);
  color: var(--os-accent-text);
  border: 2px solid var(--os-accent);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: center;
  transition: background var(--duration-fast);
}

.showcase-bio-link:hover {
  background: var(--os-accent-hover);
  border-color: var(--os-accent-hover);
}

/* ── Stat Windows ── */

/* Override os-window min-size for compact stat windows */
.showcase-window:has(.showcase-stat-content) {
  min-width: 0;
  min-height: 0;
}

/* Compact title bar for stat windows */
.showcase-window:has(.showcase-stat-content) .window-title-bar {
  height: 24px;
  padding: 0 var(--sp-2);
}

.showcase-window:has(.showcase-stat-content) .window-controls {
  gap: 4px;
}

.showcase-window:has(.showcase-stat-content) .window-btn {
  width: 9px;
  height: 9px;
}

.showcase-window:has(.showcase-stat-content) .window-title {
  font-size: 10px;
}

.showcase-stat-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 2px 4px;
  background: var(--os-titlebar-bg);
  text-align: center;
  height: 100%;
  box-sizing: border-box;
}

.showcase-stat-value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: var(--weight-bold);
  color: var(--os-accent);
  line-height: 1;
}

.showcase-stat-label {
  font-size: 11px;
  color: var(--os-titlebar-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: var(--weight-bold);
}

/* ── Mobile Responsiveness ── */
@media (max-width: 767px) {
  .showcase-stat-value {
    font-size: 28px;
  }

  .showcase-bio-name {
    font-size: var(--text-base);
  }

  .showcase-bio-desc {
    font-size: var(--text-xs);
  }
}

@media (max-width: 479px) {
  .showcase-stat-value {
    font-size: 22px;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   ABOUT — Resume Timeline
   ══════════════════════════════════════════════════════════════════════ */

.about-timeline {
  margin-top: var(--sp-6);
  text-align: left;
  width: 100%;
  max-width: 500px;
}

/* ── Company Group ── */
.about-timeline-group {
  margin-bottom: var(--sp-6);
}
.about-timeline-group:last-child {
  margin-bottom: 0;
}

.about-timeline-company {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.about-timeline-company-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--os-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.about-timeline-tenure {
  font-size: var(--text-xs);
  color: var(--os-accent);
  font-weight: var(--weight-bold);
  background: color-mix(in srgb, var(--os-accent) 12%, transparent);
  padding: 1px 8px;
  border-radius: 10px;
  letter-spacing: 0.03em;
}

/* ── Roles Container ── */
.about-timeline-roles--connected {
  border-left: 2px solid var(--os-border);
  margin-left: 5px;
  padding-left: var(--sp-4);
}

/* ── Role Entry ── */
.about-timeline-entry {
  position: relative;
  padding-bottom: var(--sp-4);
}
.about-timeline-entry:last-child {
  padding-bottom: 0;
}

/* Dot markers on connected lines */
.about-timeline-roles--connected .about-timeline-entry::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--sp-4) - 5px);
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--os-border);
  border: 2px solid var(--os-surface);
  box-sizing: border-box;
}

/* Current role gets accent-filled dot */
.about-timeline-roles--connected .about-timeline-entry--current::before {
  background: var(--os-accent);
  border-color: var(--os-accent);
}

.about-timeline-role {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--os-text);
}
.about-timeline-entry--current .about-timeline-role {
  color: var(--os-accent);
}

.about-timeline-period {
  font-size: var(--text-xs);
  color: var(--os-text-muted);
  margin-top: 2px;
  letter-spacing: 0.3px;
}

/* ── Bullets ── */
.about-timeline-bullets {
  list-style: none;
  padding: 0;
  margin: var(--sp-2) 0 0;
}
.about-timeline-bullets li {
  font-size: var(--text-xs);
  color: var(--os-text-secondary);
  line-height: var(--leading-normal);
  padding: 2px 0;
  padding-left: var(--sp-3);
  position: relative;
}
.about-timeline-bullets li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--os-accent);
}

/* ── Legacy flat timeline fallback ── */
.about-timeline-highlight {
  font-size: var(--text-sm);
  color: var(--os-text-secondary);
  margin-top: var(--sp-1);
}

/* ══════════════════════════════════════════════════════════════════════
   PHOTO BOOTH
   ══════════════════════════════════════════════════════════════════════ */

/* Edge-to-edge camera feed container */
.photo-booth {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
}

/* WebGL dither canvas fills the window */
.photo-booth canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Hidden video element (source for WebGL texture) */
.photo-booth video {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

/* Circular shutter button — macOS Photo Booth style */
.photo-booth-snap {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  cursor: pointer;
  z-index: 2;
  transition: transform 150ms ease-out, background 150ms ease-out;
  padding: 0;
}
.photo-booth-snap::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  transition: transform 150ms ease-out;
}
.photo-booth-snap:hover {
  transform: translateX(-50%) scale(1.08);
}
.photo-booth-snap:active::after {
  transform: scale(0.85);
}

/* Edge-to-edge result view */
.photo-booth-result {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
}
.photo-booth-result-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

/* Floating pill action bar */
.photo-booth-actions {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--sp-2);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  z-index: 2;
}

/* Camera error message */
.photo-booth-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: var(--sp-6);
  text-align: center;
  color: var(--os-text-secondary);
}

/* ══════════════════════════════════════════════════════════════════════
   GITHUB — Contribution Heatmap
   ══════════════════════════════════════════════════════════════════════ */

.gh-container {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4);
  overflow: auto;
  position: relative;
}

.gh-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.gh-count {
  font-size: var(--text-sm);
  color: var(--os-text);
  font-weight: 600;
}

.gh-profile-link {
  font-size: var(--text-xs);
  color: var(--os-accent);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.gh-profile-link:hover {
  text-decoration: underline;
}

.gh-graph {
  width: 100%;
  height: auto;
}

.gh-month-label,
.gh-day-label {
  font-size: 9px;
  fill: var(--os-text-muted);
  font-family: var(--font-system);
}

.gh-cell {
  shape-rendering: geometricPrecision;
  transition: opacity var(--duration-fast, 150ms) ease;
}
.gh-cell:hover {
  opacity: 0.75;
  stroke: var(--os-text);
  stroke-width: 1;
}

.gh-tooltip {
  position: absolute;
  padding: var(--sp-1) var(--sp-2);
  background: var(--os-surface-raised);
  color: var(--os-text);
  border: 2px solid var(--os-border);
  border-radius: var(--radius-sm, 4px);
  font-size: var(--text-xs);
  font-family: var(--font-system);
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
  z-index: var(--z-tooltip, 50);
  box-shadow: var(--shadow-sm, 2px 2px 0 rgba(0,0,0,.15));
}
.gh-tooltip[hidden] {
  display: none;
}

.gh-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  padding-top: var(--sp-1);
}

.gh-legend-swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 2px;
}

.gh-legend-label {
  font-size: 9px;
  color: var(--os-text-muted);
  padding: 0 var(--sp-1);
}

.gh-loading,
.gh-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  height: 100%;
  color: var(--os-text-muted);
  font-size: var(--text-sm);
  text-align: center;
}

.gh-retry-btn {
  padding: var(--sp-1) var(--sp-3);
  background: var(--os-surface-raised);
  color: var(--os-text);
  border: 2px solid var(--os-border);
  border-radius: var(--radius-sm, 4px);
  font-family: var(--font-system);
  font-size: var(--text-xs);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.gh-retry-btn:hover {
  background: var(--os-accent);
  color: var(--os-accent-text, #fff);
  border-color: var(--os-accent);
}

/* ── Theme overrides for heatmap cells ── */

/* Dark: darken empty cells */
[data-theme="dark"] .gh-cell[data-level="0"] { fill: #0A0A0A; }

/* Retro: CRT green phosphor palette */
[data-theme="retro"] .gh-cell[data-level="0"] { fill: #0a0a0a; }
[data-theme="retro"] .gh-cell[data-level="1"] { fill: #0e4429; }
[data-theme="retro"] .gh-cell[data-level="2"] { fill: #006d32; }
[data-theme="retro"] .gh-cell[data-level="3"] { fill: #26a641; }
[data-theme="retro"] .gh-cell[data-level="4"] { fill: #39d353; }

/* ── Messages (iMessage) ── */
.msg-container {
  display: flex;
  height: 100%;
  font-family: var(--font-system);
  color: var(--os-text);
  background: var(--os-surface);
}

.msg-sidebar {
  width: 180px;
  flex-shrink: 0;
  background: var(--os-bg-warm);
  border-right: 2px solid var(--os-border);
  overflow-y: auto;
}

.msg-sidebar-header {
  padding: var(--sp-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--os-text-secondary);
  border-bottom: 1px solid var(--os-border-subtle);
}

.msg-convo-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  cursor: pointer;
  transition: background 0.15s ease;
}

.msg-convo-item:hover {
  background: var(--os-surface-hover);
}

.msg-convo-item--active {
  background: var(--os-accent-muted);
}

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--os-accent);
  color: var(--os-accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.msg-avatar--sm {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.msg-convo-info {
  min-width: 0;
  flex: 1;
}

.msg-convo-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-convo-preview {
  font-size: 11px;
  color: var(--os-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-chat-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.msg-chat-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 2px solid var(--os-border);
  background: var(--os-surface-raised);
  flex-shrink: 0;
}

.msg-chat-header-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.msg-message-area {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.msg-bubble-row {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}

.msg-bubble-row--incoming {
  align-self: flex-start;
  align-items: flex-start;
}

.msg-bubble-row--outgoing {
  align-self: flex-end;
  align-items: flex-end;
}

.msg-bubble {
  padding: var(--sp-2) var(--sp-3);
  border-radius: 16px;
  font-size: var(--text-sm);
  line-height: 1.4;
  word-wrap: break-word;
}

.msg-bubble--incoming {
  background: var(--os-surface-raised);
  border: 1px solid var(--os-border-subtle);
  border-bottom-left-radius: 4px;
  color: var(--os-text);
}

.msg-bubble--outgoing {
  background: var(--os-accent);
  color: var(--os-accent-text);
  border-bottom-right-radius: 4px;
}

.msg-receipt {
  font-size: 10px;
  color: var(--os-text-muted);
  margin-top: 2px;
  padding-right: 2px;
}

/* Typing indicator */
.msg-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: var(--sp-2) var(--sp-3);
  background: var(--os-surface-raised);
  border: 1px solid var(--os-border-subtle);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}

.msg-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--os-text-muted);
  animation: msg-typing-bounce 1.2s ease-in-out infinite;
}

.msg-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.msg-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes msg-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Input bar */
.msg-input-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-top: 2px solid var(--os-border);
  background: var(--os-surface);
  flex-shrink: 0;
}

.msg-input {
  flex: 1;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--os-border);
  border-radius: 18px;
  background: var(--os-bg-warm);
  color: var(--os-text);
  font-family: var(--font-system);
  font-size: var(--text-sm);
  outline: none;
  transition: border-color 0.15s ease;
}

.msg-input:focus {
  border-color: var(--os-accent);
}

.msg-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.msg-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--os-accent);
  color: var(--os-accent-text);
  font-size: 16px;
  font-weight: var(--weight-bold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.msg-send-btn:hover:not(:disabled) {
  transform: scale(1.05);
}

.msg-send-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.msg-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── DOOM ── */
.doom-container {
  width: 100%;
  height: 100%;
  background: #000;
  position: relative;
  overflow: hidden;
}

.doom-container canvas {
  width: 100% !important;
  height: 100% !important;
  image-rendering: pixelated;
}

.doom-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--os-text);
  font-family: var(--font-system);
  font-size: 1rem;
  background: #000;
  z-index: 1;
}

.doom-error {
  color: var(--os-coral);
}

/* ══════════════════════════════════════════════════════════════════════
   CALCULATOR — Classic macOS-style
   ══════════════════════════════════════════════════════════════════════ */

.calc-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--os-surface);
  font-family: var(--font-system);
  user-select: none;
}

.calc-display-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-4) var(--sp-2);
  background: var(--os-surface);
  min-height: 72px;
}

.calc-op-indicator {
  font-size: var(--text-sm);
  color: var(--os-text-muted);
  padding-bottom: 6px;
  min-width: 14px;
  text-align: center;
}

.calc-display {
  font-size: 2.4rem;
  font-weight: 300;
  color: var(--os-text);
  text-align: right;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
  transition: font-size 0.15s ease;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  flex: 1;
  background: var(--os-border);
}

.calc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-system);
  font-size: 1.1rem;
  border: none;
  cursor: pointer;
  transition: filter 0.1s ease;
  padding: 0;
  min-height: 44px;
}

.calc-btn:active {
  filter: brightness(0.85);
}

/* Number buttons */
.calc-btn-num {
  background: var(--os-surface-raised);
  color: var(--os-text);
}

.calc-btn-num:hover {
  filter: brightness(0.95);
}

/* Operator buttons */
.calc-btn-op {
  background: var(--os-accent);
  color: var(--os-accent-text);
  font-weight: var(--weight-bold);
}

.calc-btn-op:hover {
  filter: brightness(1.08);
}

.calc-btn-op.calc-btn--active {
  filter: brightness(0.75);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Function buttons (C, +/-, %) */
.calc-btn-fn {
  background: var(--os-text-secondary);
  color: var(--os-bg-warm, #FAF4E8);
  font-weight: var(--weight-bold);
}

.calc-btn-fn:hover {
  filter: brightness(1.1);
}

/* Zero button spans two columns */
.calc-btn-wide {
  grid-column: span 2;
}

/* 80085 Easter egg */
.calc-easter-egg {
  color: var(--os-coral);
  animation: calc-egg-flash 0.4s ease;
}

@keyframes calc-egg-flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ──────────────────────────────────────────────
   STICKIES
   ────────────────────────────────────────────── */

/* Sticky note on the desktop */
.sticky-note {
  position: absolute;
  width: 200px;
  height: 200px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  box-shadow: 2px 3px 10px rgba(0, 0, 0, 0.2);
  background: var(--sticky-bg, #FFFACD);
  color: var(--sticky-text, #3D3520);
  font-family: var(--font-system);
  font-size: 0.8125rem;
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}

.sticky-note:hover {
  box-shadow: 2px 4px 14px rgba(0, 0, 0, 0.28);
}

/* Header / drag bar */
.sticky-note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  background: var(--sticky-header, #F5E050);
  cursor: grab;
  flex-shrink: 0;
  user-select: none;
}

.sticky-note-header:active {
  cursor: grabbing;
}

/* Color picker dots */
.sticky-note-colors {
  display: flex;
  gap: 4px;
}

.sticky-note-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.2);
  padding: 0;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.sticky-note-color-dot:hover {
  transform: scale(1.2);
}

.sticky-note-color-dot--active {
  border-color: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}

/* Action buttons (+, x) */
.sticky-note-actions {
  display: flex;
  gap: 2px;
}

.sticky-note-btn {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.1s ease;
}

.sticky-note-btn:hover {
  background: rgba(0, 0, 0, 0.18);
}

.sticky-note-close:hover {
  background: rgba(194, 43, 43, 0.3);
  color: #8B1A1A;
}

/* Editable body */
.sticky-note-body {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
  outline: none;
  word-wrap: break-word;
  white-space: pre-wrap;
  line-height: 1.5;
}

.sticky-note-body:empty::before {
  content: 'Type here...';
  color: rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

/* Stickies control panel (app window) */
.stickies-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3, 12px);
  padding: var(--sp-4, 16px);
  font-family: var(--font-system);
  color: var(--os-text);
  background: var(--os-surface);
}

.stickies-panel-info {
  font-size: 0.8125rem;
  color: var(--os-text-secondary);
  text-align: center;
  margin: 0;
}

.stickies-panel-btn {
  padding: 6px 16px;
  border: 2px solid var(--os-border);
  border-radius: 4px;
  background: var(--os-surface-raised);
  color: var(--os-text);
  font-family: var(--font-system);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.stickies-panel-btn:hover {
  background: var(--os-surface-hover);
}
