:root {
  /* Светлая бежевая тема (по цветам мастерской хозяина). */
  --bg: #f6efe2;          /* страница */
  --head: #efe6d4;        /* шапка */
  --panel: #fbf7ee;       /* карточки */
  --panel2: #ece2d0;      /* плитки, второстепенные кнопки */
  --field: #fffdf8;       /* поля ввода */
  --line: rgba(70, 55, 40, .14);
  --text: #2a2431;
  --muted: #7d7361;
  --faint: #a99e88;
  --accent: #6b52e6;
  --accent-hover: #7c5cff;
  --accent-soft: rgba(124, 92, 255, .13);
  --on-accent: #fff;
  --accent2: #b8860b;
  --bad: #d24467;
  --good: #1a9e6f;
  --bad-bg: rgba(210, 68, 103, .1);
  --warn-bg: rgba(184, 134, 11, .12);
  --good-bg: rgba(26, 158, 111, .12);
  --code: rgba(70, 55, 40, .07);
  --shadow: 0 18px 50px -14px rgba(80, 60, 30, .28);
  --radius: 12px;
  color-scheme: light;
}
* { box-sizing: border-box; }
/* Скрытое не показывать, даже если у элемента задан свой display. */
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
.brand { font-weight: 700; letter-spacing: .2px; }
.brand b { color: var(--accent); }
.brand i { color: var(--accent2); font-style: normal; }

header.top {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border-bottom: 1px solid var(--line); background: var(--head);
  position: sticky; top: 0; z-index: 5;
}
header.top .grow { flex: 1; }
header.top .brand { color: var(--text); text-decoration: none; white-space: nowrap; }
header.top .brand .mono { display: none; font-size: 20px; font-weight: 800; letter-spacing: -.5px; }
header.top nav { display: flex; gap: 6px; flex-wrap: nowrap; }
/* Квадратная кнопка-значок: светлая подложка, тонкая рамка; выбранная — зелёная. */
.ib {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center; padding: 0;
  border-radius: 11px; border: 1px solid var(--line); background: var(--field); color: var(--text);
  text-decoration: none; cursor: pointer;
}
.ib:hover:not(:disabled) { background: var(--accent-soft); border-color: rgba(107, 82, 230, .35); }
.ib.on { color: var(--good); background: var(--good-bg); border: 2px solid var(--good); }
.who { color: var(--muted); font-size: 14px; }

main { max-width: 980px; margin: 0 auto; padding: 18px 16px 60px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(80, 60, 30, .06);
}
h1, h2, h3 { margin: 0 0 12px; }
h2 { font-size: 20px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

input, textarea, select {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--field); color: var(--text); font: inherit;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
label { display: block; margin: 10px 0 4px; color: var(--muted); font-size: 14px; }
button, .btn {
  display: inline-block; padding: 10px 16px; border-radius: 10px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 600; text-decoration: none;
}
button:hover:not(:disabled), .btn:hover { background: var(--accent-hover); }
button.ghost:hover:not(:disabled) { background: var(--accent-soft); }
button.ghost { background: var(--panel2); color: var(--text); border: 1px solid var(--line); }
button.small { padding: 6px 10px; font-size: 14px; }
button:disabled { opacity: .5; cursor: default; }

.msg { margin-top: 10px; min-height: 1.4em; }
.msg.bad { color: var(--bad); }
.msg.good { color: var(--good); }

table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 14px; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--panel2); color: var(--muted); }
.tag.owner { color: var(--accent2); }
.tag.off { color: var(--bad); }

.center-page { min-height: 100%; display: grid; place-items: center; padding: 20px; }
.login { width: 100%; max-width: 380px; }
.login .brand { font-size: 24px; margin-bottom: 4px; }

@media (max-width: 640px) {
  header.top { padding: 8px 10px; gap: 6px; }
  header.top .brand .full { display: none; }
  header.top .brand .mono { display: inline; }
  header.top nav { gap: 5px; }
  .ib { width: 38px; height: 38px; border-radius: 10px; }
  .hide-phone { display: none; }
}
/* В шапке восемь кнопок: на телефоне поуже, чтобы «Выйти» не уезжала за край экрана. */
@media (max-width: 430px) { header.top nav { gap: 4px; } header.top .ib { width: 34px; height: 34px; border-radius: 9px; } }
@media (max-width: 360px) { .ib { width: 34px; height: 34px; } header.top .ib { width: 30px; height: 30px; } }

