/*
 * Okamoto shared front-end base.
 *
 * Extracted from prototype/operations.html, which is the first of the four
 * front-end prototypes to be built. BUILD.md Part 1: the colour variables, type
 * scale, button and form styles that repeat across all four live here once;
 * everything screen-specific stays in operations.css, kitchen.css, order.css.
 *
 * Two constraints shape the whole file.
 *
 *   1. **This loads on a themed page.** The prototype styles bare elements —
 *      `button`, `input`, `table` — which on the live site would restyle the
 *      theme's own header and footer. Every rule is therefore scoped under
 *      `.okko`, and every class carries the okko- prefix.
 *   2. **The theme styles our elements too.** A theme's `button { }` is as
 *      global as the prototype's was, so the resets below are not decoration:
 *      without them the screen inherits the theme's buttons and inputs.
 *
 * No build step. Plain CSS, hand-extracted.
 */

.okko {
	--okko-bg: #f6f6f4;
	--okko-surface: #fff;
	--okko-surface-2: #f1efe8;
	--okko-border: #e2e0d8;
	--okko-border-strong: #c9c6ba;
	--okko-text: #1f1f1d;
	--okko-text-2: #5f5e5a;
	--okko-text-3: #8d8b83;
	--okko-green-bg: #eaf3de;
	--okko-green-tx: #3b6d11;
	--okko-green-bd: #c0dd97;
	--okko-red-bg: #fcebeb;
	--okko-red-tx: #a32d2d;
	--okko-red-bd: #f0c1c1;
	--okko-amber-bg: #faeeda;
	--okko-amber-tx: #854f0b;
	--okko-purple-bg: #eeedfe;
	--okko-purple-tx: #534ab7;
	--okko-link: #185fa5;
	--okko-radius: 8px;
	--okko-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

	color: var(--okko-text);
	font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	text-align: left;
}

.okko *,
.okko *::before,
.okko *::after {
	box-sizing: border-box;
}

/* ---------- type ---------- */

.okko .okko-h1 {
	font-size: 21px;
	font-weight: 600;
	line-height: 1.3;
	margin: 0;
	padding: 0;
	color: var(--okko-text);
}

.okko .okko-h2 {
	font-size: 16px;
	font-weight: 600;
	margin: 0;
}

.okko .okko-small {
	font-size: 12.5px;
}

.okko .okko-muted {
	color: var(--okko-text-3);
}

.okko .okko-sub {
	font-size: 13px;
	color: var(--okko-text-3);
}

.okko .okko-sec {
	font-size: 11.5px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--okko-text-3);
	margin: 20px 0 9px;
}

.okko b,
.okko strong {
	font-weight: 600;
}

.okko a {
	color: var(--okko-link);
	text-decoration: none;
}

.okko a:hover {
	text-decoration: underline;
}

/* ---------- buttons ---------- */

.okko button {
	font: inherit;
	font-size: 13px;
	line-height: 1.55;
	padding: 7px 13px;
	margin: 0;
	border: 1px solid var(--okko-border-strong);
	background: var(--okko-surface);
	border-radius: var(--okko-radius);
	cursor: pointer;
	color: var(--okko-text);
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	text-shadow: none;
	width: auto;
	min-height: 0;
	height: auto;
}

.okko button:hover {
	background: var(--okko-surface-2);
	color: var(--okko-text);
}

.okko button:focus-visible {
	outline: 2px solid var(--okko-link);
	outline-offset: 1px;
}

.okko button.okko-primary {
	background: var(--okko-text);
	color: #fff;
	border-color: var(--okko-text);
}

.okko button.okko-primary:hover {
	opacity: 0.87;
	background: var(--okko-text);
	color: #fff;
}

.okko button.okko-danger {
	color: var(--okko-red-tx);
	border-color: var(--okko-red-bd);
}

.okko button.okko-danger:hover {
	background: var(--okko-red-bg);
	color: var(--okko-red-tx);
}

.okko button.okko-icon {
	padding: 5px 8px;
	border-color: transparent;
	background: none;
	color: var(--okko-text-3);
	font-size: 15px;
}

.okko button.okko-icon:hover {
	background: var(--okko-surface-2);
	color: var(--okko-text);
}

.okko button:disabled,
.okko button:disabled:hover {
	opacity: 0.4;
	cursor: not-allowed;
	background: var(--okko-surface);
}

.okko button.okko-primary:disabled,
.okko button.okko-primary:disabled:hover {
	background: var(--okko-text);
}

/* A link that is really a button, so it keeps keyboard behaviour. */
.okko button.okko-link {
	border: 0;
	background: none;
	padding: 0;
	color: var(--okko-link);
	font-size: inherit;
}

.okko button.okko-link:hover {
	background: none;
	text-decoration: underline;
}

/* ---------- forms ---------- */

.okko input,
.okko select,
.okko textarea {
	font: inherit;
	font-size: 14px;
	line-height: 1.55;
	padding: 7px 9px;
	margin: 0;
	border: 1px solid var(--okko-border-strong);
	border-radius: var(--okko-radius);
	background: var(--okko-surface);
	color: var(--okko-text);
	width: 100%;
	max-width: 100%;
	min-height: 0;
	height: auto;
	box-shadow: none;
}

.okko input:focus,
.okko select:focus,
.okko textarea:focus {
	outline: 2px solid var(--okko-link);
	outline-offset: -1px;
	border-color: var(--okko-border-strong);
}

.okko input[type="checkbox"],
.okko input[type="radio"] {
	width: auto;
	min-width: 0;
	margin: 0;
}

