:root {
  color-scheme: light;
  --accent: #a63d21;
  --selection: #a63d21;
  --canvas: #f2ede7;
  --paper: #fffdf9;
  --card: #fff;
  --inset: #eae3d9;
  --ink: #27221e;
  --muted: #6d6258;
  --line: #ded6cc;
  --hover: #f5efe8;
  --tint: #f8e9df;
  --grid: #d6c9ba;
  --danger: #a5332a;
  --success: #456446;
  --shadow: 0 2px 5px #1e140d14;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
}
:root[data-effective-theme="dark"] {
  color-scheme: dark;
  --accent: #ff956e;
  --canvas: #131110;
  --paper: #191613;
  --card: #1d1916;
  --inset: #241e1a;
  --ink: #f5ede4;
  --muted: #c1b2a5;
  --line: #3e342d;
  --hover: #2c241e;
  --tint: #3b2720;
  --grid: #483a30;
  --danger: #ff9a8a;
  --success: #a6c6a2;
  --shadow: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
button:disabled { opacity: .38; cursor: default; }
button, a, input, textarea, select, summary, [tabindex] { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
svg { vertical-align: middle; flex: none; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.boot { display: flex; min-height: 100dvh; align-items: center; justify-content: center; gap: 10px; }
.boot img { width: 40px; }
.primary, .secondary, .quiet { min-height: 38px; border-radius: 9px; padding: 7px 12px; font-weight: 650; line-height: 1.25; }
.primary { border: 1px solid var(--selection); color: #fff; background: var(--selection); }
.primary:hover:not(:disabled) { background: #89331c; }
.secondary { border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.secondary:hover:not(:disabled) { background: var(--hover); }
.quiet { border: 1px solid transparent; background: transparent; color: var(--muted); text-align: left; }
.quiet:hover:not(:disabled) { color: var(--ink); background: var(--hover); }
.full { width: 100%; }
.danger { color: var(--danger) !important; }
.icon-button { flex: none; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); padding: 0; }
.icon-button:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.icon-button[aria-pressed="true"] { background: var(--tint); color: var(--accent); }
.brand { display: inline-flex; align-items: center; gap: 8px; font: bold italic 25px/1 Georgia, serif; white-space: nowrap; }
.brand img { object-fit: contain; flex: none; }
input, select, textarea { border: 1px solid var(--line); border-radius: 9px; background: var(--inset); padding: 9px 10px; min-width: 0; }
label { display: grid; gap: 6px; font-weight: 600; }
label input, label select { width: 100%; font-weight: 400; }
::placeholder { color: var(--muted); }
.toast { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(22px, env(safe-area-inset-bottom)); z-index: 20; max-width: min(440px, 90vw); border-radius: 14px; padding: 12px 16px; background: var(--card); border: 1px solid var(--line); color: var(--success); box-shadow: var(--shadow); font-weight: 650; }
.toast.error, .form-error { color: var(--danger); }
.form-error { font-size: .94rem; }
.form-note { color: var(--muted); font-size: .91rem; }
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(380px, 1.12fr) minmax(330px, .88fr); }
.auth-side { display: flex; flex-direction: column; justify-content: space-between; gap: 50px; padding: clamp(26px, 5.3vw, 84px); border-right: 1px solid var(--line); }
.auth-side small { color: var(--muted); }
.auth-copy h1, .home h1 { font: 700 clamp(2.7rem, 5.5vw, 6rem)/.99 Georgia, serif; letter-spacing: -.048em; }
.auth-copy h1 span, .home h1 span { color: var(--accent); }
.auth-copy p { margin: 22px 0; color: var(--muted); max-width: 330px; line-height: 1.65; font-size: 1.12rem; }
.auth-figure { width: min(100%, 430px); border-radius: 14px; padding: 12px; background: #fffdf9; border: 1px solid var(--line); transform: rotate(-3deg); box-shadow: var(--shadow); }
.auth-figure svg { width: 100%; height: auto; }
.auth-main { display: grid; place-items: center; padding: 28px; background: var(--paper); }
.auth-card { width: min(100%, 370px); display: grid; gap: 14px; }
.auth-emblem { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; background: var(--tint); }
.auth-card h2 { font: 700 2rem/1.12 Georgia, serif; }
.auth-card p { line-height: 1.5; color: var(--muted); }
.auth-card form { margin-top: 9px; display: grid; gap: 16px; }
.auth-card input { min-height: 45px; font-size: 1rem; }
.auth-card .primary { min-height: 46px; }
.workspace { height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.topbar { position: relative; z-index: 5; display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 65px; padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); background: var(--card); }
.topbar .brand { font-size: 23px; }
.top-divider { width: 1px; height: 26px; background: var(--line); margin: 0 3px; flex: none; }
#sheet-heading { min-width: 0; }
.crumb { color: var(--muted); font-weight: 600; }
.sheet-title input { background: transparent; border-color: transparent; font-weight: 700; width: clamp(140px, 25vw, 420px); padding: 7px; text-overflow: ellipsis; }
.sheet-title input:hover { border-color: var(--line); background: var(--hover); }
.top-spacer { flex: 1; }
#save-state { flex: none; color: var(--success); font-size: .86rem; }
#save-state span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.save-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.save-problem { background: var(--tint); color: var(--danger); padding: 6px; font-size: .84rem; border: 1px solid var(--line); border-radius: 7px; }
.avatar { background: var(--tint); color: var(--accent); font-weight: 750; border: 1px solid var(--line); border-radius: 50%; width: 36px; height: 36px; flex: none; }
.menu { position: relative; z-index: 7; }
.menu summary { display: flex; align-items: center; gap: 6px; list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; right: 0; top: calc(100% + 8px); width: max-content; min-width: 170px; display: grid; gap: 3px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); }
.menu-body button { justify-content: flex-start; padding: 9px 11px; background: transparent; border: 0; border-radius: 7px; }
.menu-body button:hover { background: var(--hover); }
.menu-body hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 2px 0; }
.workspace-body { min-width: 0; min-height: 0; display: grid; grid-template-columns: 242px minmax(0, 1fr); position: relative; }
.sidebar-closed .workspace-body { grid-template-columns: 0 minmax(0, 1fr); }
.sidebar-closed .sheets-sidebar { visibility: hidden; }
.sidebar-backdrop { display: none; }
.sheets-sidebar { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; border-right: 1px solid var(--line); background: var(--canvas); gap: 12px; }
.sidebar-header { display: grid; gap: 11px; padding: 15px 14px 0; }
.sidebar-title { display: flex; align-items: center; justify-content: space-between; }
.sidebar-title h2 { font-size: 1.12rem; }
.sidebar-title .icon-button { width: 31px; height: 31px; background: var(--card); border: 1px solid var(--line); color: var(--accent); }
.search-field { display: flex; align-items: center; gap: 8px; background: var(--inset); color: var(--muted); border-radius: 9px; padding: 0 9px; }
.search-field input { background: transparent; border: 0; font-size: .91rem; padding: 9px 0; }
.sheet-nav { overflow: auto; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 2px 8px; }
.sheet-nav a { display: flex; align-items: center; gap: 9px; min-height: 52px; padding: 6px 8px; border-radius: 10px; }
.sheet-nav a:hover { background: var(--hover); }
.sheet-nav a[aria-current="page"] { background: var(--selection); color: #fff; }
.nav-icon { padding: 7px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; color: var(--accent); }
.sheet-nav a[aria-current="page"] .nav-icon { background: #ffffff1e; border-color: #ffffff2c; color: #fff; }
.nav-meta { min-width: 0; flex: 1; display: grid; gap: 3px; }
.nav-meta strong { font-size: .91rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-meta small { color: var(--muted); font-size: .77rem; }
.sheet-nav a[aria-current="page"] small { color: #fff; opacity: .86; }
.sidebar-empty { color: var(--muted); padding: 10px 8px; font-size: .88rem; }
.sidebar-bottom { display: grid; padding: 9px 10px max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.sidebar-bottom button { justify-content: flex-start; }
#content { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.home { overflow: auto; height: 100%; padding: 34px clamp(16px, 4vw, 60px); }
.home-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, .65fr); gap: 18px; align-items: center; max-width: 1080px; margin: 0 auto; border: 1px solid var(--line); border-radius: 14px; padding: clamp(20px, 4.2vw, 60px); background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.home h1 { font-size: clamp(2.55rem, 5.3vw, 5.7rem); }
.home-top p { font-size: 1.05rem; line-height: 1.65; color: var(--muted); max-width: 36ch; margin: 13px 0 21px; }
.home-art { transform: rotate(-7deg); border-radius: 12px; padding: 5%; background-color: #fffdf9; background-image: radial-gradient(#d8cabc 1px, transparent 1px); background-size: 13px 13px; box-shadow: 0 9px 18px #53332315; border: 1px solid #eadccd; }
.home-art svg { width: 100%; height: auto; }
.templates { max-width: 1080px; margin: 30px auto; }
.templates h2 { margin-bottom: 13px; font: 700 1.54rem Georgia, serif; }
.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.template { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; text-align: left; border-radius: 14px; border: 1px solid var(--line); background: var(--card); padding: 0; overflow: hidden; gap: 0; box-shadow: var(--shadow); }
.template:hover { border-color: var(--accent); }
.template-art { display: block; position: relative; width: 100%; aspect-ratio: 1.85; background: #fffdf9; border-bottom: 1px solid var(--line); }
.template-art svg { position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); }
.template-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 12px; width: 100%; color: var(--accent); }
.template-meta strong, .template-meta small { display: block; }
.template-meta strong { color: var(--ink); }
.template-meta small { margin-top: 4px; color: var(--muted); }
.toolrow { display: flex; flex: none; align-items: center; gap: 10px; min-width: 0; padding: 8px 13px; background: var(--canvas); border-bottom: 1px solid var(--line); }
.tools { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 11px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
.toolrow .tools:first-child { min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.toolrow .tools:first-child .icon-button:first-child:focus-visible { outline-offset: -2px; }
.history-tools { flex: none; }
.tool-spacer { flex: 1; }
.toolrow > .icon-button { border: 1px solid var(--line); background: var(--card); }
.toolrow > .icon-button[aria-expanded="true"] { color: var(--accent); }
.drawing-area { flex: 1; min-height: 0; position: relative; display: flex; background: var(--paper); }
.viewport { flex: 1; min-width: 0; min-height: 0; position: relative; overflow: hidden; touch-action: none; user-select: none; outline-offset: -3px; background-color: var(--paper); background-image: radial-gradient(var(--grid) 1px, transparent 1px); background-size: var(--grid-size, 22px) var(--grid-size, 22px); }
.viewport.grid-off { background-image: none; }
.viewport[data-tool="hand"] { cursor: grab; }
.viewport[data-tool="hand"]:active { cursor: grabbing; }
.viewport[data-tool="rectangle"], .viewport[data-tool="ellipse"], .viewport[data-tool="diamond"], .viewport[data-tool="arrow"], .viewport[data-tool="line"], .viewport[data-tool="draw"] { cursor: crosshair; }
.viewport[data-tool="text"] { cursor: text; }
.viewport[data-tool="erase"] { cursor: cell; }
.drawing { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; }
.selection-box, .marquee, .size-handle { stroke: var(--accent); }
.selection-box { fill: none; pointer-events: none; }
.marquee { fill: var(--tint); fill-opacity: .55; pointer-events: none; }
.size-handle { fill: var(--card); cursor: nwse-resize; }
.label-editor { position: absolute; width: min(200px, calc(100% - 16px)); height: 82px; background: var(--card); border-color: var(--accent); resize: none; }
.empty-canvas { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; pointer-events: none; padding-bottom: 45px; }
.empty-canvas strong { font: 700 clamp(1.3rem, 3vw, 2.05rem) Georgia, serif; color: var(--muted); }
.empty-canvas button { pointer-events: auto; }
.canvas-emblem { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--tint); color: var(--accent); }
.inspector { flex: 0 0 228px; overflow: auto; background: var(--card); border-left: 1px solid var(--line); }
.inspector-head { display: flex; align-items: center; justify-content: space-between; gap: 5px; min-height: 63px; padding: 9px 11px 9px 14px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; }
.inspector-head h2 { margin-top: 3px; font: 700 1.15rem Georgia, serif; }
.eyebrow { font-size: .72rem; color: var(--muted); letter-spacing: .08em; }
.inspector-body { padding: 4px 13px 15px; display: grid; gap: 13px; }
.property { padding: 8px 0 0; }
.property h3 { font-size: .85rem; margin-bottom: 8px; }
.swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.swatch, .custom-color input { width: 22px; height: 23px; padding: 0; border: 1px solid #57453835; border-radius: 6px; background: var(--swatch); }
.swatch[aria-pressed="true"] { outline: 1px solid var(--accent); outline-offset: 2px; }
.swatch.transparent { background: linear-gradient(135deg, transparent 45%, var(--muted) 48%, var(--muted) 53%, transparent 56%); }
.custom-color input { padding: 2px; background: var(--inset); cursor: pointer; }
.segments { display: flex; border: 1px solid var(--line); border-radius: 8px; background: var(--inset); padding: 2px; gap: 2px; }
.segments button { flex: 1 0 0; white-space: nowrap; min-height: 28px; border: 0; border-radius: 6px; background: transparent; font-size: .8rem; padding: 3px; }
.segments button[aria-pressed="true"] { background: var(--card); color: var(--accent); font-weight: 650; box-shadow: var(--shadow); }
.segments button:hover { color: var(--accent); }
.size-label { display: flex; align-items: center; color: var(--muted); margin-top: 8px; font-size: .83rem; }
.size-label input { width: 52px; padding: 4px 6px; }
.view-controls { position: absolute; left: 13px; bottom: 12px; display: flex; gap: 7px; }
.view-controls .icon-button { width: 32px; height: 32px; }
.zoom-label { min-width: 45px; background: transparent; border: 0; padding: 0; font-size: .87rem; font-variant-numeric: tabular-nums; }
.editor-footer { display: flex; justify-content: space-between; gap: 10px; padding: 7px 14px max(7px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; background: var(--canvas); }
dialog { width: min(565px, calc(100vw - 28px)); max-height: 88dvh; overflow: auto; border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--card); color: var(--ink); box-shadow: 0 15px 55px #100b064d; }
dialog::backdrop { background: #1d15116c; backdrop-filter: blur(3px); }
.dialog-inner { padding: 17px; display: grid; gap: 12px; }
.dialog-inner h2 { font: 700 1.6rem Georgia, serif; }
.dialog-inner p { color: var(--muted); line-height: 1.5; }
.dialog-inner .form-error { color: var(--danger); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 7px; flex-wrap: wrap; margin-top: 6px; }
.settings-tabs { display: flex; gap: 5px; border-bottom: 1px solid var(--line); padding-bottom: 7px; }
.settings-tabs button { border: 0; padding: 8px 11px; border-radius: 8px; background: transparent; color: var(--muted); }
.settings-tabs button[aria-pressed="true"] { color: var(--accent); background: var(--tint); font-weight: 650; }
.settings-content { display: grid; gap: 12px; }
.settings-content section { display: grid; gap: 10px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); }
.settings-content h3 { font-size: 1rem; }
.settings-content form { display: grid; gap: 9px; padding: 5px 0; }
.settings-content .inline-form { grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; }
.inline-form .form-error { grid-column: 1 / -1; }
.settings-content details form, .settings-content details p { margin: 8px 0 3px; }
.settings-content summary { color: var(--accent); font-weight: 600; }
.setting-row, .copy-field, .about, .row-actions { display: flex; align-items: center; gap: 7px; }
.setting-row { justify-content: space-between; padding: 7px 0; }
.setting-row + .setting-row { border-top: 1px solid var(--line); }
.setting-row small { display: block; margin-top: 3px; color: var(--muted); }
.row-actions { flex-wrap: wrap; justify-content: flex-end; }
.copy-field input { min-width: 0; }
.about { font: bold italic 21px Georgia, serif; }
.about small { margin-left: auto; color: var(--muted); font: 400 .86rem system-ui, sans-serif; }
.about img { width: 30px; height: 30px; }

@media (max-width: 1050px) {
  .workspace-body { grid-template-columns: 207px minmax(0,1fr); }
  .inspector { flex-basis: 211px; }
  .toolrow { gap: 5px; }
}
@media (max-width: 899px) {
  .inspector { position: absolute; right: 8px; top: 8px; z-index: 2; width: 216px; max-height: calc(100% - 64px); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
}
@media (max-width: 759px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 16px 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-copy, .auth-side small { display: none; }
  .auth-main { align-items: start; padding: 38px 20px; }
  .workspace-body, .sidebar-closed .workspace-body { grid-template-columns: minmax(0,1fr); }
  .sheets-sidebar { position: absolute; z-index: 4; inset: 0 auto 0 0; width: min(252px, 85vw); }
  .sidebar-backdrop { display: block; position: absolute; z-index: 3; inset: 0; background: #1d151148; border: 0; }
  .topbar { gap: 5px; padding-right: 9px; padding-left: 9px; min-height: 59px; }
  .topbar .brand { font-size: 19px; gap: 3px; }
  .topbar .brand img { width: 27px; height: 27px; }
  .topbar .top-divider { margin: 0; height: 20px; }
  .topbar .sheet-title input { width: 100%; min-width: 30px; }
  #save-state span { font-size: 0; }
  #save-state .save-dot, #save-state svg { margin-right: 2px; }
  .menu summary { min-height: 33px; padding: 6px; }
  .menu summary span, .menu summary svg:last-child { display: none; }
  .avatar { width: 30px; height: 30px; }
  .home { padding: 18px 14px; }
  .home-top { padding: 18px; }
  .toolrow { padding: 6px 7px; flex-wrap: wrap; }
  .toolrow .tools:first-child { flex: 1 0 100%; }
  .toolrow .icon-button { width: 33px; height: 33px; }
}
@media (max-width: 500px) {
  .home-top { grid-template-columns: 1fr; }
  .home-art { display: none; }
  .template-grid { grid-template-columns: 1fr; }
  .template { display: grid; grid-template-columns: 110px 1fr; min-height: 80px; }
  .template-art { height: 100%; min-height: 80px; border-bottom: 0; border-right: 1px solid var(--line); }
  .template-meta { padding: 9px; }
  .topbar .brand span { display: none; }
  .hint { display: none; }
  .settings-content .inline-form { grid-template-columns: 1fr; }
}

.oauth-screen { display: grid; place-items: center; min-height: 100dvh; padding: 16px; }
.oauth-card { width: min(100%, 480px); display: grid; gap: 14px; padding: clamp(18px, 5vw, 32px); border-radius: 14px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
.oauth-card .brand { width: fit-content; margin-bottom: 3px; }
.oauth-card h1 { font: 700 clamp(1.65rem, 6vw, 2rem)/1.15 Georgia, serif; overflow-wrap: anywhere; }
.oauth-card p { color: var(--muted); line-height: 1.5; }
.oauth-card .form-error { color: var(--danger); }
.oauth-target { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; padding: 10px 12px; border-radius: 9px; background: var(--inset); overflow-wrap: anywhere; }
.oauth-card button, .oauth-back { min-height: 44px; }
.oauth-back { display: inline-flex; align-items: center; justify-content: center; }
.oauth-card > .quiet { justify-self: end; }

/* ---- 0.2.0: neue Editor-Funktionen ---- */
.rotate-handle { fill: var(--card); stroke: var(--accent); cursor: grab; }
.rotate-line { stroke: var(--accent); pointer-events: none; }
.group-box { fill: none; stroke: var(--accent); stroke-dasharray: 5 4; opacity: .55; pointer-events: none; }
.guide { stroke: #d6336c; stroke-dasharray: 4 3; pointer-events: none; }
.bind-target > :not(.hit) { filter: drop-shadow(0 0 5px var(--accent)); }
.is-locked { cursor: default; }
.mini-row { display: flex; flex-wrap: wrap; gap: 4px; }
.mini { width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.mini:hover:not(:disabled) { background: var(--hover); color: var(--accent); }
.mini:disabled { opacity: .4; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.two-col label { display: grid; gap: 4px; font-size: .8rem; color: var(--muted); }
.layer-pick { margin-top: 8px; }
.layers-panel .layer-row { display: flex; align-items: center; gap: 4px; padding: 2px 0; }
.layers-panel .layer-name { flex: 1; display: flex; justify-content: space-between; align-items: center; min-height: 30px; border: 1px solid transparent; border-radius: 7px; background: transparent; padding: 3px 8px; font-size: .82rem; }
.layers-panel .layer-row.active .layer-name { border-color: var(--accent); background: var(--tint); color: var(--accent); font-weight: 650; }
.layers-panel .layer-name small { color: var(--muted); }
.layers-panel .mini { width: 28px; height: 28px; border-color: transparent; background: transparent; }
.drop-hint { position: absolute; inset: 12px; display: grid; place-items: center; border: 2px dashed var(--accent); border-radius: 14px; background: color-mix(in srgb, var(--card) 80%, transparent); color: var(--accent); font-weight: 650; pointer-events: none; z-index: 5; }
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 99px; background: var(--tint); color: var(--accent); font-size: .78rem; font-weight: 650; }
.share-button { display: inline-flex; align-items: center; gap: 6px; }
.public-title { font: 700 1.05rem Georgia, serif; margin-right: 8px; }
.template[data-own] { position: relative; }
.template-open { display: flex; flex-direction: column; align-items: stretch; text-align: left; padding: 0; border: 0; background: transparent; }
.template-delete { position: absolute; top: 6px; right: 6px; min-height: 30px; padding: 4px 7px; background: var(--card); border: 1px solid var(--line); }
.own-templates { margin-top: 26px; }
.version-preview { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; overflow: auto; max-height: 280px; background: #fffdf9; }
.version-preview svg { display: block; max-width: 100%; height: auto; }
.layer-controls { display: none; }
textarea[name="code"] { width: 100%; font: 0.85rem ui-monospace, Menlo, monospace; }
@media (max-width: 759px) { .share-button span { display: none; } }

/* 0.2.1: Farbpalette, Ebenen-Panel, Linien-Griffe, Eingabemodus */
.inspector { flex-basis: 248px; }
.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.swatches .swatch { width: 100%; height: auto; aspect-ratio: 1; min-width: 0; }
.swatch[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }
.recent-row { margin-top: 8px; } .recent-row small { display: block; color: var(--muted); margin-bottom: 4px; font-size: .74rem; }
.custom-row { display: flex; align-items: center; gap: 7px; margin-top: 9px; }
.custom-row .custom-color input { width: 34px; height: 30px; }
.hex-input { flex: 1; min-width: 0; padding: 5px 8px; font: .82rem ui-monospace, Menlo, monospace; border: 1px solid var(--line); border-radius: 7px; background: var(--inset); }
.hex-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.input-mode { flex: none; gap: 1px; }
.input-mode button { display: inline-flex; align-items: center; gap: 5px; min-height: 31px; padding: 3px 9px; border: 0; border-radius: 8px; background: transparent; font-size: .8rem; white-space: nowrap; }
.input-mode button[aria-pressed="true"] { background: var(--tint); color: var(--accent); font-weight: 650; box-shadow: inset 0 0 0 1px var(--accent); }
.input-mode[data-effective="pen"] button[data-input="auto"][aria-pressed="true"]::after { content: ' · Stift'; font-weight: 500; }
.input-mode[data-effective="touch"] button[data-input="auto"][aria-pressed="true"]::after { content: ' · Finger'; font-weight: 500; }
.layer-chip { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 37px; padding: 4px 11px; border: 1px solid var(--lc, var(--line)); border-radius: 11px; background: var(--card); box-shadow: var(--shadow); font-size: .82rem; font-weight: 600; max-width: 190px; }
.layer-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--lc, #888); box-shadow: 0 0 0 2px color-mix(in srgb, var(--lc, #888) 28%, transparent); flex: none; }
.layers-panel { border: 1px solid var(--line); border-radius: 11px; padding: 10px 10px 8px; background: var(--inset); }
.layers-panel h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.layers-panel h3 small { font-weight: 500; color: var(--muted); font-size: .76rem; }
.layers-panel.flash { animation: flash 1.2s ease; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.panel-hint { margin: 0 0 7px; color: var(--muted); font-size: .76rem; line-height: 1.35; }
.layers-panel .layer-row { display: flex; align-items: center; gap: 2px; padding: 2px 3px; border-radius: 8px; border-left: 4px solid var(--lc); background: var(--card); margin-bottom: 4px; }
.layers-panel .layer-row.active { background: color-mix(in srgb, var(--lc) 14%, var(--card)); box-shadow: 0 0 0 1.5px var(--lc); }
.layers-panel .layer-row.off { opacity: .55; }
.layers-panel .layer-dot-btn { width: 26px; height: 28px; padding: 0; border: 0; background: transparent; }
.layers-panel .layer-name { flex: 1; min-width: 0; padding: 3px 4px; border: 1px solid transparent; background: transparent; color: var(--ink); font-weight: 600; }
.layers-panel .layer-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layers-panel .layer-row.active .layer-name { border-color: transparent; background: transparent; color: var(--ink); }
.layers-panel .layer-name small { margin-left: 6px; padding: 0 6px; border-radius: 99px; background: var(--inset); }
.layers-panel .mini { width: 26px; height: 28px; }
.layer-rename { flex: 1; min-width: 0; padding: 4px 6px; border: 1px solid var(--accent); border-radius: 6px; background: var(--card); }
.check-row { display: flex; align-items: center; gap: 7px; margin: 6px 2px 4px; font-size: .8rem; color: var(--muted); }
.sub { margin-top: 10px; }
.layer-pick { display: flex; gap: 4px; margin-top: 6px; }
.layer-pick-btn { flex: 1; min-height: 28px; padding: 2px 0; border: 1px solid var(--lc); border-radius: 7px; background: var(--card); font-size: .76rem; font-weight: 600; color: var(--ink); }
.layer-pick-btn[aria-pressed="true"] { background: var(--lc); color: #fff; }
.layer-tag { stroke: none; } .layer-tag-text { fill: #fff; font-weight: 700; pointer-events: none; font-family: system-ui, sans-serif; }
.layer-mark { fill: none; pointer-events: none; opacity: .85; }
.line-handle, .bend-handle, .via-handle, .via-add-handle { fill: var(--card); stroke: var(--accent); cursor: grab; touch-action: none; }
.line-handle.bound { fill: var(--accent); }
.bend-handle { fill: var(--tint); }
.via-handle { fill: var(--accent); }
.via-add-handle { opacity: .6; stroke-dasharray: 2 2; }
.line-section .size-label { margin-top: 9px; }
.line-section .secondary { margin-top: 9px; }
@media (max-width: 900px) { .input-mode span { display: none; } .layer-chip { max-width: 130px; } }
.inspector-body > * { min-width: 0; }
.check-row input { width: auto; flex: none; margin: 0; }
.inspector { flex-basis: 272px; }
.layers-panel .layer-dot-btn { width: 22px; }
.layers-panel .mini { width: 24px; }
.layers-panel .layer-name { font-size: .84rem; }
@media (max-width: 1260px) {
  .toolrow { flex-wrap: wrap; }
  .toolrow .tools:first-child { flex: 1 0 100%; }
}
