/* Clouy-Kundenbereich: gleiche Farben und Schriften wie clouy.app */
:root {
  --bg: #ededeb; --surface: #f6f6f4; --surface-2: #ffffff; --ink: #111111; --ink-2: #3a3a38;
  --muted: #74746f; --faint: #b9b9b5; --line: rgba(17,17,17,.09); --line-2: rgba(17,17,17,.16);
  --btn: #111111; --on-btn: #ffffff; --ok: #1f7a4d; --ok-bg: rgba(31,122,77,.09); --err: #b42318;
  --warn: #a84e0b; --warn-bg: rgba(240,138,36,.12);
  --shadow: 0 1px 2px rgba(17,17,17,.05), 0 4px 16px rgba(17,17,17,.04);
  --f-sans: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --f-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --r: 14px; --r-sm: 9px; --logo-ink: #0e2f36; --logo-core: #f08a24;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d0d; --surface: #151515; --surface-2: #1c1c1c; --ink: #f2f2f0; --ink-2: #c9c9c5;
    --muted: #8f8f89; --faint: #4a4a47; --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.16);
    --btn: #f2f2f0; --on-btn: #111111; --ok: #4cc38a; --ok-bg: rgba(76,195,138,.1); --err: #ff7a6b;
    --warn: #f5a85c; --warn-bg: rgba(240,138,36,.14);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.25); --logo-ink: #f4f1ea;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--f-sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 500; letter-spacing: -.01em; margin: 0; line-height: 1.15; }
h1 { font-size: 34px; } h2 { font-size: 30px; } h3 { font-size: 20px; margin-bottom: 10px; }
a { color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.fine { font-size: 13px; color: var(--muted); }
svg { width: 20px; height: 20px; flex: none; }
.logo { width: 112px; height: 29px; display: block; }

input, textarea, select {
  width: 100%; font: inherit; color: inherit; background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: var(--r-sm); padding: 11px 13px; outline: none; transition: border-color .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--ink); }
textarea { resize: vertical; }
label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  background: var(--btn); color: var(--on-btn); font: 600 14px var(--f-sans); padding: 11px 18px; border-radius: 999px;
  transition: opacity .15s, transform .15s; text-decoration: none; white-space: nowrap;
}
.btn:hover { opacity: .88; } .btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.icon { width: 42px; height: 42px; padding: 0; }
.btn.small { padding: 7px 13px; font-size: 13px; }
.link { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--ink); }

.notice { border-radius: var(--r-sm); padding: 12px 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; }
.notice.ok { background: var(--ok-bg); box-shadow: none; }
.notice.slim { margin: 0 auto 10px; max-width: 760px; width: calc(100% - 32px); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }

/* Anmeldung */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 20px; padding: 36px 32px; box-shadow: var(--shadow); }
.login-card .logo { margin-bottom: 30px; }
.login-card h1 { margin-bottom: 10px; }
.login-card form { margin: 24px 0 16px; display: grid; gap: 4px; }
.login-card .btn { margin-top: 12px; width: 100%; }
.login-card .fine { margin: 20px 0 0; }

/* Rahmen */
.shell { display: grid; grid-template-columns: 248px 1fr; height: 100%; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 22px; overflow-y: auto; }
.side .logo { margin: 2px 8px; }
.company { padding: 0 8px; display: grid; gap: 6px; justify-items: start; }
.company-name { font-family: var(--f-display); font-size: 20px; line-height: 1.2; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--line); }
.nav a.active { background: var(--ink); color: var(--bg); }
.nav svg { width: 19px; height: 19px; }
.me { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.me-email { font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.me .link { justify-self: start; }
.main { overflow-y: auto; height: 100%; position: relative; }

.page { max-width: 980px; margin: 0 auto; padding: 44px 32px 64px; display: grid; gap: 20px; }
.page-head { display: grid; gap: 8px; margin-bottom: 8px; }
.page-head p { max-width: 640px; margin: 0; }
.card { background: var(--surface); border-radius: var(--r); padding: 22px 24px; box-shadow: var(--shadow); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.actions { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.checklist { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 6px; }

/* Fortschritt */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.steps li { display: grid; gap: 8px; font-size: 13px; color: var(--muted); }
.steps li::before { content: ""; height: 4px; border-radius: 4px; background: var(--line-2); }
.steps li.done { color: var(--ink); }
.steps li.done::before { background: var(--ink); }
.steps li.now { color: var(--ink); font-weight: 600; }
.steps li.now::before { background: linear-gradient(90deg, var(--logo-core) 50%, var(--line-2) 50%); }

/* Upload */
.drop { display: grid; place-items: center; align-content: center; gap: 6px; text-align: center; border: 1.5px dashed var(--line-2); border-radius: var(--r); padding: 28px; cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; min-height: 200px; font-size: 15px; font-weight: 400; margin: 0; }
.drop svg { width: 30px; height: 30px; margin-bottom: 6px; }
.drop .muted { font-size: 13px; }
.drop:hover, .drop.over { border-color: var(--ink); background: var(--surface-2); }
.upl { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 14px; padding: 8px 0; }
.bar { grid-column: 1 / -1; height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink); width: 0; transition: width .2s; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table td { padding: 11px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.table tr:first-child td { border-top: 0; }
.table td:first-child { padding-left: 0; } .table td:last-child { padding-right: 0; text-align: right; }
.table .name { font-weight: 500; word-break: break-word; }
.tag { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tag.ok { color: var(--ok); } .tag.err { color: var(--err); } .tag.warn { color: var(--warn); }

/* Verbindungen */
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.conn { background: var(--surface); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); display: grid; gap: 10px; align-content: start; }
.conn-top { display: flex; align-items: center; gap: 12px; }
.conn-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--bg); font-family: var(--f-display); font-size: 18px; }
.conn h3 { font-size: 18px; margin: 0; }
.conn p { margin: 0; font-size: 14px; color: var(--muted); }
.conn .foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.conn.soon { box-shadow: inset 0 0 0 1px var(--line); background: transparent; }

/* Regeln */
.rule-table { display: grid; gap: 0; margin-bottom: 18px; }
.rule { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; align-items: baseline; }
.rule:first-child { border-top: 0; }
.rule-tag { font-weight: 600; color: var(--warn); }
.rule-tag.ok { color: var(--ok); } .rule-tag.no { color: var(--err); }
.switch { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; font-size: 14px; font-weight: 400; cursor: pointer; padding-top: 16px; border-top: 1px solid var(--line); margin: 0; }
.switch input { position: absolute; opacity: 0; width: 0; }
.track { width: 40px; height: 24px; border-radius: 24px; background: var(--line-2); position: relative; transition: background .15s; margin-top: 2px; }
.track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--ink); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--logo-core); outline-offset: 2px; }

