/* Amber Radio — Community editor */
:root {
	--black: #000;
	--white: #fff;
	--ember: #ee4045;
	--amber: #f47b20;
	--amber-text: #ad4800;
	--surface: #f2f1f0;
	--rule: #d9d6d3;
	--text: #1f1f1f;
	--muted: #5a5a5a;
	--danger: #b42318;
	--ui: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
	--read: "Source Serif 4", Georgia, serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface); color: var(--text); font: 500 18px/1.5 var(--ui); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--amber-text); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.ce-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ce-wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }

/* Top bar */
.ce-top { background: var(--black); color: var(--white); position: relative; }
.ce-top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--ember), var(--amber)); }
.ce-top__inner { display: flex; align-items: center; gap: 16px; min-height: 72px; flex-wrap: wrap; padding-block: 10px 13px; }
.ce-brand { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 1.15rem; }
.ce-brand img { display: block; border-radius: 50%; }
.ce-top__links { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; font-size: .95rem; }
.ce-top__links a { color: var(--white); }

#ce-main { padding-block: 28px 80px; }
.ce-hello h1 { font-size: 2rem; margin: 0; font-weight: 700; }
.ce-muted { color: var(--muted); margin: 4px 0 0; }
.ce-loading { color: var(--muted); padding: 24px 0; }

/* Cards (login, messages) */
.ce-card { background: var(--white); border-radius: 18px; padding: 28px; box-shadow: 0 1px 0 var(--rule); }
.ce-narrow { max-width: 440px; margin: 24px auto; }
.ce-card h1 { margin: 0 0 4px; font-size: 1.8rem; }
.ce-error { background: #fdecea; color: var(--danger); border-radius: 10px; padding: 10px 14px; }
.ce-small { font-size: .95rem; margin-bottom: 0; }

/* Tabs */
.ce-tabs { display: flex; gap: 6px; margin: 26px 0 0; border-bottom: 2px solid var(--black); }
.ce-tabs button {
	border: 0; background: transparent; padding: 12px 20px; font-size: 1.15rem; font-weight: 600; cursor: pointer;
	border-radius: 12px 12px 0 0; color: var(--muted);
}
.ce-tabs button[aria-selected="true"] { background: var(--black); color: var(--white); }
.ce-panel { padding-top: 22px; }

/* Buttons */
.ce-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
	padding: 8px 18px; border-radius: 999px; border: 2px solid var(--black); background: var(--white);
	font-weight: 600; cursor: pointer; text-decoration: none; color: var(--black); white-space: nowrap;
}
.ce-btn:hover { background: var(--black); color: var(--white); }
.ce-btn--primary { background: var(--black); color: var(--white); }
.ce-btn--primary:hover { background: var(--amber); border-color: var(--amber); color: var(--black); }
.ce-btn--big { min-height: 52px; padding: 10px 24px; font-size: 1.08rem; }
.ce-btn--wide { width: 100%; }
.ce-btn--quiet { border-color: transparent; background: transparent; }
.ce-btn--quiet:hover { background: var(--surface); color: var(--black); }
.ce-btn--danger { color: var(--danger); }
.ce-btn--danger.ce-btn--big, .ce-foot-discard .ce-btn--danger { background: var(--danger); border-color: var(--danger); color: var(--white); }
.ce-btn--quiet.ce-btn--danger:hover { background: #fdecea; color: var(--danger); }
.ce-btn:disabled { opacity: .6; cursor: progress; }

/* List toolbar */
.ce-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.ce-search { flex: 1 1 220px; }
.ce-search input, .ce-select select {
	width: 100%; min-height: 52px; border: 2px solid #8a8a8a; border-radius: 999px; padding: 8px 20px; background: var(--white);
}
.ce-select { flex: 0 1 260px; }
.ce-select select { border-radius: 14px; }
.ce-switch { display: inline-flex; margin-top: 16px; background: var(--white); border-radius: 999px; padding: 4px; border: 1px solid var(--rule); }
.ce-switch button { border: 0; background: transparent; padding: 8px 18px; border-radius: 999px; font-weight: 600; cursor: pointer; color: var(--muted); }
.ce-switch button[aria-pressed="true"] { background: var(--black); color: var(--white); }
.ce-count { color: var(--muted); margin: 14px 0 0; }

/* Lists */
.ce-group { font-size: 1.3rem; margin: 28px 0 10px; }
.ce-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.ce-item { display: flex; align-items: center; gap: 16px; background: var(--white); border-radius: 16px; padding: 14px 16px; }
.ce-item__main { flex: 1; min-width: 0; }
.ce-item h3 { margin: 0; font-size: 1.12rem; line-height: 1.3; }
.ce-item p { margin: 2px 0 0; color: var(--muted); font-size: .98rem; }
.ce-item__actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ce-date {
	flex: none; width: 60px; min-height: 60px; border-radius: 12px; background: var(--black); color: #ffb37a;
	display: grid; place-content: center; text-align: center; line-height: 1; font-size: .9rem;
}
.ce-date b { display: block; color: var(--white); font-size: 1.55rem; font-weight: 700; margin-bottom: 3px; }
.ce-tag { display: inline-block; background: #fff1e6; color: var(--amber-text); border-radius: 6px; padding: 0 8px; font-size: .85rem; }
.ce-pill { display: inline-block; background: var(--surface); border-radius: 999px; padding: 1px 10px; font-size: .85rem; margin: 2px 0; }
.ce-empty { background: var(--white); border-radius: 16px; padding: 28px; margin-top: 18px; color: var(--muted); }

@media (max-width: 640px) {
	.ce-item { flex-wrap: wrap; }
	.ce-item--dir .ce-item__main { flex-basis: 100%; }
	.ce-item__actions { width: 100%; justify-content: flex-start; padding-left: 76px; flex-wrap: nowrap; gap: 2px; }
	.ce-item__actions .ce-btn { padding: 6px 14px; min-height: 42px; }
	.ce-item--dir .ce-item__actions { padding-left: 0; }
	.ce-tabs button { flex: 1; padding: 12px 8px; font-size: 1.02rem; }
	.ce-hello h1 { font-size: 1.6rem; }
	.ce-bar .ce-btn--big { width: 100%; }
}

/* Dialog */
.ce-modal-open { overflow: hidden; }
.ce-dialog {
	border: 0; padding: 0; border-radius: 20px; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 40px);
	background: var(--white); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.ce-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.ce-dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.ce-dialog__head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--rule); }
