/* ==========================================================================
   Vaihingen Haters Blog – Retro-Theme (Windows 98 / Geocities)
   ========================================================================== */

:root {
    --desk: #008080;
    --face: #c0c0c0;
    --face-light: #dfdfdf;
    --hi: #ffffff;
    --shadow: #808080;
    --dark: #0a0a0a;
    --title-a: #000080;
    --title-b: #1084d0;
    --title-text: #ffffff;
    --paper-bg: #ffffff;
    --paper-text: #000000;
    --paper-font: Verdana, Geneva, Tahoma, sans-serif;
    --paper-size: 13px;
    --link: #0000ee;
    --ui-font: Tahoma, "MS Sans Serif", Verdana, Geneva, sans-serif;
    --pixel: "Press Start 2P", "Courier New", monospace;
    --term: VT323, "Courier New", monospace;
    --raised: inset -1px -1px var(--dark), inset 1px 1px var(--face-light), inset -2px -2px var(--shadow), inset 2px 2px var(--hi);
    --sunken: inset -1px -1px var(--hi), inset 1px 1px var(--shadow), inset -2px -2px var(--face-light), inset 2px 2px var(--dark);
    --pressed: inset -1px -1px var(--hi), inset 1px 1px var(--dark), inset -2px -2px var(--face-light), inset 2px 2px var(--shadow);
    --etched: inset -1px -1px var(--hi), inset 1px 1px var(--shadow);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

/* Safe Area (iPhone-Notch, Home-Leiste): env() ist 0, wo es keine gibt */
body {
    margin: 0;
    min-height: 100vh;
    padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
             calc(56px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    font: 12px/1.4 var(--ui-font);
    color: #000;
    background-color: var(--desk);
}
body.desktop {
    background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px);
    background-size: 4px 4px;
}

a { color: var(--link); }
img { max-width: 100%; }
mark { background: #ffff00; color: #000; padding: 0 1px; }
code { font-family: "Courier New", monospace; background: rgba(0, 0, 0, .06); padding: 0 3px; }
hr { border: 0; border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--hi); }

.muted { opacity: .72; }
.small { font-size: 11px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 6px; }
.inline { display: inline; }
.empty { padding: 24px; text-align: center; font-size: 14px; }

/* ---------- Fenster ---------- */
.window {
    background: var(--face);
    box-shadow: var(--raised);
    padding: 3px;
    color: #000;
}
.titlebar {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 22px;
    padding: 2px 3px 2px 6px;
    background: linear-gradient(90deg, var(--title-a), var(--title-b));
    color: var(--title-text);
    font-weight: bold;
    font-size: 12px;
}
.titlebar .title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 5px;
}
.titlebar a { color: inherit; text-decoration: none; }
.titlebar a:hover { text-decoration: underline; }
.tb-meta { font-weight: normal; font-size: 11px; white-space: nowrap; opacity: .9; }
.tb-btns { display: flex; gap: 2px; flex-shrink: 0; }
.tb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 16px;
    padding: 0;
    border: 0;
    background: var(--face);
    box-shadow: var(--raised);
    color: #000 !important;
    font: bold 11px/1 var(--ui-font);
    text-decoration: none !important;
    cursor: pointer;
}
.tb-btn:active { box-shadow: var(--pressed); }
.window-body { padding: 8px; }

/* ---------- Buttons & Formulare ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 23px;
    padding: 3px 12px;
    border: 0;
    background: var(--face);
    box-shadow: var(--raised);
    color: #000 !important;
    font: 12px/1.2 var(--ui-font);
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
}
.btn:hover { background: #cacaca; }
.btn:active, .btn.on { box-shadow: var(--pressed); }
.btn:active { padding: 4px 11px 2px 13px; }
.btn:focus-visible { outline: 1px dotted #000; outline-offset: -5px; }
.btn.primary { box-shadow: 0 0 0 1px #000, var(--raised); font-weight: bold; }
.btn.mini { min-height: 20px; padding: 1px 6px; font-size: 12px; }
.btn.danger { color: #a00000 !important; }
.btn.danger:hover { background: #ffd8d8; }
.btn.disabled { color: var(--shadow) !important; text-shadow: 1px 1px 0 var(--hi); cursor: default; }

.field {
    min-height: 23px;
    max-width: 100%;
    padding: 3px 5px;
    border: 0;
    background: #fff;
    box-shadow: var(--sunken);
    color: #000;
    font: 12px var(--ui-font);
}
.field:focus { outline: 1px dotted #000; outline-offset: -5px; }
textarea.field { resize: vertical; line-height: 1.4; width: 100%; }
input.field[type="text"], input.field[type="search"], input.field[type="url"], input.field[type="password"] { width: 100%; }
.field.mono { font-family: "Courier New", monospace; }
/* iOS/Safari zeichnet Felder sonst rund und mit eigenem Stil */
input.field:not([type="file"]), textarea.field, select.field {
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
}
select.field {
    padding-right: 24px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17'%3E%3Crect width='16' height='17' fill='%23c0c0c0'/%3E%3Cpath d='M0 0h16v1H1v16H0z' fill='%23fff'/%3E%3Cpath d='M15 0h1v17H0v-1h15z' fill='%230a0a0a'/%3E%3Cpath d='M4 7h8l-4 4z' fill='%23000'/%3E%3C/svg%3E") no-repeat right 3px center / 16px 17px;
    cursor: pointer;
}
input.field[type="file"] { width: 100%; padding: 3px; font-size: 12px; }
.sr-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    width: 46px;
    height: 26px;
    padding: 3px;
    border: 0;
    border-radius: 0;
    background: var(--face);
    box-shadow: var(--raised);
    cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 1px solid #000; border-radius: 0; }