.okko input:disabled,
.okko select:disabled {
	background: var(--okko-surface-2);
	color: var(--okko-text-3);
	cursor: not-allowed;
}

.okko label.okko-f {
	display: block;
	font-size: 12px;
	color: var(--okko-text-2);
	margin-bottom: 4px;
	font-weight: 400;
	text-transform: none;
	letter-spacing: normal;
}

.okko label.okko-cb {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	cursor: pointer;
	font-weight: 400;
	margin: 0;
}

/* ---------- layout helpers ---------- */

.okko .okko-row {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	align-items: center;
}

.okko .okko-grid {
	display: grid;
	gap: 12px;
}

.okko .okko-grow {
	flex: 1;
	min-width: 180px;
}

.okko .okko-spacer {
	flex: 1;
}

.okko hr.okko-rule {
	border: 0;
	border-top: 1px solid var(--okko-border);
	margin: 34px 0 22px;
	height: 0;
}

/* ---------- cards and lists ---------- */

.okko .okko-card {
	background: var(--okko-surface);
	border: 1px solid var(--okko-border);
	border-radius: 10px;
	overflow: hidden;
}

.okko .okko-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 15px;
	border-bottom: 1px solid var(--okko-border);
	flex-wrap: wrap;
}

.okko .okko-item:last-child {
	border-bottom: 0;
}

.okko .okko-box {
	border: 1px solid var(--okko-border);
	border-radius: var(--okko-radius);
	padding: 12px 13px;
	margin-bottom: 9px;
}

.okko .okko-box.okko-off {
	opacity: 0.55;
}

/* ---------- pills, chips, dots, notes ---------- */

.okko .okko-pill {
	font-size: 11.5px;
	padding: 3px 9px;
	border-radius: 20px;
	background: var(--okko-surface-2);
	color: var(--okko-text-2);
	white-space: nowrap;
}

.okko .okko-pill.okko-ok {
	background: var(--okko-green-bg);
	color: var(--okko-green-tx);
}

.okko .okko-pill.okko-ev {
	background: var(--okko-purple-bg);
	color: var(--okko-purple-tx);
}

.okko .okko-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex: none;
	display: inline-block;
}

.okko .okko-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.okko .okko-chip {
	font-size: 12.5px;
	font-family: var(--okko-mono);
	background: var(--okko-surface-2);
	padding: 4px 7px;
	border-radius: 5px;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	color: var(--okko-text);
}

.okko .okko-chip button {
	border: 0;
	background: none;
	padding: 0 2px;
	font-family: inherit;
	font-size: inherit;
	color: var(--okko-text-3);
	line-height: 1;
}

.okko .okko-chip button:hover {
	background: none;
	color: var(--okko-red-tx);
}

.okko .okko-note {
	font-size: 12.5px;
	color: var(--okko-text-2);
	background: var(--okko-surface-2);
	padding: 10px 12px;
	border-radius: var(--okko-radius);
	margin-top: 12px;
}

.okko .okko-note.okko-warn {
	background: var(--okko-amber-bg);
	color: var(--okko-amber-tx);
}

.okko .okko-note.okko-err {
	background: var(--okko-red-bg);
	color: var(--okko-red-tx);
}

.okko .okko-add {
	color: var(--okko-text-3);
	font-size: 12.5px;
	cursor: pointer;
	border: 1px dashed var(--okko-border-strong);
	border-radius: 6px;
	padding: 5px 9px;
	display: inline-block;
	background: none;
}

.okko .okko-add:hover {
	background: var(--okko-surface-2);
	color: var(--okko-text);
}

/* ---------- tabs ---------- */

.okko .okko-tabs {
	display: flex;
	gap: 2px;
	border-bottom: 1px solid var(--okko-border);
	margin-bottom: 22px;
	flex-wrap: wrap;
}

.okko .okko-tab {
	font-size: 14px;
	padding: 9px 14px;
	border: 0;
	background: none;
	cursor: pointer;
	color: var(--okko-text-2);
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	border-radius: 0;
}

.okko .okko-tab:hover {
	color: var(--okko-text);
	background: none;
}

.okko .okko-tab.okko-on {
	color: var(--okko-text);
	border-bottom-color: var(--okko-text);
	font-weight: 500;
}

.okko .okko-panel {
	display: none;
}

.okko .okko-panel.okko-on {
	display: block;
}

/* ---------- modal ---------- */

.okko .okko-back {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.42);
	display: none;
	align-items: flex-start;
	justify-content: center;
	padding: 28px 16px;
	overflow: auto;
	z-index: 100000;
}

.okko .okko-back.okko-on {
	display: flex;
}

.okko .okko-modal {
	background: var(--okko-surface);
	border-radius: 12px;
	width: 100%;
	max-width: 540px;
	color: var(--okko-text);
}

.okko .okko-mh {
	display: flex;
	align-items: center;
	padding: 14px 18px;
	border-bottom: 1px solid var(--okko-border);
}

.okko .okko-mh b {
	flex: 1;
	font-size: 16px;
	font-weight: 600;
}

.okko .okko-mb {
	padding: 18px;
}

.okko .okko-mf {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	padding: 14px 18px;
	border-top: 1px solid var(--okko-border);
	background: var(--okko-surface-2);
	border-radius: 0 0 12px 12px;
}

/* ---------- utility ---------- */

.okko .okko-stub {
	border: 1px dashed var(--okko-border-strong);
	border-radius: 10px;
	padding: 44px 20px;
	text-align: center;
	color: var(--okko-text-3);
	font-size: 13px;
}

.okko .okko-busy {
	opacity: 0.55;
	pointer-events: none;
}

/* Visible to a screen reader, not to the eye. */
.okko .okko-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