.ce-dialog__head h2 { margin: 0; font-size: 1.4rem; flex: 1; }
.ce-close { border: 0; background: var(--surface); width: 44px; height: 44px; border-radius: 50%; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.ce-dialog__body { padding: 20px 22px; overflow: auto; }
.ce-dialog--small { width: min(480px, calc(100vw - 32px)); }
.ce-dialog--small h2 { margin: 0 0 8px; font-size: 1.35rem; }
.ce-dialog__foot { padding: 14px 22px 18px; border-top: 1px solid var(--rule); background: var(--white); border-radius: 0 0 20px 20px; }
.ce-foot-main, .ce-foot-discard { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ce-foot-discard span { flex: 1 1 100%; font-weight: 600; }
.ce-form-error { color: var(--danger); margin: 0 0 10px; font-weight: 600; }
.ce-note { background: #fff1e6; border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; }

@media (max-width: 640px) {
	.ce-dialog { width: 100vw; max-width: 100vw; height: 100%; max-height: 100%; border-radius: 0; margin: 0; }
	.ce-dialog form { max-height: 100%; height: 100%; }
	.ce-dialog__body { flex: 1; }
	.ce-dialog__foot { border-radius: 0; }
	.ce-dialog--small { height: auto; position: fixed; bottom: 0; top: auto; border-radius: 20px 20px 0 0; }
}

/* Form fields */
.ce-field { margin: 0 0 18px; }
.ce-field label, .ce-label { display: block; font-weight: 600; margin-bottom: 6px; }
.ce-field label span { font-weight: 500; color: var(--muted); }
.ce-field input:not([type=checkbox]), .ce-newcat input {
	width: 100%; min-height: 50px; border: 2px solid #8a8a8a; border-radius: 12px; padding: 10px 14px; background: var(--white);
	font-family: var(--ui); font-weight: 500;
}
.ce-field input:focus, .ce-newcat input:focus { border-color: var(--black); outline: none; box-shadow: 0 0 0 3px rgba(244, 123, 32, .35); }
.ce-hint { color: var(--muted); font-size: .92rem; margin: -2px 0 8px; }
.ce-rte .ce-hint { margin: 6px 0 0; }
.ce-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 520px) { .ce-row { grid-template-columns: 1fr; } }
.ce-check { margin: -6px 0 18px; }
.ce-check label { display: inline-flex; gap: 10px; align-items: center; cursor: pointer; font-weight: 500; }
.ce-check input { width: 22px; height: 22px; accent-color: var(--black); }
.has-error input, .has-error .ce-rte__area, .has-error .ce-chips { border-color: var(--danger) !important; }
.ce-field-error { color: var(--danger); font-weight: 600; margin: 6px 0 0; }

/* Category chips */
.ce-chips { display: flex; flex-wrap: wrap; gap: 8px; border: 2px solid transparent; border-radius: 12px; }
.ce-chip { cursor: pointer; }
.ce-chip input { position: absolute; opacity: 0; }
.ce-chip span { display: inline-block; padding: 7px 14px; border-radius: 999px; border: 2px solid var(--rule); background: var(--white); font-size: .95rem; }
.ce-chip input:checked + span { background: var(--black); border-color: var(--black); color: var(--white); }
.ce-chip input:checked + span::before { content: "✓ "; color: #ffb37a; }
.ce-chip input:focus-visible + span { outline: 3px solid var(--amber); outline-offset: 2px; }
.ce-newcat { display: flex; gap: 8px; margin-top: 12px; max-width: 420px; }

/* Description box */
.ce-rte { margin: 0 0 8px; }
.ce-rte__tools { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.ce-rte__tools button { min-width: 44px; min-height: 40px; border: 2px solid var(--rule); background: var(--white); border-radius: 10px; cursor: pointer; padding: 4px 12px; font-weight: 600; }
.ce-rte__tools button:hover { border-color: var(--black); }
.ce-rte__link { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; background: var(--surface); border-radius: 12px; padding: 10px; margin-bottom: 6px; }
.ce-rte__link label { flex: 1 1 220px; font-weight: 600; font-size: .95rem; }
.ce-rte__link input { display: block; width: 100%; min-height: 44px; border: 2px solid #8a8a8a; border-radius: 10px; padding: 6px 12px; margin-top: 4px; }
.ce-rte__area {
	min-height: 180px; border: 2px solid #8a8a8a; border-radius: 12px; padding: 12px 16px; background: var(--white);
	font: 400 1.05rem/1.6 var(--read); overflow-wrap: anywhere;
}
.ce-rte__area:focus { border-color: var(--black); outline: none; box-shadow: 0 0 0 3px rgba(244, 123, 32, .35); }
.ce-rte__area p { margin: 0 0 .8em; }
.ce-rte__area ul, .ce-rte__area ol { margin: 0 0 .8em; padding-left: 1.4em; }

/* Toasts */
.ce-toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 1000; width: min(560px, calc(100vw - 24px)); }
.ce-toast { display: flex; align-items: center; gap: 14px; background: var(--black); color: var(--white); padding: 12px 18px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.ce-toast span { flex: 1; }
.ce-toast button { background: var(--amber); color: var(--black); border: 0; border-radius: 999px; padding: 6px 16px; font-weight: 700; cursor: pointer; }
.ce-toast--error { background: var(--danger); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