input[type="color"]::-moz-color-swatch { border: 1px solid #000; border-radius: 0; }
input[type="checkbox"] { accent-color: var(--title-a); width: 14px; height: 14px; }
input[type="range"] { accent-color: var(--title-a); }

fieldset {
    min-width: 0; /* sonst wird das Fieldset so breit wie sein breitester Inhalt (Safari) */
    margin: 0 0 12px;
    padding: 8px 10px 10px;
    border: 2px groove var(--face-light);
}
legend { padding: 0 4px; font-weight: bold; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.form-grid > label { display: flex; flex-direction: column; gap: 4px; }
.form-grid.colors { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.color-row, .range-row { display: flex; align-items: center; gap: 6px; }

/* ---------- Hauptfenster ---------- */
.main-window { max-width: 1140px; margin: 0 auto; }

.menubar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 2px;
    border-bottom: 1px solid var(--shadow);
    box-shadow: 0 1px 0 var(--hi);
}
.menubar a { padding: 3px 8px; color: #000; text-decoration: none; }
.menubar a:hover, .menubar a.active { background: var(--title-a); color: #fff; }
.menubar-right { margin-left: auto; padding: 3px 8px; }
.menubar-right a { padding: 0; }
.menubar-right a:hover { background: none; color: var(--link); text-decoration: underline; }

.toolbar { padding: 4px; border-bottom: 1px solid var(--shadow); box-shadow: 0 1px 0 var(--hi); }
.toolbar .address { display: flex; align-items: center; gap: 6px; }
.toolbar label { color: var(--shadow); text-shadow: 1px 1px 0 var(--hi); font-weight: bold; }

/* ---------- Kopfbereich ---------- */
.masthead {
    position: relative;
    margin: 4px 0;
    padding: 22px 16px 16px;
    overflow: hidden;
    text-align: center;
    background-color: #000;
    background-image:
        radial-gradient(1px 1px at 20px 30px, #fff, transparent),
        radial-gradient(1px 1px at 90px 80px, #fff, transparent),
        radial-gradient(1.5px 1.5px at 160px 40px, #ffd, transparent),
        radial-gradient(1px 1px at 230px 110px, #fff, transparent),
        radial-gradient(1px 1px at 300px 20px, #ddf, transparent),
        radial-gradient(1.5px 1.5px at 50px 120px, #fff, transparent),
        linear-gradient(180deg, #000010, #1a0033);
    background-size: 320px 140px, 320px 140px, 320px 140px, 320px 140px, 320px 140px, 320px 140px, 100% 100%;
    box-shadow: var(--sunken);
}
.logo {
    display: inline-block;
    font: clamp(16px, 4.2vw, 38px)/1.25 var(--pixel);
    letter-spacing: 2px;
    text-decoration: none;
    color: #ffe600 !important;
    background: linear-gradient(180deg, #fff9a8 0%, #ffe600 35%, #ff7a00 65%, #ff0080 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(3px 3px 0 #6a00c8) drop-shadow(1px 1px 0 #000);
}
.logo-br { display: none; }
.tagline { margin-top: 10px; font: 20px/1 var(--term); color: #39ff14; letter-spacing: 1px; }
.sticker {
    position: absolute;
    top: 10px;
    right: 14px;
    padding: 6px 8px;
    transform: rotate(12deg);
    background: #ff0;
    color: #f00;
    font: 10px var(--pixel);
    border: 2px solid #f00;
    animation: blink 1.2s steps(2, start) infinite;
}

.ticker {
    overflow: hidden;
    white-space: nowrap;
    padding: 2px 0;
    background: #000;
    color: #39ff14;
    font: 19px/1.1 var(--term);
    box-shadow: var(--sunken);
}
.ticker-track { display: inline-block; padding-left: 100%; animation: ticker 45s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker a { color: #39ff14; text-decoration: none; }
.ticker a:hover { color: #fff; text-decoration: underline; }
.ticker span { margin-right: 12px; }

/* ---------- Layout ---------- */
.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 10px;
    padding: 8px 4px;
}
.layout.wide, .main-window .layout:not(:has(.sidebar)) { grid-template-columns: minmax(0, 1fr); }
.content, .sidebar { min-width: 0; }
.content > * + * { margin-top: 10px; }
.sidebar { display: flex; flex-direction: column; gap: 10px; }
.crumbs { margin: 0 0 8px; }

/* ---------- Sidebar ---------- */
.side .window-body { font-size: 12px; }
.side label { display: flex; flex-direction: column; gap: 2px; }
.zone-list, .recent-comments, .archive { list-style: none; margin: 0 0 6px; padding: 0; }
.zone-list li, .archive li { padding: 2px 0; }
.zone-list a { display: inline-flex; align-items: center; gap: 4px; }
.recent-comments li { padding: 4px 0; border-bottom: 1px dotted var(--shadow); overflow-wrap: anywhere; }
.recent-comments li:last-child { border-bottom: 0; }
.recent-comments q { display: block; font-style: italic; color: #333; }
.top-list { margin: 0; padding-left: 20px; }
.top-list li { padding: 2px 0; }
.mini-avatar { width: 16px; height: 16px; object-fit: cover; vertical-align: middle; box-shadow: 0 0 0 1px rgba(0, 0, 0, .4); }

.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.calendar { width: 100%; border-collapse: collapse; background: #fff; box-shadow: var(--sunken); text-align: center; table-layout: fixed; }
.calendar th { padding: 3px 0; background: var(--title-a); color: #fff; font-weight: normal; }
.calendar td { padding: 3px 0; }
.calendar td.today { outline: 1px dotted #000; outline-offset: -2px; font-weight: bold; }
.calendar td.has-posts a { display: block; background: #ffff80; font-weight: bold; text-decoration: none; }
.calendar td.selected a { background: var(--title-a); color: #fff; }

.counter { display: inline-flex; gap: 1px; margin: 4px 0; padding: 2px; background: #000; box-shadow: var(--sunken); }
.counter span { display: inline-block; width: 13px; padding: 2px 0; background: #111; color: #39ff14; font: 16px/1 var(--term); text-align: center; }
.stats-line { margin-top: 4px; }

/* ---------- Tabs / Index ---------- */
.index-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; }
.tab { padding: 4px 10px; background: var(--face); box-shadow: var(--raised); color: #000; text-decoration: none; }
.tab.active { background: #fff; font-weight: bold; box-shadow: var(--sunken); }
.filter-note { background: #ffffe1; border-top: 1px solid var(--shadow); }

.pager { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px; }
.pager-info { font-weight: bold; }

/* ---------- Beiträge ---------- */
.post { scroll-margin-top: 10px; }
.post-grid { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 6px; padding: 6px 4px 4px; }

.vote { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.vote.inline { flex-direction: row; display: inline-flex; margin-left: auto; }
.vote-btn { width: 26px; min-height: 20px; padding: 0 !important; font-size: 10px; }
.vote.inline .vote-btn { width: 20px; min-height: 17px; font-size: 9px; }
.vote-btn.up.on { color: #ff4500 !important; background: #ffe0d0; }
.vote-btn.down.on { color: #0050ff !important; background: #d8e4ff; }
.score { min-width: 26px; padding: 3px 0; font: 10px/1 var(--pixel); text-align: center; }
.vote.inline .score { min-width: 22px; font-size: 9px; }
.score.pos { color: #008000; }
.score.neg { color: #c00000; }

.post-paper {
    min-width: 0;
    padding: 12px 16px;
    background: var(--post-bg, var(--paper-bg));
    color: var(--post-color, var(--paper-text));
    font-family: var(--post-font, var(--paper-font));
    font-size: var(--post-size, var(--paper-size));
    box-shadow: var(--sunken);
    border: 4px var(--post-border, none) currentColor;
}
.post-title {
    margin: 0 0 10px;
    font-size: 1.55em;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.post-title a { color: inherit; text-decoration: none; }
.post-title a:hover { text-decoration: underline; }

.post-body { line-height: 1.55; overflow-wrap: anywhere; }
.post-body::after { content: ""; display: block; clear: both; }
.post-body p { margin: 0 0 .8em; }
.post-body a { color: var(--link); }
.post-body img, .post-body video, .post-body svg { max-width: 100%; height: auto; }
.post-body iframe, .post-body embed, .post-body object { max-width: 100%; }
.post-body img { cursor: zoom-in; }
.post-body a img { cursor: pointer; }
.post-body figure { max-width: 100%; margin: 1em 0; display: table; }
.post-body figure.align-left { float: left; margin-right: 1em; }
.post-body figure.align-right { float: right; margin-left: 1em; }
.post-body figure.align-center { margin-left: auto; margin-right: auto; }
.post-body figcaption { font-size: .85em; opacity: .8; text-align: center; }
.post-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.post-body td, .post-body th { padding: 3px 6px; border: 1px solid #999; }
.post-body pre { white-space: pre-wrap; overflow-x: auto; padding: 8px; background: #000; color: #39ff14; font: 15px var(--term); }
.post-body blockquote { margin: .8em 0; padding: 4px 12px; border-left: 4px solid var(--shadow); background: rgba(0, 0, 0, .05); }
.post-body.clamped {
    max-height: 560px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(#000 70%, transparent);
    mask-image: linear-gradient(#000 70%, transparent);
}
.more-btn { margin-top: 6px; }

.post-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 4px 4px 50px;
}
.reactions { display: flex; flex-wrap: wrap; gap: 3px; }
.react-btn .n:empty { display: none; }
.reaction-who { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 11px; overflow-wrap: anywhere; }
.reaction-who:empty { display: none; }
.react-btn.on { background: #fff6c8; }
.post-meta { font-size: 11px; }
.post-time { display: none; }  /* nur auf dem Handy, sonst steht die Zeit in der Titelleiste */

/* Titel-Effekte */
.fx-rainbow > span, .fx-rainbow > a > span {
    background: linear-gradient(90deg, #f00, #f80, #ee0, #0c0, #0cf, #00f, #c0f, #f00);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-box-decoration-break: clone;
    animation: rainbow 4s linear infinite;
}
.fx-blink > span, .fx-blink > a > span { animation: blink 1s steps(2, start) infinite; }
.fx-marquee { overflow: hidden; white-space: nowrap; }
.fx-marquee > span, .fx-marquee > a > span { display: inline-block; padding-left: 100%; animation: ticker 12s linear infinite; }
.fx-marquee > a { display: block; }
.fx-shadow > span, .fx-shadow > a > span { text-shadow: 2px 2px 0 #ff00ff, 4px 4px 0 #00e5ff; }
.fx-glow > span, .fx-glow > a > span { text-shadow: 0 0 4px #fff, 0 0 10px #ffea00, 0 0 18px #ff00d4; }

/* ---------- Kommentare ---------- */
.comments {
    margin: 4px 4px 2px 50px;
    padding: 6px 8px;
    background: var(--paper-bg);
    color: var(--paper-text);
    box-shadow: var(--sunken);
    font-size: 12px;
}
.comments > summary { cursor: pointer; font-weight: bold; user-select: none; }
.comments-inner { margin-top: 6px; }
.comment { padding: 6px 0 2px; border-top: 1px dotted rgba(128, 128, 128, .6); scroll-margin-top: 20px; }
.comment.flash { animation: flash 2s ease-out; }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11px; }
.comment-user { font-weight: bold; }
.badge { padding: 0 4px; background: var(--title-a); color: #fff; font-size: 9px; font-weight: bold; }
.badge.admin { background: #c00000; }
.comment.deleted > .comment-body { padding: 4px 0; }
.post-foot .inline { margin-left: auto; }
.comment-body { padding: 3px 0 2px; overflow-wrap: anywhere; line-height: 1.45; }
.children { margin-left: 8px; padding-left: 12px; border-left: 2px solid rgba(128, 128, 128, .45); }
.children.flat { margin-left: 0; padding-left: 0; border-left: 0; }
details.reply > summary { display: inline-block; cursor: pointer; color: var(--link); font-size: 11px; list-style: none; }
details.reply > summary::-webkit-details-marker { display: none; }
details.reply[open] > summary { font-weight: bold; }
.comment-form { display: flex; align-items: flex-start; gap: 6px; margin: 6px 0; }
.comment-form textarea { flex: 1; min-height: 40px; }
.new-comment { margin-top: 10px; }

/* ---------- Editor ---------- */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 12px; }
.editor-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.title-input { font-size: 16px !important; font-weight: bold; min-height: 30px; }
.editor-side { min-width: 0; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.editor-actions.center { justify-content: center; }
.preview-paper { min-height: 120px; }
.upload-bar { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.upload-btn { position: relative; font-weight: bold; }
.preview-paper .post-title { font-size: 1.3em; }
.tox-tinymce { border: 0 !important; border-radius: 0 !important; box-shadow: var(--sunken); }

/* ---------- Dialoge / Flash ---------- */
.dialog { max-width: 460px; margin: 30px auto; }
.dialog-row { display: flex; gap: 14px; align-items: flex-start; }
.dialog-icon { font-size: 36px; line-height: 1; }
.row-label { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 6px; }

.flash-stack { display: flex; flex-direction: column; gap: 6px; margin: 6px 4px; }
.flash.error .titlebar { background: linear-gradient(90deg, #800000, #d01010); }
.flash-body { display: flex; align-items: center; gap: 10px; }
.flash-body > span:nth-child(2) { flex: 1; }
.flash-icon { font-size: 22px; }
body.zone .flash-stack { max-width: 1100px; margin: 0 auto 10px; }

/* ---------- Suche ---------- */
.search-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 12px; }
.search-form fieldset { margin-bottom: 8px; }
.search-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.search-anim { margin-top: 18px; font-size: 30px; text-align: center; animation: search 2.4s ease-in-out infinite; }
.search-results { min-height: 260px; padding: 8px 12px; background: #fff; box-shadow: var(--sunken); overflow-wrap: anywhere; }
.search-results h3 { margin: 8px 0 4px; padding-bottom: 2px; border-bottom: 1px solid var(--shadow); font-size: 13px; }
.result-list { list-style: none; margin: 0 0 10px; padding: 0; }
.result-list li { padding: 6px 0; border-bottom: 1px dotted #bbb; }
.result-title { font-weight: bold; font-size: 13px; }
.snippet { margin-top: 2px; color: #333; }

/* ---------- Zonen-Verzeichnis ---------- */
.zone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.zone-card { display: flex; flex-direction: column; background: #fff; box-shadow: var(--raised); color: #000; text-decoration: none; }
.zone-card:hover { outline: 1px dotted #000; outline-offset: -4px; }
.zone-card-top { display: flex; align-items: center; justify-content: center; height: 90px; margin: 3px 3px 0; }
.zone-card-top img { width: 64px; height: 64px; object-fit: cover; box-shadow: var(--raised); background: #fff; padding: 2px; }
.zone-card-top .folder { font-size: 46px; }
.zone-card-body { display: flex; flex-direction: column; gap: 3px; padding: 8px; }

/* ---------- Footer / Statusleiste ---------- */
.footer { padding: 10px 6px 6px; text-align: center; font-size: 11px; }
.footer p { margin: 8px 0 0; color: #333; }
.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.badge88 {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    width: 88px;
    height: 31px;
    font: 8px/1.2 var(--ui-font);
    text-align: center;
    border: 1px solid #000;
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .5);
}
.badge88 b { font-size: 9px; }
.b1 { background: #fff; color: #000080; }
.b2 { background: linear-gradient(#003, #00a); color: #ff0; }
.b3 { background: #c00; color: #fff; }
.b4 { background: #ff0; color: #000; }
.b5 { background: repeating-linear-gradient(45deg, #ffd000 0 6px, #000 6px 12px); color: #fff; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000; font-weight: bold; }

.statusbar { display: flex; gap: 2px; padding: 2px 0 0; }
.statusbar > span { padding: 2px 6px; box-shadow: var(--etched); white-space: nowrap; }
.statusbar > span:first-child { flex: 1; }

/* ---------- Taskleiste ---------- */
.taskbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 4px;
    height: calc(34px + env(safe-area-inset-bottom, 0px));
    padding: 3px max(3px, env(safe-area-inset-right, 0px)) calc(2px + env(safe-area-inset-bottom, 0px)) max(3px, env(safe-area-inset-left, 0px));
    background: var(--face);
    box-shadow: inset 0 1px var(--face-light), inset 0 2px var(--hi);
    color: #000;
    font: 12px/1.4 var(--ui-font);
}
.start { position: relative; }
.start > summary { list-style: none; font-weight: bold; }
.start > summary::-webkit-details-marker { display: none; }
.start[open] > summary { box-shadow: var(--pressed); }
.start-logo { font-size: 14px; }
.start-menu {
    position: absolute;
    bottom: calc(100% + 5px);
    left: 0;
    display: flex;
    min-width: 230px;
    /* nie höher als der Platz über der Taskleiste (Handy quer), Rest scrollt */
    max-height: calc(100vh - 44px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 44px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    padding: 3px;
    background: var(--face);
    box-shadow: var(--raised);
}
.start-side {
    display: flex;
    align-items: flex-end;
    width: 24px;
    padding: 6px 0;
    background: linear-gradient(0deg, #000080, #1084d0);
    color: #c0c0c0;
    font: bold 15px var(--ui-font);
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    letter-spacing: 1px;
}
.start-side b { color: #fff; }
.start-menu nav { flex: 1; display: flex; flex-direction: column; padding: 2px; overflow-y: auto; overscroll-behavior: contain; }
.start-menu nav a { display: block; padding: 7px 12px; color: #000; text-decoration: none; white-space: nowrap; font-size: 12px; }
.start-menu nav a:hover { background: var(--title-a); color: #fff; }
.start-menu hr { width: 100%; margin: 3px 0; }
.task {
    flex: 0 1 220px;
    min-width: 0;
    padding: 5px 8px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: bold;
    box-shadow: var(--pressed);
    background-color: #e8e8e8;
    background-image: linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%), linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%);
    background-size: 2px 2px;
    background-position: 0 0, 1px 1px;
}
.tray { display: flex; align-items: center; gap: 6px; margin-left: auto; padding: 4px 10px; box-shadow: var(--etched); white-space: nowrap; }

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, .55);
}
.lightbox .window { max-width: 96vw; max-height: 92vh; display: flex; flex-direction: column; }
.lightbox .lb-img { display: flex; justify-content: center; padding: 4px; background: #000; box-shadow: var(--sunken); overflow: auto; }
.lightbox img { max-width: calc(96vw - 20px); max-height: calc(92vh - 70px); object-fit: contain; }
.lightbox .lb-caption { padding: 4px 6px 2px; }

/* ==========================================================================
   Persönliche Zone
   ========================================================================== */
body.zone {
    background-color: var(--z-bg);
    color: var(--z-text);
    --paper-bg: transparent;
    --paper-text: var(--z-text);
    --paper-font: var(--z-font);
    --paper-size: var(--z-size);
    --link: var(--z-link);
    --title-a: var(--z-title);
    --title-b: var(--z-title-b);
}
.zone-topnav { display: flex; flex-wrap: wrap; gap: 6px; max-width: 1100px; margin: 0 auto 10px; }
.zone-window {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--z-panel);
    color: var(--z-text);
}
.zone-window a { color: var(--z-link); }
.zone-banner {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 150px;
    margin: 3px 0 0;
    padding: 14px;
    background: linear-gradient(135deg, var(--z-title), var(--z-title-b));
    background-size: cover;
    background-position: center;
}
.zone-banner.has-image { min-height: 220px; }
.zone-id { display: flex; align-items: flex-end; gap: 14px; min-width: 0; }
.avatar {
    flex-shrink: 0;
    width: 104px;
    height: 104px;
    object-fit: cover;
    padding: 3px;
    background: var(--face);
    box-shadow: var(--raised);
}
.avatar-empty { display: flex; align-items: center; justify-content: center; font-size: 54px; }
.zone-name {
    margin: 0;
    font: clamp(16px, 3vw, 28px)/1.3 var(--pixel);
    color: #fff;
    text-shadow: 3px 3px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
    overflow-wrap: anywhere;
}
.zone-sub { margin-top: 4px; color: #fff; font: 20px/1 var(--term); text-shadow: 2px 2px 0 #000; }

.zone-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 14px;
    padding: 12px;
    font-family: var(--z-font);
    font-size: var(--z-size);
}
.zone-cols.layout-left { grid-template-columns: 290px minmax(0, 1fr); }
.zone-cols.layout-left .zone-side { order: -1; }
.zone-cols.layout-none { grid-template-columns: minmax(0, 1fr); }
.zone-main, .zone-side { min-width: 0; }
.zone-main > * + * { margin-top: 16px; }
.zone-side { display: flex; flex-direction: column; gap: 14px; }

body.zone .post { background: transparent; box-shadow: none; padding: 0; color: inherit; }
body.zone .post-grid { padding: 8px 0 0; }
body.zone .post-paper { box-shadow: none; padding: 4px 8px; }
body.zone .post-foot { padding-left: 46px; }
body.zone .comments { margin-left: 46px; background: rgba(0, 0, 0, .06); box-shadow: var(--etched); }
body.zone .vote, body.zone .reactions { font-family: var(--ui-font); }

.zone-box .titlebar { font-family: var(--ui-font); }
.zone-box-body { padding: 8px 4px; }
.bio { margin-bottom: 8px; line-height: 1.5; overflow-wrap: anywhere; }
.zone-stats { list-style: none; margin: 0 0 8px; padding: 0; }
.zone-stats li { padding: 2px 0; }
.archive a.active { font-weight: bold; }

.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.gallery-item { position: relative; margin: 0; }
.gallery-item a { display: block; }
.gallery-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; padding: 2px; background: var(--face); box-shadow: var(--raised); }
.gallery-item figcaption { font-size: 10px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-del { position: absolute; top: 2px; right: 2px; }
.gallery-add > summary { cursor: pointer; font-weight: bold; margin-bottom: 6px; }

.gb-entry { padding: 6px 0; border-top: 1px dotted rgba(128, 128, 128, .6); overflow-wrap: anywhere; }
.gb-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11px; }
.gb-head form { margin-left: auto; }

/* ---------- Zone gestalten ---------- */
.zone-edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.image-field { margin-bottom: 10px; }
.image-row { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.thumb { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 56px; height: 56px; background: #fff; box-shadow: var(--sunken); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.pro > summary { cursor: pointer; font-weight: bold; margin-bottom: 6px; }
.zone-preview-wrap { position: sticky; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.zone-preview { box-shadow: var(--sunken); padding: 2px; background: #fff; }
.zp-desk { padding: 18px 14px; min-height: 280px; background-color: var(--z-bg); background-repeat: repeat; }
.zp-desk[data-bg-mode="cover"] { background-size: cover; background-position: center; }
.zp-desk[data-bg-mode="center"] { background-repeat: no-repeat; background-position: center top; }
.zp-window { background: var(--z-panel); color: var(--z-text); box-shadow: var(--raised); padding: 3px; font-family: var(--z-font); font-size: var(--z-size); }
.zp-window a { color: var(--z-link); }
.zp-title { padding: 3px 6px; background: linear-gradient(90deg, var(--z-title), var(--z-title-b)); color: #fff; font: bold 12px var(--ui-font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zp-banner { position: relative; height: 60px; background: linear-gradient(135deg, var(--z-title), var(--z-title-b)); background-size: cover; background-position: center; }
.zp-avatar { position: absolute; left: 8px; bottom: -14px; width: 40px; height: 40px; background: var(--face) center/cover; box-shadow: var(--raised); }
.zp-body { padding: 20px 10px 10px; }
.zp-post-title { font-size: 1.4em; font-weight: bold; }

/* ---------- Neuigkeiten & Vorschläge ---------- */
.news-list { display: flex; flex-direction: column; gap: 10px; }
.news-entry { padding: 10px 12px; background: #fff; box-shadow: var(--sunken); overflow-wrap: anywhere; }
.news-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.news-head h3 { flex: 1; min-width: 0; margin: 0; font-size: 14px; }
.news-date { padding: 1px 5px; background: #000; color: #39ff14; font: 15px/1.1 var(--term); white-space: nowrap; }
.news-body { margin-top: 6px; line-height: 1.5; }
.news-body p { margin: 0 0 4px; }
.news-body ul { margin: 4px 0 0; padding-left: 20px; }
.admin-box { margin-bottom: 10px; padding: 6px 8px; background: #fff0f0; box-shadow: var(--etched); }
.admin-box > summary { cursor: pointer; font-weight: bold; margin-bottom: 4px; }
.side-news { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; margin-bottom: 6px; }

.suggest-form { display: flex; gap: 8px; align-items: flex-start; }
.suggest-form textarea { flex: 1; }
.suggestion-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.suggestion { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; padding: 8px; background: #fff; box-shadow: var(--sunken); scroll-margin-top: 20px; }
.suggestion-main { min-width: 0; }
.suggestion-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11px; }
.suggestion-text { margin-top: 4px; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.suggestion-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.status-form { display: flex; gap: 4px; }
.status-badge { padding: 1px 6px; font-weight: bold; box-shadow: var(--etched); background: #ffffe1; }
.status-planned .status-badge { background: #dde8ff; }
.status-done .status-badge { background: #dcffdc; }
.status-rejected .status-badge { background: #eee; }
.status-done, .status-rejected { opacity: .8; }
.closed-suggestions { margin-top: 12px; }
.closed-suggestions > summary { cursor: pointer; font-weight: bold; }

/* ---------- Pub-Quiz ---------- */
.quiz-bar-body { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; background: linear-gradient(90deg, #fff7c2, #ffe36e); box-shadow: var(--etched); }
.quiz-count { display: inline-flex; align-items: center; gap: 8px; color: #000 !important; text-decoration: none; }
.quiz-count .counter span { width: 20px; font-size: 26px; color: #ffd400; }
.quiz-trophy { font-size: 28px; filter: drop-shadow(1px 1px 0 #8a5a00); }
.quiz-trophy.big { font-size: 56px; }
.quiz-label { font: 12px var(--pixel); }
.quiz-last { flex: 1; min-width: 160px; }
.quiz-hero { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 16px; background: radial-gradient(circle, #fff7c2, #ffd84d); box-shadow: var(--etched); }
.quiz-hero .counter span { width: 26px; font-size: 34px; color: #ffd400; }
.quiz-hero-label { margin-top: 4px; font: 12px var(--pixel); text-align: center; }
.quiz-form { display: flex; flex-direction: column; gap: 10px; }
.quiz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.quiz-win { margin: 0; padding: 4px; background: #fff; box-shadow: var(--raised); scroll-margin-top: 20px; }
.quiz-win img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; box-shadow: var(--sunken); }
.quiz-win figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 2px 2px; }
.quiz-win figcaption .inline { margin-left: auto; }
.quiz-date { padding: 1px 5px; background: #000; color: #ffd400; font: 15px/1.1 var(--term); }

/* ---------- Teilen & Zitieren ---------- */
.share-banner { padding: 3px 8px 4px; font-size: 11px; color: #000; }
.share-banner a { color: #000080; }
.post-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.share-btn .n:empty { display: none; }
.share-btn.on { background: #d8f5d8; color: #006400 !important; }
.mini-note { align-self: center; padding: 2px 6px; background: #ffffe1; border: 1px solid #000; font-size: 11px; color: #000; }
.quote-card { margin-top: 10px; }
.quote-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
    padding: 8px 10px;
    border: 1px solid currentColor;
    border-left-width: 4px;
    background: rgba(0, 0, 0, .04);
    color: inherit !important;
    text-decoration: none;
    font-size: .92em;
}
.quote-link:hover { background: rgba(0, 0, 0, .08); }
.quote-head { font-size: 11px; opacity: .8; }
.quote-title { font-weight: bold; }
.quote-thumb { max-width: 160px; max-height: 110px; object-fit: cover; }
.quote-excerpt { opacity: .85; overflow-wrap: anywhere; }
.quote-preview { margin-top: 4px; padding: 8px; background: #fff; box-shadow: var(--sunken); }

/* ---------- Erwähnungen ---------- */
a.mention { font-weight: bold; text-decoration: none; background: rgba(255, 230, 0, .35); padding: 0 2px; }
a.mention:hover { text-decoration: underline; }
.mention-pop {
    position: absolute;
    z-index: 300;
    display: flex;
    flex-direction: column;
    padding: 2px;
    background: #fff;
    border: 1px solid #000;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, .4);
}
.mention-item { padding: 6px 10px; border: 0; background: none; text-align: left; font: 13px var(--ui-font); cursor: pointer; color: #000; }
.mention-item.active, .mention-item:hover { background: var(--title-a); color: #fff; }

/* ---------- Benachrichtigungen ---------- */
.bell { position: relative; text-decoration: none; margin-right: 6px; }
.bell-count:empty, .tray-bell b:empty { display: none; }
.bell-count, .tray-bell b {
    display: inline-block;
    min-width: 16px;
    margin-left: 2px;
    padding: 0 4px;
    background: #c00000;
    color: #fff;
    font: bold 10px/16px var(--ui-font);
    text-align: center;
    border-radius: 8px;
}
.bell.has-new, .tray-bell.has-new { animation: ring 1.6s ease-in-out 2; display: inline-block; }
.tray-bell { color: #000; text-decoration: none; }
.note-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.note-link { display: flex; align-items: flex-start; gap: 10px; padding: 8px; background: #fff; box-shadow: var(--sunken); color: #000 !important; text-decoration: none; }
.note-link:hover { background: #f0f4ff; }
.note.unread .note-link { background: #ffffe1; }
.note-icon { font-size: 20px; line-height: 1; }
.note-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.note-quote { font-style: italic; color: #333; }

/* ---------- Entwürfe & Autosave ---------- */
.draft-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.draft { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px; background: #fff; box-shadow: var(--sunken); }
.draft-main { flex: 1; min-width: 200px; display: flex; gap: 8px; color: #000 !important; text-decoration: none; }
.draft-icon { font-size: 26px; }
.draft-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.draft-tools { display: flex; gap: 4px; }
.autosave-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 8px 0; padding: 6px 8px; background: #ffffe1; border: 1px solid #000; }
.autosave-bar[hidden] { display: none; }
label.check, .side label.check { display: flex; flex-direction: row; align-items: center; gap: 6px; cursor: pointer; }

/* ---------- Einstellungen, Folgen, App & Push ---------- */
.kbd { display: inline-block; padding: 0 5px; background: var(--face); box-shadow: var(--raised); font-size: 11px; white-space: nowrap; }
.install-box p, .push-box p { margin: 0 0 8px; }
.note-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.follow-table { display: flex; flex-direction: column; gap: 4px; }
.follow-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 260px); align-items: center; gap: 8px; padding: 4px 6px; background: #fff; box-shadow: var(--sunken); }
.follow-row a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: bold; }
fieldset label.check { margin: 4px 0; }
.follow-form { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; background: var(--face); box-shadow: var(--raised); color: #000; }
.follow-form label { display: inline-flex; align-items: center; gap: 6px; }
.follow-form select.field { min-height: 23px; }

/* ---------- Animationen ---------- */
@keyframes ticker { to { transform: translateX(-100%); } }
@keyframes blink { to { visibility: hidden; } }
@keyframes rainbow { to { background-position: 200% center; } }
@keyframes flash { from { background: #ffff80; } to { background: transparent; } }
@keyframes ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-4deg); } }
@keyframes search { 0%, 100% { transform: translateX(-20px); } 50% { transform: translateX(20px); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; }
    .ticker-track { padding-left: 8px; }
}

/* ---------- Rollen: Antrag & Account-Übersicht ---------- */
.badge.reader { background: #555; }
.badge.new-req { background: #c00000; }
.role-badge { display: inline-block; padding: 1px 6px; font-size: 11px; font-weight: bold; white-space: nowrap; box-shadow: var(--etched); }
.role-badge.vh { background: #ffe36e; }
.role-badge.leser { background: #fff; }
.role-dialog { max-width: 560px; }
.role-table { width: 100%; border-collapse: collapse; background: #fff; box-shadow: var(--sunken); font-size: 12px; }
.role-table th, .role-table td { padding: 4px 6px; border-bottom: 1px dotted var(--shadow); text-align: center; }
.role-table th:first-child, .role-table td:first-child { text-align: left; }
.request-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.request { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px; background: #fff; box-shadow: var(--sunken); }
.request-text { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.request-text blockquote, .role-dialog blockquote { margin: 4px 0 0; padding: 4px 8px; border-left: 4px solid var(--shadow); background: rgba(0, 0, 0, .05); overflow-wrap: anywhere; }
.request-tools { display: flex; gap: 4px; }
.table-scroll { overflow-x: auto; }
.account-table { width: 100%; border-collapse: collapse; background: #fff; box-shadow: var(--sunken); }
.account-table th { position: sticky; top: 0; padding: 4px 6px; background: var(--face); text-align: left; white-space: nowrap; box-shadow: var(--raised); }
.account-table td { padding: 4px 6px; border-bottom: 1px dotted var(--shadow); white-space: nowrap; vertical-align: middle; }
.account-table tr.is-reader td:first-child { opacity: .85; }
.account-table .role-action { text-align: right; }

/* ---------- Umfragen & Aktualisieren ---------- */
.refresh-btn { flex-shrink: 0; min-width: 0; padding: 2px 6px; }
.poll { margin: 12px 0 4px; padding: 8px 10px; background: rgba(255, 255, 255, .55); color: #000; box-shadow: var(--sunken); font-family: var(--ui-font); font-size: 12px; }
.poll-q { margin-bottom: 6px; font-weight: bold; font-size: 13px; overflow-wrap: anywhere; }
.poll-opt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; padding: 4px 2px; border-top: 1px dotted var(--shadow); cursor: pointer; }
.poll-opt.mine .poll-text { font-weight: bold; }
.poll-text { grid-column: 2; grid-row: 1; overflow-wrap: anywhere; }
.poll-bar { grid-column: 2; height: 8px; background: rgba(0, 0, 0, .1); box-shadow: var(--sunken); }
.poll-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--title-a), var(--title-b)); }
.poll-n { grid-column: 3; grid-row: 1; white-space: nowrap; font-size: 11px; }
.poll-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; }
.poll-editor { display: flex; flex-direction: column; gap: 6px; }

/* ---------- Tierlists (Vorlage: klassisches S-E-Tierlist-Bild) ---------- */
.tierlist { --tier-h: 90px; display: flex; flex-direction: column; gap: 2px; padding: 2px; background: #000; }
.tier-row { display: flex; min-height: var(--tier-h); background: #1a1a17; }
.tier-label { position: relative; flex: 0 0 110px; min-width: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 6px; color: #333; font: 24px/1.1 Arial, Helvetica, sans-serif; text-align: center; }
/* Text-Felder mit fester Größe: retro.js verkleinert die Schrift, bis alles hineinpasst */
.tier-label-text { display: block; width: 100%; max-height: calc(var(--tier-h) - 12px); overflow: hidden; overflow-wrap: normal; word-break: normal; }
.tier-label-text.tight, .tier-item .tier-text.tight { overflow-wrap: anywhere; }
.tier-items { flex: 1; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 3px; min-width: 0; padding: 3px; }
.tier-item { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 80px; height: 80px; overflow: hidden; background: #e8e8e8; color: #111; font: bold 11px/1.2 var(--ui-font); text-align: center; box-shadow: var(--raised); user-select: none; -webkit-user-select: none; }
.tier-item img { width: 100%; height: 100%; object-fit: cover; }
.tier-item .tier-text { padding: 4px; overflow-wrap: normal; }
.tier-item:not(.has-img) .tier-text { display: block; width: 100%; max-height: 100%; overflow: hidden; font-size: 15px; line-height: 1.1; }
/* Bildunterschrift im Meme-Stil: weiß, schwarzer Rand, Impact (Anton als Ersatz auf Handys) */
.tier-item.has-img .tier-text { position: absolute; left: 0; right: 0; bottom: 2px; padding: 0 2px; color: #fff;
    max-height: 60%; overflow: hidden;
    font: 13px/1.05 Impact, Anton, 'Arial Narrow', sans-serif; letter-spacing: .3px; overflow-wrap: normal;
    -webkit-text-stroke: .6px #000; paint-order: stroke fill;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 0 1px 0 #000, 0 -1px 0 #000, 1px 0 0 #000, -1px 0 0 #000; }
.tier-pool { min-height: 90px; padding: 3px; background: #1a1a17; display: flex; flex-wrap: wrap; gap: 3px; }
.tier-embed { margin: 10px 0; }
.tier-embed > a, .tier-embed > b { display: block; margin-bottom: 4px; font-weight: bold; }
.tier-links, .tier-overview { margin: 0 0 8px; padding-left: 18px; }
.tier-overview li { margin: 6px 0; }
.tier-overview-title { font-weight: bold; font-size: 13px; }
.tier-item.has-img .tier-text.tight { overflow-wrap: anywhere; }
/* Editor */
.tier-editor { display: flex; flex-direction: column; gap: 6px; }
.tier-editor .tier-item { cursor: grab; touch-action: none; }
.tier-editor .tier-label { padding-bottom: 20px; }
.tier-editor .tier-label-text { max-height: calc(var(--tier-h) - 26px); cursor: pointer; }
.tier-editor .tier-label-text:hover, .tier-editor .tier-label-text:focus { outline: 1px dashed #333; outline-offset: 1px; }
/* input.… schlägt die Handy-Regel für Farbfelder (sonst 120×38 px über dem Namen) */
.tier-editor input.tier-color { position: absolute; bottom: 3px; left: 4px; width: 30px; height: 15px; max-width: none; padding: 0; border: 0; background: none; box-shadow: none; cursor: pointer; }
.tier-row-del { position: absolute; bottom: 2px; right: 2px; padding: 0 2px; border: 0; background: none; font-size: 11px; cursor: pointer; opacity: .6; }
.tier-del { position: absolute; top: 0; right: 0; width: 18px; height: 18px; padding: 0; border: 0; background: rgba(0, 0, 0, .6); color: #fff; font: bold 12px/18px Arial, sans-serif; cursor: pointer; }
.tier-item.dragging { opacity: .3; }
.tier-ghost { position: fixed; z-index: 300; pointer-events: none; opacity: .85; transform: rotate(-3deg); }
.drop-hover { outline: 2px dashed #fff; outline-offset: -3px; }
.tier-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tier-add .field { flex: 1 1 180px; min-width: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .layout, .editor-grid, .zone-edit-grid { grid-template-columns: minmax(0, 1fr); }
    .zone-cols, .zone-cols.layout-left { grid-template-columns: minmax(0, 1fr); }
    .zone-cols.layout-left .zone-side { order: 0; }
    .zone-preview-wrap { position: static; }
}
/* Touch-Geräte: 16px in Feldern verhindert das automatische Reinzoomen (iOS), größere Tippflächen */
@media (max-width: 640px), (pointer: coarse) {
    .field, input.field[type="file"] { font-size: 16px; min-height: 36px; }
    select.field { padding-right: 26px; }
    .btn { min-height: 34px; padding: 4px 12px; }
    .btn:active { padding: 5px 11px 3px 13px; }
    .btn.mini { min-height: 32px; padding: 2px 9px; font-size: 13px; }
    .vote-btn { width: 34px; min-height: 30px !important; font-size: 12px; }
    .vote.inline .vote-btn { width: 30px; min-height: 28px !important; font-size: 11px; }
    .score { font-size: 11px; }
    .tb-btn { width: 24px; height: 22px; }
    details.reply > summary { padding: 6px 4px 6px 0; font-size: 13px; }
    .comments > summary, .gallery-add > summary, .pro > summary,
    .admin-box > summary, .closed-suggestions > summary { padding: 6px 0; }
    input[type="color"] { width: 100%; max-width: 120px; height: 38px; }
    input[type="checkbox"] { width: 20px; height: 20px; }
    input[type="range"] { flex: 1; min-width: 0; }
    .calendar td, .calendar th { padding: 6px 0; }
    .start-menu nav a { padding: 10px 14px; font-size: 14px; }
}

@media (max-width: 640px) {
    body {
        padding: calc(4px + env(safe-area-inset-top, 0px)) max(4px, env(safe-area-inset-right, 0px))
                 calc(50px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px));
    }
    .main-window, .zone-window { padding: 2px; }
    .window-body { padding: 6px; }

    /* Menü als wischbare Leiste statt drei Zeilen */
    .menubar { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .menubar::-webkit-scrollbar { display: none; }
    .menubar a, .menubar-right { flex-shrink: 0; white-space: nowrap; padding: 8px 9px; font-size: 13px; }
    .menubar-right { margin-left: 0; }
    .toolbar label { display: none; }
    .toolbar .address { gap: 4px; }

    .masthead { padding: 14px 8px 12px; }
    .logo-br { display: inline; }
    .tagline { font-size: 15px; }
    .sticker { display: none; }
    .layout { padding: 6px 2px; gap: 8px; }

    .search-grid { grid-template-columns: minmax(0, 1fr); }
    .search-anim { display: none; }
    .post-grid { grid-template-columns: 38px minmax(0, 1fr); gap: 4px; padding: 4px 2px; }
    .post-paper { padding: 10px; }
    .post-title { font-size: 1.35em; }
    .post-foot, body.zone .post-foot { padding-left: 2px; }
    .post-foot .inline { margin-left: 0; }
    .comments, body.zone .comments { margin-left: 2px; margin-right: 2px; }
    .children { margin-left: 2px; padding-left: 8px; }
    .comment-form, .suggest-form { flex-direction: column; align-items: stretch; }
    .tb-meta { display: none; }
    .post-time { display: inline; }

    .zone-topnav { gap: 4px; }
    .zone-topnav .btn { flex: 1 1 auto; }
    .zone-banner { min-height: 120px; padding: 10px; }
    .zone-banner.has-image { min-height: 160px; }
    .zone-cols { padding: 8px 6px; }
    .avatar { width: 72px; height: 72px; }
    .zone-sub { font-size: 17px; }

    .zone-preview-wrap { order: -1; }
    .zp-desk { min-height: 0; padding: 10px; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .form-grid.colors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .image-row { align-items: flex-start; }
    .thumb { width: 52px; height: 52px; }
    .editor-actions .btn { flex: 1 1 auto; }

    .dialog { margin: 10px auto; }
    .dialog-icon { font-size: 28px; }
    .row-label { grid-template-columns: minmax(0, 1fr); }
    .suggestion { grid-template-columns: 38px minmax(0, 1fr); padding: 6px; }
    .follow-row { grid-template-columns: minmax(0, 1fr); }
    .follow-form { flex: 1 1 100%; }
    .follow-form label { flex: 1; }
    .follow-form select.field { flex: 1; min-width: 0; }
    .follow-label { display: none; }

    /* Account-Tabelle als Karten */
    .account-table, .account-table tbody, .account-table tr, .account-table td { display: block; }
    .account-table thead { display: none; }
    .account-table tr { padding: 6px 8px; border-bottom: 2px solid var(--shadow); }
    .account-table td { display: flex; gap: 8px; padding: 2px 0; border: 0; white-space: normal; }
    .account-table td[data-label]::before { content: attr(data-label); flex: 0 0 96px; color: #555; font-size: 11px; }
    .account-table .role-action { justify-content: flex-start; padding-top: 4px; }
    .request-tools { flex: 1 1 100%; }
    .request-tools form { flex: 1; }
    .request-tools .btn { width: 100%; }

    .tierlist { --tier-h: 62px; }
    .tier-pool { min-height: 62px; }
    .tier-label { flex-basis: 62px; font-size: 18px; padding: 4px; }
    .tier-item { width: 56px; height: 56px; font-size: 9px; }
    .tier-item.has-img .tier-text { font-size: 10px; }
    .tier-item:not(.has-img) .tier-text { font-size: 12px; padding: 2px; }

    .badges { gap: 4px; }
    .tray span[title] { display: none; }
    .task { flex-basis: 140px; }
}