/* Verwaltung */
.inline-form { display: flex; gap: 12px; }
.inline-form input { flex: 1; }
.company-card { display: grid; gap: 14px; }
.company-card .top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.company-card select { width: auto; }
.people { display: grid; gap: 6px; font-size: 14px; }
.people div { display: flex; justify-content: space-between; gap: 10px; }
.add-person { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; }

/* Chat */
.chat-view { display: flex; flex-direction: column; height: 100%; }
.chat { flex: 1; overflow-y: auto; padding: 40px 16px 20px; }
.chat > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.chat-empty { padding-top: 8vh; display: grid; gap: 12px; }
.ideas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.ideas button { text-align: left; font: inherit; font-size: 14px; color: var(--ink-2); background: var(--surface); border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--r); padding: 14px 16px; cursor: pointer; line-height: 1.4; }
.ideas button:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.msg { margin-bottom: 18px; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { display: flex; justify-content: flex-end; }
.msg.user span { background: var(--ink); color: var(--bg); padding: 10px 15px; border-radius: 18px 18px 4px 18px; max-width: 80%; }
.msg.assistant { padding-right: 10%; }
.msg.thinking { color: var(--muted); }
.msg.thinking::after { content: "…"; animation: dots 1.2s steps(4) infinite; display: inline-block; width: 1em; overflow: hidden; vertical-align: bottom; }
@keyframes dots { from { width: 0; } to { width: 1em; } }
.composer { display: flex; gap: 10px; align-items: flex-end; max-width: 760px; width: calc(100% - 32px); margin: 0 auto 22px; background: var(--surface-2); border-radius: 22px; padding: 8px 8px 8px 18px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.composer textarea { border: 0; padding: 10px 0; background: transparent; resize: none; max-height: 200px; }

/* Aktionskarte (Mail oder Slack zur Freigabe) */
.act { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); margin-bottom: 18px; overflow: hidden; }
.act-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.act-head .state { margin-left: auto; }
.act-meta { padding: 12px 16px 0; display: grid; gap: 4px; font-size: 14px; }
.act-meta b { display: inline-block; min-width: 62px; font-weight: 500; color: var(--muted); }
.act textarea { border: 0; border-radius: 0; background: transparent; padding: 12px 16px; min-height: 140px; font-size: 14px; }
.act-body { padding: 12px 16px; white-space: pre-wrap; font-size: 14px; }
.act-foot { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); justify-content: flex-end; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 10; box-shadow: var(--shadow); }

/* Handy */
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .logo { width: 86px; height: 22px; margin: 0; }
  .company { display: flex; align-items: center; padding: 0; gap: 8px; margin-left: auto; }
  .company-name { font-size: 15px; font-family: var(--f-sans); font-weight: 600; }
  .nav { order: 3; width: 100%; display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; margin: 0 -4px; }
  .nav a { padding: 7px 11px; font-size: 14px; white-space: nowrap; }
  .nav svg { display: none; }
  .me { order: 4; width: 100%; display: flex; justify-content: space-between; border-top: 0; padding: 0; margin: 0; }
  .me-email { color: var(--muted); }
  .page { padding: 28px 16px 48px; }
  h1 { font-size: 28px; } h2 { font-size: 25px; }
  .grid2, .ideas, .add-person { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(5, minmax(0, 1fr)); font-size: 11px; }
  .steps li { font-size: 11px; }
  .rule { grid-template-columns: 1fr; gap: 2px; }
  .chat { padding-top: 24px; }
  .chat-empty { padding-top: 2vh; }
  .msg.assistant { padding-right: 0; }
  .inline-form { flex-direction: column; }
  .login-card { padding: 28px 22px; }
}