/* Диктовка */
.golos-btn { position: relative; }
.golos-btn.on { background: var(--bad); color: var(--on-accent); animation: pulse 1.2s infinite; }
.golos-n { position: absolute; top: -6px; right: -6px; background: var(--accent2); color: var(--on-accent);
           border-radius: 99px; font-size: 11px; padding: 1px 6px; }
.golos-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px;
             color: var(--accent2); padding: 4px 0 8px; }
.golos-live { flex-basis: 100%; color: var(--muted); font-style: italic; max-height: 6em; overflow: auto; }
.golos-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

details.shelf { border-bottom: 1px solid var(--line); padding: 8px 0; }
details.shelf summary { cursor: pointer; }
details.shelf summary a { font-size: 13px; margin-left: 8px; }
details.shelf ul { margin: 6px 0 2px; padding-left: 22px; }


/* Значки */
.ik { display: block; flex: none; }
.ic-box { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px;
          border: 1px solid var(--line); background: var(--field); color: var(--text); font-size: 22px; }

/* Карточка «Показа» в чате */
.pk-chip { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; padding: 10px 12px;
           background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.pk-btn { display: inline-flex; align-items: center; min-height: 46px; padding: 0 14px; border-radius: var(--radius);
          border: 1px solid var(--line); background: var(--field); color: var(--text); font: inherit; text-decoration: none; cursor: pointer; }
.pk-btn:hover { border-color: rgba(107, 82, 230, .4); }

/* ── Оформление как в Claude: белый фон, тёплая терракотовая метка, шрифты без засечек для интерфейса и с засечками для текста ответов ── */
:root {
  --bg: #ffffff; --head: #ffffff; --panel: #faf9f5; --panel2: #f0eee6; --field: #ffffff;
  --line: #e8e6dc; --text: #141413; --muted: #73726c; --faint: #a9a89f;
  --accent: #c6613f; --accent-hover: #b4553a; --accent-soft: rgba(198, 97, 63, .12); --accent2: #8a6d2f;
  --code: #f0eee6; --shadow: 0 10px 30px -12px rgba(20, 20, 19, .22);
  --serif: "Tiempos Text", "Source Serif 4", "Iowan Old Style", Charter, Georgia, serif;
}
body { font-family: "Styrene B", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; }
header.top { border-bottom: 1px solid var(--line); }
.brand b, .brand i { color: var(--text); }
.ib:hover:not(:disabled) { border-color: rgba(198, 97, 63, .4); }
.pk-btn:hover, .tile:hover { border-color: rgba(198, 97, 63, .45); }

/* Окно предпросмотра справа */
.pk-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(46vw, 760px); z-index: 50; background: #fff;
            border-left: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.pk-ph { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); min-height: 56px; }
.pk-ph b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pk-ph .grow { flex: 1; }
.pk-pb { flex: 1; min-height: 0; overflow: auto; padding: 14px; }
.pk-pb iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.pk-pb img { max-width: 100%; }
.pk-pb pre { white-space: pre-wrap; word-break: break-word; font-size: 13px; margin: 0; }
body.has-panel .chat-wrap { margin-right: min(46vw, 760px); }
@media (max-width: 1000px) { .pk-panel { width: 100vw; } body.has-panel .chat-wrap { margin-right: 0; } }
body { font-size: 14px; }
.pk-empty .pk-hint { color: var(--muted); display: grid; place-items: center; text-align: center; padding: 30px; }

/* Пометка «пришло обновление» под шапкой */
.obn-plashka { display: block; padding: 9px 16px; background: var(--warn-bg, #fff4d6); color: var(--text);
               border-bottom: 1px solid var(--line); text-decoration: none; font-size: 14px; text-align: center; }
.obn-plashka:hover { text-decoration: underline; }
