*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --green: #019d52;
  --green-dark: #017a40;
  --green-light: #e8f5ee;
  --bg: #f8fbf9;
  --surface: #ffffff;
  --text: #1a2a1e;
  --text-secondary: #5a6b5e;
  --border: #dce6df;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.1);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

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

.page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 16px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand img {
  height: 36px;
  width: auto;
}

.brand-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--green);
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.search {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}

.search input {
  width: 100%;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(1, 157, 82, 0.15);
}

.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.chip {
  padding: 4px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-secondary);
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--green);
  color: var(--green);
}

.chip.active {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.workspace {
  display: flex;
  flex: 1;
  gap: 20px;
  padding: 20px 0;
  min-height: 0;
}

.messages-panel {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.messages-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.messages-head strong {
  color: var(--green);
  font-size: 15px;
}

.messages-kicker {
  color: var(--text-secondary);
  font-size: 12px;
}

.message-section h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  box-shadow: var(--shadow);
  border-left: 3px solid var(--border);
  cursor: default;
  transition: transform 0.15s;
}

.message-card:hover {
  transform: translateX(2px);
}

.message-card.type-Wichtig {
  border-left-color: #e74c3c;
}

.message-card.type-Frist {
  border-left-color: #f39c12;
}

.message-card.type-Team {
  border-left-color: #3498db;
}

.message-card.type-Neu {
  border-left-color: #2ecc71;
}

.message-card.type-Info {
  border-left-color: #95a5a6;
}

.message-card h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.message-card p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.message-card .msg-type {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--green-light);
  color: var(--green);
}

.message-card.type-Wichtig .msg-type {
  background: #fde8e8;
  color: #c0392b;
}

.message-card.type-Frist .msg-type {
  background: #fef3cd;
  color: #856404;
}

.wheel-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 400px;
}

.ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 520px;
  height: 520px;
  border-radius: 50%;
  border: 1px solid var(--border);
  pointer-events: none;
}

.center-orb {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
}

.center-orb div {
  text-align: center;
}

.center-orb img {
  width: 32px;
  height: 32px;
  margin-bottom: 2px;
}

.center-orb strong {
  display: block;
  font-size: 11px;
  color: var(--green);
}

.center-orb span {
  font-size: 9px;
  color: var(--text-secondary);
}

.app-tile {
  position: absolute;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text);
  z-index: 1;
  overflow: hidden;
}

.app-tile:hover {
  transform: scale(1.15);
  box-shadow: var(--shadow-lg);
  z-index: 3;
  border-color: var(--green);
}

.app-tile:focus {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.app-tile img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.app-tile .tile-name {
  font-size: 8px;
  text-align: center;
  line-height: 1.1;
  margin-top: 3px;
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-tile.wichtig::after {
  content: '!';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: #e74c3c;
  color: white;
  border-radius: 50%;
  font-size: 10px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.empty {
  display: none;
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
  z-index: 2;
}

.empty:only-child {
  display: block;
}

.info-panel {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  align-self: flex-start;
}

.info-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-logo img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.info-kicker {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.info-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.info-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.meta div {
  display: flex;
  justify-content: space-between;
}

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

.open-button {
  display: inline-block;
  padding: 10px 20px;
  background: var(--green);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s;
}

.open-button:hover {
  background: var(--green-dark);
}

.open-button.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.notice {
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
}

@media (max-width: 1100px) {
  .messages-panel {
    display: none;
  }
}

@media (max-width: 900px) {
  .info-panel {
    display: none;
  }

  .ring {
    width: 380px;
    height: 380px;
  }

  .app-tile {
    width: 60px;
    height: 60px;
  }

  .app-tile img {
    width: 22px;
    height: 22px;
  }

  .app-tile .tile-name {
    font-size: 7px;
  }

  .center-orb {
    width: 90px;
    height: 90px;
  }

  .center-orb img {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 600px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search {
    max-width: none;
  }

  .ring {
    width: 300px;
    height: 300px;
  }

  .app-tile {
    width: 50px;
    height: 50px;
  }

  .app-tile img {
    width: 18px;
    height: 18px;
  }

  .center-orb {
    width: 70px;
    height: 70px;
  }

  .page {
    padding: 0 8px;
  }
}