/* ==========================================================================
   Korp! Amicitia · Siseveeb
   Design: "Amicitia Intra Mockups" (Sülearvuti 1440 + Mobiil 390)
   ========================================================================== */

/* ---- Fonts (self-hosted, no Google requests) ---------------------------- */
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/cormorant-garamond-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/cormorant-garamond-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 600; font-display: swap; src: url(../fonts/cormorant-garamond-latin-600-italic.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 600; font-display: swap; src: url(../fonts/cormorant-garamond-latin-ext-600-italic.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/cormorant-garamond-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/cormorant-garamond-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Mulish"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/mulish-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Mulish"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/mulish-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Mulish"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/mulish-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Mulish"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/mulish-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Mulish"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/mulish-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Mulish"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/mulish-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Mulish"; font-style: normal; font-weight: 800; font-display: swap; src: url(../fonts/mulish-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Mulish"; font-style: normal; font-weight: 800; font-display: swap; src: url(../fonts/mulish-latin-ext-800-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

/* ---- Tokens ------------------------------------------------------------- */
:root {
	--ami-purple: #6C6CB2;
	--ami-purple-600: #5A5AA0;
	--ami-purple-deep: #46467F;
	--ami-purple-ink: #45458A;
	--ami-lilac-200: #D9D9F1;
	--ami-lilac-100: #E8E8FA;
	--ami-lilac-50: #F5F5FD;
	--ami-white: #FFFFFF;
	--ami-ink: #222240;
	--ami-ink-2: #55556F;
	--ami-ink-3: #7B7B93;
	--ami-border: #E7E6F1;
	--ami-border-strong: #D6D5E6;
	--ami-gold-100: #FCF1BE;
	--ami-gold-300: #F7E3A0;
	--ami-gold-ink: #6B581C;
	--ami-gold-logo: #F2DC8E;
	--ami-green: #0E5B3B;
	--ami-green-50: #E9F4EE;
	--ami-green-200: #BCD9C8;
	--ami-grey-100: #EEEEF4;
	--ami-danger: #A3261E;

	--ami-serif: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
	--ami-sans: "Mulish", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	--ami-radius: 22px;
	--ami-radius-sm: 12px;
	--ami-shadow: 0 1px 2px rgba(34, 34, 64, .04), 0 8px 24px rgba(34, 34, 64, .05);
	--ami-sidebar: 288px;
	--ami-gutter: 40px;
	--ami-tabbar-h: 64px;
	color-scheme: light;
}

/* ---- Base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.ami {
	margin: 0;
	background: var(--ami-lilac-50);
	color: var(--ami-ink);
	font-family: var(--ami-sans);
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
.ami a { color: var(--ami-purple-ink); text-decoration: none; }
.ami a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ami img { max-width: 100%; height: auto; display: block; }
.ami button { font-family: inherit; }
.ami :focus-visible { outline: 2px solid var(--ami-purple); outline-offset: 2px; border-radius: 8px; }
.ami .ami-btn:focus-visible { border-radius: 999px; }
/* Links that are (or start with) a profile circle: no hover/tap underline under the initials. */
.ami .ami-mheader a, .ami .ami-mheader a:hover, .ami a:has(> .ami-avatar):hover { text-decoration: none; }
.ami [hidden] { display: none !important; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap; }
.ami-skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ami-white); padding: 8px 14px; border-radius: 8px; }
.ami-skip:focus { left: 8px; }
.ami-icon { flex: none; width: 20px; height: 20px; }

/* ---- Launch splash (home-screen app, first open of a session) ------------ */
.ami-splash { display: none; }
html.ami-booting .ami-splash {
	position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
	background: var(--ami-lilac-50); transition: opacity .25s ease, visibility .25s ease;
	animation: ami-splash-out .3s ease 9s forwards; /* safety net if the script never runs */
}
.ami-splash__name { font-family: var(--ami-serif); font-weight: 600; font-size: 22px; color: var(--ami-ink); letter-spacing: .01em; }
html.ami-booting.ami-booted .ami-splash { opacity: 0; visibility: hidden; }
@keyframes ami-splash-out { to { opacity: 0; visibility: hidden; } }

/* ---- Typography --------------------------------------------------------- */
.ami-display, .ami-h1, .ami-h2, .ami-h3, .ami-title { font-family: var(--ami-serif); font-weight: 600; color: var(--ami-ink); margin: 0; letter-spacing: -.005em; line-height: 1.1; }
.ami-display { font-size: clamp(34px, 4.2vw, 46px); line-height: 1.05; }
.ami-display--sm { font-size: clamp(30px, 3.4vw, 40px); }
.ami-h1 { font-size: clamp(30px, 3vw, 38px); }
.ami-h2 { font-size: 26px; }
.ami-h3 { font-size: 22px; }
.ami-title { font-size: 32px; }
.ami-eyebrow, .ami-label { font-family: var(--ami-sans); font-size: 11.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ami-ink-2); }
.ami-label { display: block; margin: 0 0 6px; }
.ami-lead { color: var(--ami-ink-2); margin: 6px 0 0; font-size: 16px; }
.ami-muted { color: var(--ami-ink-3); }
.ami-mt { margin-top: 24px !important; }
.ami-section-title { margin: 32px 0 14px; }
.ami-section-label { margin: 28px 0 12px; }
.ami-prose { line-height: 1.65; }
.ami-prose p { margin: 0 0 12px; }
.ami-prose > :last-child { margin-bottom: 0; }

/* ---- App shell ---------------------------------------------------------- */
.ami-app { min-height: 100vh; }
.ami-sidebar {
	position: fixed; inset: 0 auto 0 0; width: var(--ami-sidebar); z-index: 20;
	display: flex; flex-direction: column;
	background: var(--ami-purple); color: #fff; padding: 22px 16px 16px;
	overflow-y: auto;
}
.ami-sidebar__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 4px 0 26px 16px; }
.ami-logo { display: flex; align-items: center; gap: 14px; min-width: 0; color: #fff !important; text-decoration: none !important; }
.ami-logo__text { min-width: 0; white-space: nowrap; }
.ami-collapse {
	flex: none; display: grid; place-items: center; width: 38px; height: 38px; margin-top: 2px; border: 0; border-radius: 10px;
	background: transparent; color: rgba(255, 255, 255, .85); cursor: pointer; position: relative;
}
.ami-collapse:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.ami-logo__img { width: 32px; height: 44px; object-fit: contain; }
.ami-logo__name { display: block; font-family: var(--ami-serif); font-weight: 600; font-size: 25px; line-height: 1.05; color: var(--ami-gold-logo); }
.ami-logo__sub { display: block; margin-top: 4px; font-size: 11px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: #fff; }

.ami-nav ul { list-style: none; margin: 0; padding: 0; }
.ami-nav__item { margin-bottom: 4px; }
.ami-nav__item > a {
	display: flex; align-items: center; gap: 14px; min-height: 46px; padding: 0 16px; border-radius: 12px;
	color: #fff; font-weight: 800; font-size: 15px; text-decoration: none !important;
	transition: background-color .15s ease;
}
.ami-nav__item > a .ami-icon { opacity: .95; }
.ami-nav__item > a:hover { background: rgba(255, 255, 255, .1); }
.ami-nav__item.is-active > a { background: var(--ami-purple-deep); box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.ami-subnav { margin: 6px 0 8px !important; }
.ami-subnav li a {
	display: block; padding: 8px 16px 8px 50px; border-radius: 10px; margin-bottom: 2px;
	color: rgba(255, 255, 255, .92); font-size: 13.5px; font-weight: 700; text-decoration: none !important;
}
.ami-subnav li a:hover { background: rgba(255, 255, 255, .1); }
.ami-subnav li.is-active a { background: rgba(255, 255, 255, .2); color: #fff; }

.ami-sidebar__foot { margin-top: auto; padding-top: 16px; }
.ami-sidebar__admin { display: flex; align-items: center; gap: 8px; padding: 8px 16px; color: rgba(255,255,255,.85) !important; font-size: 13px; font-weight: 700; }
.ami-sidebar__admin .ami-icon { width: 16px; height: 16px; }
.ami-account { display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 14px; background: rgba(255, 255, 255, .1); }
.ami-account.is-active { background: var(--ami-purple-deep); }
.ami-account__main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 4px; color: #fff !important; text-decoration: none !important; }
.ami-account__text { min-width: 0; }
.ami-account__name { display: block; font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ami-account__role { display: block; font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ami-account__out { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: #fff !important; opacity: .8; }
.ami-account__out:hover { background: rgba(255,255,255,.12); opacity: 1; }
.ami-account__out .ami-icon { width: 18px; height: 18px; }

.ami-main { margin-left: var(--ami-sidebar); min-height: 100vh; display: flex; flex-direction: column; }
.ami-topbar {
	position: sticky; top: 0; z-index: 10;
	display: flex; align-items: center; justify-content: space-between; gap: 24px;
	min-height: 88px; padding: 14px var(--ami-gutter);
	background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.2) blur(6px);
	border-bottom: 1px solid var(--ami-border);
}
.ami-topbar__titles .ami-eyebrow { margin-bottom: 2px; font-size: 11px; }
.ami-search { position: relative; flex: 0 1 390px; }
.ami-search .ami-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ami-ink-2); pointer-events: none; }
.ami-search input {
	width: 100%; height: 44px; padding: 0 18px 0 44px; border-radius: 999px;
	border: 1px solid var(--ami-border-strong); background: var(--ami-lilac-50);
	font: 500 14.5px var(--ami-sans); color: var(--ami-ink);
}
.ami-search input::placeholder { color: var(--ami-ink-3); }
.ami-search input:focus { outline: none; border-color: var(--ami-purple); box-shadow: 0 0 0 3px rgba(108,108,178,.18); background: #fff; }

.ami-content { flex: 1; width: 100%; max-width: 1180px; padding: 28px var(--ami-gutter) 40px; }
.ami-footer { padding: 0 var(--ami-gutter) 28px; max-width: 1180px; }
.ami-support { font-size: 13px; color: var(--ami-ink-3); margin: 0; }

.ami-mheader, .ami-tabdock, .ami-sheet { display: none; }

/* ---- Collapsible sidebar (desktop) -------------------------------------- */
.ami-flyout { display: none; }
@media (min-width: 861px) {
	.ami-sidebar, .ami-main { transition: width .22s cubic-bezier(.2, .8, .2, 1), margin-left .22s cubic-bezier(.2, .8, .2, 1), padding .22s ease; }
	.ami-sidebar { width: var(--ami-sidebar); }
	html.ami-collapsed { --ami-sidebar: 80px; }
	html.ami-collapsed .ami-content, html.ami-collapsed .ami-footer { max-width: 1388px; }
	html.ami-collapsed .ami-sidebar { padding: 22px 12px 16px; overflow: visible; align-items: center; }
	html.ami-collapsed .ami-sidebar__head { flex-direction: column; align-items: center; gap: 14px; padding: 4px 0 26px; }
	html.ami-collapsed .ami-logo__text,
	html.ami-collapsed .ami-nav__label,
	html.ami-collapsed .ami-subnav,
	html.ami-collapsed .ami-account__text,
	html.ami-collapsed .ami-account__out { display: none; }
	html.ami-collapsed .ami-logo { gap: 0; }
	html.ami-collapsed .ami-nav, html.ami-collapsed .ami-sidebar__foot { width: 100%; }
	html.ami-collapsed .ami-nav__item { position: relative; }
	html.ami-collapsed .ami-nav__item > a { justify-content: center; width: 48px; height: 48px; min-height: 48px; padding: 0; margin: 0 auto; }
	html.ami-collapsed .ami-nav__item.is-active > a .ami-icon { color: var(--ami-gold-logo); }
	html.ami-collapsed .ami-sidebar__admin { justify-content: center; width: 48px; height: 40px; padding: 0; margin: 0 auto 6px; border-radius: 10px; position: relative; }
	html.ami-collapsed .ami-sidebar__admin:hover { background: rgba(255,255,255,.12); }
	html.ami-collapsed .ami-account { position: relative; justify-content: center; background: transparent; padding: 0; }
	html.ami-collapsed .ami-account.is-active { background: transparent; }
	html.ami-collapsed .ami-account__main { flex: none; padding: 6px; border-radius: 12px; }
	html.ami-collapsed .ami-account__main:hover, html.ami-collapsed .ami-account.is-active .ami-account__main { background: rgba(255,255,255,.14); }

	/* Tooltips (collapsed only) */
	html.ami-collapsed [data-tip]::after {
		content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%);
		padding: 6px 10px; border-radius: 8px; background: var(--ami-ink); color: #fff; font: 700 12.5px var(--ami-sans);
		white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s ease; z-index: 50;
	}
	html.ami-collapsed [data-tip]:hover::after, html.ami-collapsed [data-tip]:focus-visible::after { opacity: 1; }
	.ami-collapse[data-tip]::after { display: none; }
	html.ami-collapsed .ami-collapse[data-tip]::after { display: block; }
	html.ami-collapsed .ami-nav__item > a[data-tip] { position: relative; }

	/* Flyouts for sections with sub-pages + the account (collapsed only) */
	html.ami-collapsed .has-sub:hover > .ami-flyout,
	html.ami-collapsed .has-sub:focus-within > .ami-flyout,
	html.ami-collapsed .ami-account:hover > .ami-flyout,
	html.ami-collapsed .ami-account:focus-within > .ami-flyout { display: block; }
	.ami-flyout {
		position: absolute; left: calc(100% + 4px); top: -4px; z-index: 60; min-width: 210px; padding: 12px 8px 8px;
		background: #fff; color: var(--ami-ink); border: 1px solid var(--ami-border); border-radius: 16px;
		box-shadow: 0 18px 48px rgba(34, 34, 64, .18);
	}
	/* Invisible bridge so the pointer can travel from the icon into the flyout. */
	.ami-flyout::before { content: ""; position: absolute; left: -14px; top: 0; width: 14px; height: 100%; }
	.ami-flyout--account { top: auto; bottom: -4px; }
	.ami-flyout__title { font-family: var(--ami-serif); font-weight: 600; font-size: 21px; line-height: 1.15; padding: 0 12px 8px; }
	.ami-flyout__sub { font-size: 12.5px; color: var(--ami-ink-2); padding: 0 12px 8px; margin-top: -6px; }
	.ami-flyout ul { list-style: none; margin: 0; padding: 0; }
	.ami-flyout li a { display: block; padding: 9px 12px; border-radius: 10px; color: var(--ami-ink) !important; font-weight: 700; font-size: 14px; text-decoration: none !important; }
	.ami-flyout li a:hover { background: var(--ami-lilac-50); }
	.ami-flyout li.is-active a { background: var(--ami-lilac-100); color: var(--ami-purple-deep) !important; }
}

/* ---- Cards, rows, lists -------------------------------------------------- */
.ami-card { background: var(--ami-white); border: 1px solid var(--ami-border); border-radius: var(--ami-radius); box-shadow: var(--ami-shadow); }
.ami-card--pad { padding: 24px 26px; }
.ami-list { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.ami-list--flat { background: var(--ami-lilac-50); border-radius: 16px; border: 1px solid var(--ami-border); }
.ami-row + .ami-row { border-top: 1px solid var(--ami-border); }
.ami-row__link {
	display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 12px 20px;
	color: var(--ami-ink) !important; text-decoration: none !important;
	transition: background-color .12s ease;
}
a.ami-row__link:hover { background: var(--ami-lilac-50); }
.ami-row__body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ami-row__title { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ami-row__sub { color: var(--ami-ink-2); font-size: 13px; margin-top: 2px; }
.ami-row__end { flex: none; }
.ami-row__st, .ami-row__tags { display: none; }
.ami-row__honor { display: contents; }
.ami-row__chev { color: var(--ami-ink-3); width: 18px; height: 18px; flex: none; }
.ami-filetag { flex: none; font-size: 11px; font-weight: 800; letter-spacing: .04em; line-height: 1; padding: 5px 8px; border-radius: 6px; background: var(--ami-lilac-100); color: var(--ami-purple-ink); }
.ami-count { margin: 16px 0 12px; font-size: 13px; color: var(--ami-ink-2); }

/* Avatars */
.ami-avatar {
	flex: none; display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden;
	background: var(--ami-lilac-100); color: var(--ami-purple-deep);
	font-family: var(--ami-serif); font-weight: 700; letter-spacing: .02em;
}
.ami-avatar img { width: 100%; height: 100%; object-fit: cover; }
/* Centre the capital letters themselves: the serif font's built-in spacing sits them high on iPhones. */
.ami-avatar__ini { display: block; line-height: 1; text-box: trim-both cap alphabetic; }
.ami-avatar--gold { background: var(--ami-gold-300); color: var(--ami-gold-ink); }
.ami-avatar--sm { width: 34px; height: 34px; font-size: 14px; }
.ami-avatar--md { width: 40px; height: 40px; font-size: 16px; }
.ami-avatar--lg { width: 72px; height: 72px; font-size: 26px; }
.ami-avatar--xl { width: 96px; height: 96px; font-size: 36px; background: #E2E2F4; }

/* Badges */
.ami-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
/* A badge wrapped in a link (coetus) must sit exactly level with plain badges (status). */
.ami-badges > a { display: inline-flex; align-items: center; line-height: 1; }
.ami-badge {
	display: inline-flex; align-items: center; height: 24px; padding: 0 11px; border-radius: 999px;
	font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
	font-family: var(--ami-sans);
}
.ami-badge--gold { background: var(--ami-gold-100); color: var(--ami-gold-ink); }
.ami-badge--green { background: var(--ami-green-50); color: var(--ami-green); }
.ami-badge--lilac { background: var(--ami-lilac-100); color: var(--ami-purple-deep); }
.ami-badge--grey { background: var(--ami-grey-100); color: #45455C; }

/* Buttons */
.ami-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
	font: 800 14.5px var(--ami-sans); cursor: pointer; text-decoration: none !important; white-space: nowrap;
	transition: background-color .15s ease, box-shadow .15s ease, transform .05s ease;
}
.ami-btn:active { transform: translateY(1px); }
.ami-btn .ami-icon { width: 17px; height: 17px; }
.ami-btn--primary { background: var(--ami-purple); color: #fff !important; }
.ami-btn--primary:hover { background: var(--ami-purple-600); }
.ami-btn--gold { background: var(--ami-gold-300); color: #3A300C !important; }
.ami-btn--gold:hover { background: #F2D985; }
.ami-btn--ghost { background: var(--ami-lilac-100); color: var(--ami-purple-deep) !important; }
.ami-btn--ghost:hover { background: var(--ami-lilac-200); }
.ami-btn--outline { background: #fff; color: var(--ami-purple-ink) !important; border-color: var(--ami-purple); }
.ami-btn--sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.ami-link { font-weight: 800; color: var(--ami-purple-ink) !important; display: inline-flex; align-items: center; gap: 6px; }
.ami-link--sm { font-size: 13.5px; }
.ami-link--more { font-size: 13.5px; display: inline-block; }
/* Arrow is plain inline text (not a flex item) so the underline runs unbroken under text and arrow. */
.ami-link--more::after { content: ' \2192'; }
.ami-link .ami-icon { width: 16px; height: 16px; }
.ami-iconbtn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--ami-ink-2); cursor: pointer; }
.ami-iconbtn:hover { background: var(--ami-lilac-50); color: var(--ami-ink); }
.ami-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; }
.ami-inline-form { display: inline; margin: 0; }

/* Chips + inputs */
.ami-filterbar { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.ami-directory .ami-filterbar { margin-bottom: 0; }
.ami-input, .ami-form select, .ami-form input[type=text], .ami-form input[type=email], .ami-form input[type=tel], .ami-form input[type=date], .ami-form textarea, .ami-toolbar select {
	width: 100%; min-height: 48px; padding: 10px 16px; border-radius: 14px;
	border: 1px solid var(--ami-border-strong); background: #fff; color: var(--ami-ink);
	font: 500 15px var(--ami-sans);
}
.ami-input::placeholder, .ami-form ::placeholder { color: var(--ami-ink-3); }
.ami-input:focus, .ami-form select:focus, .ami-form input:focus, .ami-form textarea:focus { outline: none; border-color: var(--ami-purple); box-shadow: 0 0 0 3px rgba(108,108,178,.16); }
.ami-form input:disabled, .ami-form select:disabled, .ami-form textarea:disabled { background: var(--ami-lilac-100); border-color: var(--ami-lilac-100); color: var(--ami-ink-3); -webkit-text-fill-color: var(--ami-ink-3); opacity: 1; cursor: not-allowed; box-shadow: none; }
.ami-form select:disabled { background-image: none; }
.ami-form .ami-check:has(:disabled) { opacity: .55; cursor: not-allowed; }
.ami-form .ami-form-field:has(:disabled) > .ami-label { color: var(--ami-ink-3); }
.ami-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin-right: calc(var(--ami-gutter) * -1); padding-right: var(--ami-gutter); }
.ami-chips::-webkit-scrollbar { display: none; }
.ami-chip {
	flex: none; display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 999px;
	border: 1px solid var(--ami-border-strong); background: #fff; color: var(--ami-ink) !important;
	font-size: 13.5px; font-weight: 800; text-decoration: none !important; white-space: nowrap;
}
.ami-chip:hover { border-color: var(--ami-purple); }
.ami-chip.is-active { background: var(--ami-purple); border-color: var(--ami-purple); color: #fff !important; }

.ami-segmented { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: #fff; border: 1px solid var(--ami-border-strong); margin-bottom: 10px; max-width: 100%; }
.ami-segmented a { display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 999px; font-size: 13.5px; font-weight: 800; color: var(--ami-ink) !important; text-decoration: none !important; white-space: nowrap; }
.ami-segmented a.is-active { background: var(--ami-purple); color: #fff !important; }

/* Flash, banners, empty */
.ami-flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; margin-bottom: 18px; font-weight: 700; font-size: 14px; }
.ami-flash--ok { background: var(--ami-green-50); color: var(--ami-green); border: 1px solid var(--ami-green-200); }
.ami-flash--err { background: #FBEDEC; color: var(--ami-danger); border: 1px solid #F0C9C6; }
.ami-banner { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 16px; margin-bottom: 20px; font-weight: 800; font-size: 14px; }
.ami-banner .ami-icon { width: 18px; height: 18px; }
.ami-banner--green { background: var(--ami-green-50); color: var(--ami-green); border: 1px solid var(--ami-green-200); }
.ami-empty { text-align: center; color: var(--ami-ink-2); padding: 18px 8px; }
.ami-empty .ami-icon { width: 28px; height: 28px; color: var(--ami-purple); margin: 0 auto 8px; display: block; }
.ami-empty p { margin: 0; }
.ami-note { display: flex; align-items: center; gap: 8px; color: var(--ami-ink-3); font-size: 13px; margin: 16px 0 0; }
.ami-note .ami-icon { width: 16px; height: 16px; }
.ami-lock { display: flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 12px; color: var(--ami-ink-3); font-weight: 600; }
.ami-lock .ami-icon { width: 13px; height: 13px; }
.ami-help { display: block; font-size: 12.5px; color: var(--ami-ink-3); margin-top: 6px; }

/* ---- Home ---------------------------------------------------------------- */
.ami-hello { margin: 4px 0 22px; }
.ami-hello .ami-eyebrow { margin-bottom: 8px; }
.ami-hero { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; margin-bottom: 22px; }
.ami-hero__media { position: relative; min-height: 300px; background: linear-gradient(135deg, #7B7BBE, #4E4E8C); }
.ami-hero__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ami-hero__media.is-empty { display: grid; place-items: center; }
.ami-hero__media.is-empty .ami-hero__mark { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 1; }
.ami-hero__body { padding: 30px 32px 30px; display: flex; flex-direction: column; align-items: flex-start; }
.ami-hero__body .ami-h1 { margin: 16px 0 14px; }
.ami-hero__desc { margin: 12px 0 0; color: var(--ami-ink); line-height: 1.6; }
.ami-metalist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; color: var(--ami-ink); font-size: 15px; }
.ami-metalist li { display: flex; align-items: center; gap: 10px; }
.ami-metalist .ami-icon { width: 18px; height: 18px; color: var(--ami-purple); }

.ami-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.ami-widget { display: flex; flex-direction: column; }
.ami-widget .ami-h3 { margin-bottom: 14px; }
.ami-widget__more { margin-top: 14px; }
.ami-mini { list-style: none; margin: 0; padding: 0; }
.ami-mini__link { display: flex; align-items: center; gap: 12px; padding: 9px 0; color: var(--ami-ink) !important; text-decoration: none !important; }
.ami-mini li + li .ami-mini__link { border-top: 1px solid var(--ami-border); }
.ami-mini__body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ami-mini__title { font-weight: 800; font-size: 14.5px; }
.ami-mini__sub { font-size: 12.5px; color: var(--ami-ink-3); }
.ami-mini__end { font-size: 13.5px; color: var(--ami-ink-2); }
.ami-kv { list-style: none; margin: 0; padding: 0; }
.ami-kv a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; color: var(--ami-ink) !important; text-decoration: none !important; }
.ami-kv li + li a { border-top: 1px solid var(--ami-border); }
.ami-kv__k { font-weight: 800; font-size: 14.5px; }
.ami-kv__v { color: var(--ami-ink-2); font-size: 14px; text-align: right; }
.ami-stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ami-stats li { display: flex; align-items: baseline; gap: 18px; }
.ami-stats__n { font-family: var(--ami-serif); font-weight: 600; font-size: 44px; line-height: 1.05; color: var(--ami-purple); min-width: 64px; font-variant-numeric: oldstyle-nums; }
.ami-stats__l { font-weight: 800; font-size: 14.5px; }

/* ---- Events -------------------------------------------------------------- */
.ami-evgroup .ami-section-title { margin-top: 22px; }
.ami-evlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.ami-evcard {
	width: 100%; display: flex; align-items: center; gap: 28px; padding: 26px 26px; text-align: left; cursor: pointer;
	color: var(--ami-ink); transition: border-color .15s ease, box-shadow .15s ease;
}
.ami-evcard:hover { border-color: var(--ami-lilac-200); box-shadow: 0 1px 2px rgba(34,34,64,.05), 0 12px 32px rgba(34,34,64,.08); }
.ami-evdate { flex: none; width: 96px; display: flex; flex-direction: column; }
.ami-evdate__num { font-family: var(--ami-serif); font-weight: 600; font-size: 38px; line-height: 1; color: var(--ami-purple); font-variant-numeric: oldstyle-nums; }
.ami-evdate.is-range .ami-evdate__num { font-size: 28px; white-space: nowrap; }
.ami-evdate__day { font-size: 13.5px; color: var(--ami-ink-2); margin-top: 6px; }
.ami-evcard__body { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.ami-evcard__title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ami-evcard__meta { font-size: 14px; color: var(--ami-ink-2); }
.ami-evcard__desc { font-size: 14.5px; color: var(--ami-ink); max-width: 62ch; }
.ami-evcard__chev { color: var(--ami-ink-3); }

/* Dialog */
.ami-dialog { width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--ami-radius); box-shadow: 0 30px 80px rgba(34, 34, 64, .3); color: var(--ami-ink); background: #fff; }
.ami-dialog::backdrop { background: rgba(58, 58, 110, .45); }
.ami-dialog__inner { position: relative; }
.ami-dialog__close-form { position: absolute; top: 16px; right: 16px; margin: 0; }
.ami-dialog__head { padding: 22px 24px 18px; border-bottom: 1px solid var(--ami-border); }
.ami-dialog__head .ami-h2 { margin: 12px 0 14px; font-size: 30px; padding-right: 30px; }
.ami-dialog__body { padding: 18px 24px 22px; }
.ami-dialog__label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ami-dialog__label-row .ami-label { margin: 0; }
.ami-dialog__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; background: var(--ami-lilac-50); border-top: 1px solid var(--ami-border); border-radius: 0 0 var(--ami-radius) var(--ami-radius); }
.ami-details { margin-top: 16px; font-size: 14px; }
.ami-details summary { cursor: pointer; font-weight: 800; color: var(--ami-purple-ink); }
.ami-plainlist { margin: 8px 0 0; padding-left: 20px; }

/* ---- Profile ------------------------------------------------------------- */
.ami-profile-head { display: flex; align-items: center; gap: 24px; padding: 30px 28px; }
.ami-profile-head__text { flex: 1; min-width: 0; }
.ami-maiden { margin: 2px 0 10px; font-family: var(--ami-serif); font-style: italic; font-size: 19px; color: var(--ami-ink-2); }
.ami-profile-head .ami-badges { margin-top: 10px; }
.ami-profile-head__edit { align-self: center; }
.ami-tabs { margin-top: 22px; }
.ami-tabs__list { display: flex; gap: 4px; border-bottom: 1px solid var(--ami-border-strong); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.ami-tabs__list a { padding: 12px 16px; font-weight: 800; font-size: 14.5px; color: var(--ami-ink-2) !important; text-decoration: none !important; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ami-tabs__list a.is-active { color: var(--ami-ink) !important; border-bottom-color: var(--ami-purple-deep); }
@media (max-width: 600px) {
	/* Four tabs (incl. Sisselogimine) must fit a phone: share the width, tighter padding, still scrollable as a fallback. */
	.ami-tabs__list { gap: 0; }
	.ami-tabs__list a { flex: 1 1 auto; text-align: center; padding: 12px 8px; font-size: 13.5px; }
}
@media (max-width: 380px) {
	.ami-tabs__list a { padding: 12px 5px; font-size: 13px; }
}
.ami-tabpanel { padding: 22px 28px 26px; }
.js .ami-tabpanel + .ami-tabpanel { margin-top: 0; }
.ami-tabpanel + .ami-tabpanel { margin-top: 18px; }
.ami-fields { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; margin: 0; }
.ami-field { padding: 16px 0; border-bottom: 1px solid var(--ami-border); }
.ami-field dt { margin-bottom: 6px; }
.ami-field dd { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.ami-field dd a { color: var(--ami-ink) !important; }
.ami-timeline { list-style: none; margin: 0; padding: 0; }
.ami-timeline li { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--ami-border); }
.ami-timeline__term { font-family: var(--ami-serif); font-weight: 600; font-size: 20px; min-width: 96px; color: var(--ami-purple); }
.ami-timeline__role { font-weight: 800; flex: 1; }

/* Profile edit */
.ami-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 22px; }
.ami-fieldset { border: 0; margin: 0 0 12px; padding: 0; }
.ami-fieldset legend { margin-bottom: 14px; padding: 0; }
.ami-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; }
.ami-form--first { margin-top: 0; }
.ami-form-field { min-width: 0; }
/* iOS/Android date inputs have their own width and spill out of the box without this. */
.ami-form input[type=date] { display: block; min-width: 0; max-width: 100%; box-sizing: border-box; -webkit-appearance: none; appearance: none; text-align: left; }
.ami-form input[type=date]::-webkit-date-and-time-value { text-align: left; }
.ami-form-field--wide { grid-column: 1 / -1; }
.ami-form-field--check { align-self: end; padding-bottom: 12px; }
.ami-check { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14.5px; cursor: pointer; }
.ami-check input { width: 18px; height: 18px; accent-color: var(--ami-purple); }
.ami-photo-row { display: flex; align-items: center; gap: 20px; }
.ami-photo-row > .ami-avatar { flex: none; }
.ami-photo-row > div { min-width: 0; flex: 1 1 auto; }
/* A long file name is cut with "…" instead of pushing the form wider. */
.ami-file { max-width: 100%; }
.ami-file [data-ami-file-label] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ami-photo-row .ami-check { margin-top: 10px; }
.ami-file { position: relative; overflow: hidden; }
.ami-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ami-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--ami-border); }
.ami-form-actions__end { margin-left: auto; }

/* ---- Cohorts ------------------------------------------------------------- */
.ami-decade .ami-section-title { margin: 28px 0 12px; }
.ami-coegrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.ami-coegrid .ami-row + .ami-row { border: 0; }
.ami-coecard { display: flex; flex-direction: column; padding: 14px 16px 16px; color: var(--ami-ink) !important; text-decoration: none !important; transition: border-color .15s, box-shadow .15s; height: 100%; }
.ami-coecard:hover { border-color: var(--ami-lilac-200); box-shadow: 0 10px 28px rgba(34,34,64,.08); }
.ami-coecard__code { font-family: var(--ami-serif); font-weight: 600; font-size: 28px; line-height: 1.1; }
.ami-coecard__sem { font-size: 13px; font-weight: 800; color: var(--ami-purple-ink); margin-top: 6px; }
.ami-coecard__n { font-size: 12.5px; color: var(--ami-ink-2); margin-top: 6px; }

.ami-cohort { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; margin-bottom: 8px; }
.ami-photo { margin: 0; border-radius: var(--ami-radius); overflow: hidden; border: 1px solid var(--ami-border); }
.ami-photo img { width: 100%; }
.ami-caption { font-size: 14px; color: var(--ami-ink-2); margin: 12px 4px 4px; }
.ami-caption strong { color: var(--ami-ink); }
.ami-dropzone { margin: 0; }
.ami-dropzone label, .ami-dropzone.is-static {
	position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
	min-height: 240px; border-radius: var(--ami-radius); border: 1.5px dashed #BDBCD6; background: #ECECF6;
	color: var(--ami-ink); font-size: 14px; font-weight: 700; text-align: center; cursor: pointer; padding: 16px;
}
.ami-dropzone.is-static { cursor: default; color: var(--ami-ink-2); }
.ami-dropzone .ami-icon { width: 30px; height: 30px; color: var(--ami-ink-2); }
.ami-dropzone small { font-weight: 600; color: var(--ami-ink-2); font-size: 12px; }
.ami-dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ami-dropzone.is-over label { border-color: var(--ami-purple); background: var(--ami-lilac-100); }
.ami-cohort__info .ami-display { margin: 8px 0 6px; }
.ami-mentor { display: block; margin-top: 24px; padding: 18px 20px; color: var(--ami-ink) !important; text-decoration: none !important; }
.ami-mentor__row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.ami-mentor__row > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; }
.ami-mentor__name { font-family: var(--ami-serif); font-weight: 600; font-size: 21px; line-height: 1.1; }

/* ---- Offices ------------------------------------------------------------- */
.ami-offices:first-child .ami-section-label { margin-top: 4px; }
.ami-chips--scroll { margin-bottom: 16px; }
.ami-officerow { display: flex; align-items: center; gap: 20px; min-height: 68px; padding: 12px 20px; position: relative; color: var(--ami-ink); transition: background-color .12s ease; }
.ami-officerow.has-link:hover { background: var(--ami-lilac-50); }
.ami-officelist__name { color: inherit !important; text-decoration: none !important; }
.ami-officelist__name::after { content: ''; position: absolute; inset: 0; }
.ami-officelist__role { font-family: var(--ami-serif); font-weight: 600; font-size: 21px; width: 200px; flex: none; }
.ami-officelist__who { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.ami-officelist__mail { position: relative; z-index: 2; flex: none; font-size: 13px; color: var(--ami-ink-3) !important; text-decoration: none !important; }
.ami-officelist__mail:hover, .ami-officelist__mail:focus-visible { color: var(--ami-purple-deep) !important; text-decoration: underline !important; }
/* Filter chips: first few shown, older ones fold away. */
.ami-chips[data-chips]:not(.is-open) .ami-chip.is-more { display: none; }
.ami-chips[data-chips] { flex-wrap: wrap; overflow: visible; margin-right: 0; padding-right: 0; }
.ami-chip--more { cursor: pointer; font-family: inherit; color: var(--ami-purple-deep) !important; background: var(--ami-lilac-50); }
.ami-row__link.is-static { color: var(--ami-ink-3) !important; }

/* ---- Family tree ---------------------------------------------------------- */
.ami-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.ami-toolbar p { margin: 0; flex: 1; min-width: 200px; color: var(--ami-ink); }
.ami-toolbar__pick select { min-height: 36px; padding: 4px 12px; border-radius: 999px; width: auto; font-size: 13.5px; }
.ami-treewrap { padding: 32px 24px; overflow-x: auto; }
.ami-tree, .ami-tree ul { list-style: none; margin: 0; padding: 0; }
/* Desktop: a real branching tree, one generation per row, sisters side by side. */
.ami-tree { display: flex; justify-content: center; width: max-content; min-width: 100%; }
.ami-tree ul { display: flex; justify-content: center; position: relative; padding-top: 26px; }
.ami-tree li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 26px 8px 0; }
.ami-tree li::before, .ami-tree li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 26px; border-top: 1px solid #C9C8DD; }
.ami-tree li::after { right: auto; left: 50%; border-left: 1px solid #C9C8DD; }
.ami-tree li:only-child::before, .ami-tree li:only-child::after { display: none; }
.ami-tree li:only-child { padding-top: 0; }
.ami-tree li:first-child::before, .ami-tree li:last-child::after { border: 0 none; }
.ami-tree li:last-child::before { border-right: 1px solid #C9C8DD; border-radius: 0 10px 0 0; }
.ami-tree li:first-child::after { border-radius: 10px 0 0 0; }
.ami-tree ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 26px; border-left: 1px solid #C9C8DD; }
.ami-node {
	position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 9px 14px 9px 10px;
	background: #fff; border: 1px solid var(--ami-border-strong); border-radius: 14px; color: var(--ami-ink) !important;
	text-decoration: none !important; white-space: nowrap; transition: border-color .12s, box-shadow .12s;
}
.ami-node:hover { border-color: var(--ami-purple); }
.ami-node.is-focus { border-color: var(--ami-purple); background: #F1F1FB; box-shadow: 0 0 0 3px rgba(108,108,178,.15); }
.ami-node__text { display: flex; flex-direction: column; text-align: left; }
.ami-node__name { font-family: var(--ami-serif); font-weight: 600; font-size: 19px; line-height: 1.1; }
.ami-node__sub { font-size: 11.5px; color: var(--ami-ink-2); margin-top: 2px; }
.ami-node__rel { font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--ami-ink-2); margin-bottom: 2px; }
.ami-node__kids { font-size: 12px; font-weight: 800; color: var(--ami-purple-ink); margin-top: 3px; }
.ami-node__me { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: var(--ami-gold-100); color: var(--ami-gold-ink); font-family: var(--ami-sans); font-size: 11px; font-weight: 800; vertical-align: middle; }
.ami-node.is-focus { padding: 12px 18px 12px 12px; }
.ami-node.is-focus .ami-node__name { font-size: 23px; }

/* Sugupuu · Lähedane pere (desktop tree + phone list) */
.ami-fam--narrow { display: none; }
.ami-fam__col { display: flex; flex-direction: column; align-items: center; width: max-content; margin: 0 auto; }
.ami-fam__vl { display: block; width: 1px; height: 24px; background: #C9C8DD; }
.ami-fam__more { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px dashed #A9A8CC; border-radius: 999px; background: var(--ami-lilac-50); color: var(--ami-purple-ink) !important; font-size: 14px; font-weight: 800; text-decoration: none !important; }
.ami-fam__more:hover { border-color: var(--ami-purple); }
.ami-fam__tree { position: relative; padding-top: 26px; width: max-content; min-width: 0; }
.ami-fam__tree::before { content: ""; position: absolute; top: 0; left: 50%; height: 26px; border-left: 1px solid #C9C8DD; }
.ami-fam__tree.is-root { padding-top: 0; }
.ami-fam__tree.is-root::before { display: none; }
.ami-fam__label { margin: 8px 4px 0; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ami-ink-2); }
.ami-fam__list { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.ami-fam__row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 14px; border-top: 1px solid var(--ami-grey-100); color: var(--ami-ink) !important; text-decoration: none !important; }
.ami-fam__row:first-child { border-top: 0; }
.ami-fam__row--more { min-height: 52px; background: var(--ami-lilac-50); color: var(--ami-purple-ink) !important; font-size: 14px; font-weight: 800; gap: 8px; }
.ami-fam__rowtext { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ami-fam__rel { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ami-ink-2); }
.ami-fam__name { font-family: var(--ami-serif); font-weight: 600; font-size: 19px; line-height: 1.15; }
.ami-fam__sub { font-size: 12px; color: var(--ami-ink-2); margin-top: 2px; }
.ami-fam__kids { font-size: 12px; font-weight: 800; color: var(--ami-purple-ink); margin-top: 2px; }
.ami-fam__chev { flex: none; color: var(--ami-purple-ink); }
.ami-fam__focus { padding: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; background: #F1F1FB; border-color: var(--ami-purple); box-shadow: 0 0 0 4px rgba(108,108,178,.14); }
.ami-fam__focustop { display: flex; align-items: center; gap: 14px; width: 100%; }
.ami-fam__focus .ami-fam__name { font-size: 26px; margin: 2px 0; }
.ami-fam__chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--ami-gutter) * -1); padding: 2px var(--ami-gutter) 6px; }
.ami-fam__chips::-webkit-scrollbar { display: none; }
.ami-fam__chip { flex: none; display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 14px 6px 8px; border: 1px solid var(--ami-border-strong); border-radius: 14px; background: #fff; color: var(--ami-ink) !important; text-decoration: none !important; }
.ami-fam__chip .ami-fam__name { font-size: 17px; white-space: nowrap; }
.ami-fam__chip .ami-fam__sub { white-space: nowrap; }
.ami-fam__empty { margin: 0; padding: 14px; font-size: 13px; color: var(--ami-ink-2); }

/* Sugupuu · Kogu liin (outline) */
.ami-linewrap { padding: 12px; overflow-x: auto; }
.ami-line, .ami-line ul { list-style: none; margin: 0; padding: 0; }
.ami-line ul { margin-left: 17px; padding-left: 12px; border-left: 1px solid #DCDBEA; }
.ami-line details > summary { list-style: none; }
.ami-line details > summary::-webkit-details-marker { display: none; }
.ami-line__row { display: flex; align-items: center; gap: 6px; min-height: 52px; padding: 2px 12px 2px 4px; border-radius: 12px; cursor: pointer; }
.ami-line__row:hover { background: var(--ami-lilac-50); }
.ami-line__row.is-path { background: var(--ami-lilac-50); }
.ami-line__row.is-focus { background: var(--ami-lilac-100); }
.ami-line__chev { flex: none; width: 28px; height: 28px; padding: 6px; box-sizing: border-box; color: var(--ami-purple-ink); transition: transform .15s; }
.ami-line details[open] > summary > .ami-line__chev { transform: rotate(90deg); }
.ami-line__sp { flex: none; width: 28px; }
.ami-line__link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 4px 0; color: var(--ami-ink) !important; text-decoration: none !important; }
.ami-line__row.is-focus .ami-avatar { box-shadow: 0 0 0 2px var(--ami-purple); }
.ami-line__text { display: flex; flex-direction: column; min-width: 0; }
.ami-line__name { font-family: var(--ami-serif); font-weight: 600; font-size: 18px; line-height: 1.15; white-space: nowrap; }
.ami-line__sub { font-size: 12px; color: var(--ami-ink-2); white-space: nowrap; }
.ami-line__count { margin-left: auto; padding-left: 16px; font-size: 12.5px; color: var(--ami-ink-2); white-space: nowrap; }

/* ---- Ksv! + documents ---------------------------------------------------- */
.ami-foldergrid { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.ami-folder { display: flex; align-items: center; gap: 16px; padding: 18px 20px; color: var(--ami-ink) !important; text-decoration: none !important; }
.ami-folder:hover { border-color: var(--ami-green-200); }
.ami-folder__icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--ami-green-50); color: var(--ami-green); flex: none; }
.ami-folder__body { display: flex; flex-direction: column; flex: 1; }
.ami-doc-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--ami-lilac-100); color: var(--ami-purple-deep); flex: none; }
.ami-doc-icon .ami-icon { width: 18px; height: 18px; }
.ami-denied { text-align: center; }
.ami-denied > .ami-icon { width: 32px; height: 32px; color: var(--ami-green); margin: 0 auto 8px; display: block; }
.ami-article { max-width: 820px; }

/* ---- Auth (logged-out) --------------------------------------------------- */
body.ami.ami-layout-auth { background: var(--ami-purple); }
.ami-auth__card input[type=text], .ami-auth__card input[type=password], .ami-auth__card input[type=email] { width: 100%; min-height: 46px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--ami-border-strong); font: 500 15px var(--ami-sans); }
.ami-auth__card input[type=submit] { min-height: 44px; padding: 0 24px; border: 0; border-radius: 999px; background: var(--ami-purple); color: #fff; font: 800 14.5px var(--ami-sans); cursor: pointer; }
.ami-auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(32px + env(safe-area-inset-top)) 16px 32px; gap: 24px; }
.ami-auth__brand { display: flex; align-items: center; gap: 14px; color: #fff; }
.ami-auth__brand .ami-logo__img { width: 40px; height: 54px; }
.ami-auth__brand .ami-logo__name { font-size: 30px; }
.ami-auth__card { width: 100%; max-width: 440px; background: #fff; border-radius: var(--ami-radius); padding: 30px 30px 26px; box-shadow: 0 30px 80px rgba(20, 20, 60, .25); }
.ami-auth__card .ami-h1 { font-size: 32px; margin-bottom: 14px; }
.ami-auth__hint { margin: 18px 0 0; font-size: 14px; text-align: center; }
.ami-auth .ami-support { color: rgba(255,255,255,.85); text-align: center; }
.ami-auth .ami-support a { color: #fff; }
/* Ultimate Member forms inside the shell */
.ami .um { font-family: var(--ami-sans) !important; }
.ami .um-form input[type=text], .ami .um-form input[type=password], .ami .um-form input[type=email] { border-radius: 12px !important; min-height: 46px !important; border-color: var(--ami-border-strong) !important; font-family: var(--ami-sans) !important; }
.ami .um-button, .ami .um input[type=submit].um-button { background: var(--ami-purple) !important; border-radius: 999px !important; font-family: var(--ami-sans) !important; font-weight: 800 !important; }
.ami .um-button.um-alt { background: var(--ami-lilac-100) !important; color: var(--ami-purple-deep) !important; }
.ami .um a.um-link-alt, .ami .um-field-label label { font-family: var(--ami-sans) !important; }

/* ==========================================================================
   Tablet
   ========================================================================== */
@media (max-width: 1180px) {
	:root { --ami-sidebar: 248px; --ami-gutter: 28px; }
	.ami-grid-3 { grid-template-columns: 1fr 1fr; }
	.ami-grid-3 > :last-child { grid-column: 1 / -1; }
	.ami-coegrid { grid-template-columns: repeat(3, 1fr); }
	.ami-search { flex-basis: 300px; }
}

/* ==========================================================================
   Mobile / PWA (<= 860px): purple header, floating tab bar + search button, "Veel" sheet
   ========================================================================== */
@media (max-width: 860px) {
	:root { --ami-gutter: 16px; --ami-radius: 20px; }
	/* Room under the content so the last card scrolls clear of the floating dock. */
	body.ami-layout-app { padding-bottom: calc(var(--ami-tabbar-h) + var(--ami-dock-bottom)); min-height: 100vh; }
	:root { --ami-dock-bottom: max(12px, calc(env(safe-area-inset-bottom) - 8px)); }
	/* Pulling the page down past the top shows the root colour: same purple as the header (and behind the clock). */
	html:has(body.ami-layout-app) { background: #4E4E88; }
	.ami-sidebar, .ami-topbar { display: none; }
	.ami-main { margin-left: 0; }

	.ami-mheader {
		position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 12px;
		min-height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0;
		background: #4E4E88; color: #fff;
		box-shadow: 0 1px 0 rgba(0,0,0,.06);
	}
	.ami-mheader::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 100vh; background: #4E4E88; pointer-events: none; }
	.ami-mheader__logo, .ami-mheader__back, .ami-mheader__me { display: grid; place-items: center; width: 40px; height: 40px; color: #fff !important; border-radius: 10px; flex: none;  -webkit-tap-highlight-color: transparent; }
	.ami-mheader__logo .ami-logo__img { width: 22px; height: 30px; }
	.ami-mheader__title { flex: 1; min-width: 0; font-family: var(--ami-serif); font-weight: 600; font-size: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

	.ami-content { padding: 18px var(--ami-gutter) 24px; }
	.ami-footer { padding: 0 var(--ami-gutter) 16px; }

	/* Floating dock: light-glass tab bar + round search button, same side margins as the content.
	   Tapping search widens it into a field and shrinks the menu into one circle (current page icon). */
	.ami-tabdock {
		position: fixed; z-index: 30; left: var(--ami-gutter); right: var(--ami-gutter);
		bottom: calc(var(--ami-dock-bottom) + var(--ami-kb, 0px));
		display: flex; align-items: center; gap: 10px;
	}
	.ami-tabbar, .ami-tabsearch {
		position: relative; isolation: isolate; height: var(--ami-tabbar-h); box-sizing: border-box; border-radius: 999px;
		/* Outline is the border itself (inside the box), so the visible edge is exactly at the content edge. */
		border: 1px solid rgba(108, 108, 178, .16);
		box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45), 0 1px 2px rgba(34, 34, 64, .06), 0 12px 32px rgba(34, 34, 64, .16);
		transition: flex-grow .32s cubic-bezier(.2, .8, .2, 1), flex-basis .32s cubic-bezier(.2, .8, .2, 1);
	}
	/* The glass lives on its own layer: iOS Safari cuts off the shadow of an element that has the blur itself. */
	.ami-tabbar::before, .ami-tabsearch::before {
		content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
		background: rgba(255, 255, 255, .4);
		-webkit-backdrop-filter: blur(14px) saturate(1.8); backdrop-filter: blur(14px) saturate(1.8);
	}
	@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
		.ami-tabbar::before, .ami-tabsearch::before { background: rgba(255, 255, 255, .96); }
	}
	.ami-tabdock .ami-icon { width: 24px; height: 24px; stroke-width: 1.6; }
	.ami-tabbar { flex: 1 1 0; min-width: 0; display: flex; align-items: stretch; padding: 5px; }
	.ami-tabbar > .ami-tab { transition: opacity .18s ease; }
	.ami .ami-tabbar__current {
		position: absolute; inset: 0; display: grid; place-items: center; border: 0; padding: 0; background: transparent; cursor: pointer; text-decoration: none !important;
		color: var(--ami-purple-deep) !important; opacity: 0; pointer-events: none; transition: opacity .18s ease;
		-webkit-tap-highlight-color: transparent; touch-action: manipulation;
	}
	.ami-tabbar__current .ami-tab__icon { background: var(--ami-lilac-100); width: calc(var(--ami-tabbar-h) - 12px); height: calc(var(--ami-tabbar-h) - 12px); }
	.ami-tabbar__current:focus:not(:focus-visible) { outline: none; }

	.ami-tabsearch { flex: 0 0 var(--ami-tabbar-h); min-width: var(--ami-tabbar-h); display: flex; align-items: center; margin: 0; }
	.ami .ami-tabsearch__btn {
		flex: none; width: calc(var(--ami-tabbar-h) - 2px); height: 100%; display: grid; place-items: center; border-radius: 999px;
		color: var(--ami-purple-deep) !important; text-decoration: none !important;
		-webkit-tap-highlight-color: transparent; touch-action: manipulation;
	}
	.ami .ami-tabsearch__btn:focus:not(:focus-visible) { outline: none; }
	.ami-tabsearch.is-active:not(.is-open) { border-color: transparent; }
	.ami-tabsearch.is-active:not(.is-open)::before { background: var(--ami-purple-deep); }
	.ami .ami-tabsearch.is-active:not(.is-open) .ami-tabsearch__btn { color: #fff !important; }
	.ami-tabsearch__input {
		flex: 1; min-width: 0; height: 100%; margin: 0 18px 0 -6px; padding: 0; border: 0; background: transparent; outline: none;
		font: 600 16px var(--ami-sans); color: var(--ami-ink); -webkit-appearance: none; appearance: none;
		opacity: 0; visibility: hidden; transition: opacity .18s ease;
	}
	.ami-tabsearch__input::placeholder { color: var(--ami-ink-3); }
	.ami .ami-tabsearch__input:focus, .ami .ami-tabsearch__input:focus-visible { outline: none; }
	.ami-tabdock.is-searching .ami-tabsearch:has(.ami-tabsearch__input:focus) { border-color: var(--ami-purple); box-shadow: inset 0 0 0 1px var(--ami-purple), 0 12px 32px rgba(34, 34, 64, .16); }
	.ami-tabsearch__input::-webkit-search-cancel-button { -webkit-appearance: none; }

	.ami-tabdock.is-searching .ami-tabbar { flex: 0 0 var(--ami-tabbar-h); padding: 0; }
	.ami-tabdock.is-searching .ami-tabbar > .ami-tab { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .12s ease, visibility 0s .12s; }
	.ami-tabdock.is-searching .ami-tabbar__current { opacity: 1; pointer-events: auto; transition-delay: .1s; }
	.ami-tabdock.is-searching .ami-tabsearch { flex: 1 1 0; }
	.ami-tabdock.has-kb { bottom: calc(var(--ami-kb) + 8px); }
	.ami-tabdock.is-searching .ami-tabsearch__input { opacity: 1; visibility: visible; transition-delay: .12s; }
	@media (prefers-reduced-motion: reduce) {
		.ami-tabbar, .ami-tabsearch, .ami-tabbar > .ami-tab, .ami-tabbar__current, .ami-tabsearch__input { transition: none !important; }
	}

	/* Profile avatar: the outer edge of its ring lines up with the content and the dock; no tap flash. */
	.ami .ami-mheader__me {
		place-items: center end; border-radius: 999px; margin-right: calc(var(--ami-gutter) - 12px + 2px);
		-webkit-tap-highlight-color: transparent; touch-action: manipulation;
	}
	.ami .ami-mheader__me:focus:not(:focus-visible) { outline: none; }
	.ami-mheader__me .ami-avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }
	.ami-mheader__me.is-active .ami-avatar { box-shadow: 0 0 0 2px #fff; }
	/* No footer on the phone search page: results end at the dock. */
	.ami-footer.is-search { display: none; }
	/* On phones the dock's field is the search box, so the page's own field is not shown. */
	.ami-search-page { display: none; }
	.ami .ami-tab {
		position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; flex: 1 1 0; min-width: 0; height: auto;
		border: 0; background: transparent; padding: 0; cursor: pointer;
		font: 800 13px var(--ami-sans); color: var(--ami-ink-2) !important; text-decoration: none !important;
		-webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; touch-action: manipulation;
	}
	.ami .ami-tab:focus:not(:focus-visible) { outline: none; }
	/* The selected pill fills its tab almost to the bar's edges (5px inside). */
	.ami-tab__icon { display: grid; place-items: center; flex: none; width: 100%; height: 100%; border-radius: 999px; }
	.ami .ami-tab > span:last-child:not(.ami-tab__icon) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	.ami .ami-tab.is-active { color: var(--ami-purple-deep) !important; }
	.ami-tab.is-active .ami-tab__icon { background: var(--ami-lilac-100); }

	.ami-sheet[open] {
		display: block; position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: 100%; max-height: 80vh;
		border: 0; border-radius: 22px 22px 0 0; padding: 8px 12px calc(16px + env(safe-area-inset-bottom));
		background: #fff; color: var(--ami-ink); box-shadow: 0 -20px 60px rgba(34, 34, 64, .25);
		animation: ami-sheet-in .22s cubic-bezier(.2, .8, .2, 1);
	}
	.ami-sheet::backdrop { background: rgba(58, 58, 110, .45); }
	.ami-sheet__grip { width: 40px; height: 4px; border-radius: 4px; background: var(--ami-border-strong); margin: 4px auto 12px; }
	.ami-sheet__list { list-style: none; margin: 0; padding: 0; }
	.ami-sheet__list a { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 12px; border-radius: 14px; color: var(--ami-ink) !important; font-weight: 800; font-size: 15.5px; text-decoration: none !important; }
	.ami-sheet__list a .ami-icon { color: var(--ami-purple-deep); }
	.ami-sheet__list a span { flex: 1; }
	.ami-sheet__list a.is-active { background: var(--ami-lilac-100); color: var(--ami-purple-deep) !important; box-shadow: inset 3px 0 0 var(--ami-purple); }
	.ami-sheet:focus, .ami-sheet:focus-visible { outline: none; }
	.ami-sheet__list a:focus:not(:focus-visible) { outline: none; }
	.ami-sheet__chev { color: var(--ami-ink-3) !important; width: 18px; height: 18px; }

	/* Components */
	.ami-display { font-size: 34px; }
	.ami-h2 { font-size: 24px; }
	.ami-hero { grid-template-columns: 1fr; }
	.ami-hero__media { min-height: 0; aspect-ratio: 4 / 3; }
	.ami-hero__body { padding: 20px 20px 22px; }
	.ami-grid-3 { grid-template-columns: 1fr; gap: 14px; }
	.ami-grid-3 > :last-child { grid-column: auto; }
	.ami-card--pad { padding: 20px; }
	.ami-row__link { padding: 12px 16px; min-height: 64px; }
	.ami-row__link { display: grid; grid-template-columns: auto 1fr auto; column-gap: 12px; row-gap: 6px; }
	.ami-row__link > .ami-avatar, .ami-row__link > .ami-doc-icon { grid-row: 1 / span 2; align-self: center; }
	.ami-row__link > .ami-row__chev, .ami-row__link > .ami-filetag { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
	.ami-row__end { grid-column: 2; grid-row: 2; }
	.ami-row__end:empty { display: none; }
	.ami-row__end .ami-badge { font-size: 9.5px; height: 20px; padding: 0 8px; }
	.ami-row__title .ami-badge { height: 20px; font-size: 9.5px; padding: 0 8px; }

	.ami-evcard { gap: 16px; padding: 18px 16px; align-items: flex-start; }
	.ami-evdate { width: 64px; }
	.ami-evdate__num { font-size: 28px; }
	.ami-evdate.is-range .ami-evdate__num { font-size: 20px; }
	.ami-evdate__day { font-size: 12px; }
	.ami-evcard__chev { display: none; }
	.ami-segmented { display: flex; }
	.ami-segmented a { flex: 1; justify-content: center; padding: 0 10px; }
	.ami-dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 90vh; }
	.ami-dialog__foot { border-radius: 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }

	.ami-profile-head { flex-wrap: wrap; gap: 16px; padding: 22px 20px; }
	.ami-profile-head .ami-avatar--xl { width: 72px; height: 72px; font-size: 28px; }
	.ami-profile-head__text { flex-basis: calc(100% - 100px); }
	.ami-profile-head__edit { width: 100%; }
	.ami-tabpanel { padding: 8px 20px 18px; }
	.ami-fields { grid-template-columns: 1fr; }
	.ami-form-grid { grid-template-columns: 1fr; }
	.ami-form-actions__end { margin-left: 0; width: 100%; }

	.ami-coegrid { grid-template-columns: 1fr 1fr; gap: 10px; }
	.ami-coecard__code { font-size: 24px; }
	.ami-cohort { grid-template-columns: 1fr; }
	.ami-dropzone label, .ami-dropzone.is-static { min-height: 180px; }

	/* Ametid (mobile): avatar left, role above name + coetus, role e-mail on its own line */
	.ami-officerow { display: grid; grid-template-columns: auto 1fr auto; column-gap: 12px; row-gap: 0; align-items: center; min-height: 60px; padding: 10px 16px; }
	.ami-officelist__who { display: contents; }
	.ami-officelist .ami-avatar, .ami-officelist__empty { grid-column: 1; grid-row: 1 / span 3; }
	.ami-officelist__role { grid-column: 2; grid-row: 1; width: auto; font-size: 20px; font-weight: 700; line-height: 1.1; color: var(--ami-purple-deep); align-self: end; }
	.ami-officelist .ami-row__body { grid-column: 2; grid-row: 2; display: block; align-self: start; }
	.ami-officelist .ami-row__title { display: inline; font-size: 15px; line-height: 1.3; }
	.ami-officelist .ami-row__sub { display: inline; margin: 0 0 0 6px; font-size: 13px; font-weight: 600; }
	.ami-officerow > .ami-row__chev { grid-column: 3; grid-row: 1 / span 3; }
	.ami-officelist__mail { grid-column: 2; grid-row: 3; justify-self: start; margin-top: 3px; font-size: 13px; overflow-wrap: anywhere; }
	.ami-officelist__empty { display: block; width: 40px; height: 40px; border-radius: 50%; border: 1.5px dashed #D6D5E6; }
	.ami-officelist .ami-muted { grid-column: 2; grid-row: 2; font-size: 14px; }

	/* Liikmed (mobile): status pill next to the name, honorary titles on their own line */
	.ami-row--member .ami-row__link { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 16px; }
	.ami-row--member .ami-row__title { gap: 6px; line-height: 1.25; }
	.ami-row--member .ami-row__sub { margin-top: 1px; }
	.ami-row--member .ami-row__end, .ami-row--member .ami-row__honor { display: none; }
	.ami-row--member .ami-row__st { display: inline-flex; }
	.ami-row--member .ami-row__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
	.ami-row--member .ami-row__tags .ami-badge { height: 20px; font-size: 9.5px; padding: 0 8px; }

	/* Sugupuu: phones get the stacked close-family list instead of the tree. */
	.ami-fam--wide { display: none; }
	.ami-fam--narrow { display: flex; flex-direction: column; gap: 10px; }
	.ami-fam__profile--dup { display: none; }
	.ami-fam__toolbar .ami-toolbar__pick, .ami-fam__toolbar .ami-toolbar__pick select { width: 100%; }
	.ami-fam__views { display: flex; width: 100%; margin-bottom: 0; }
	.ami-fam__views a { flex: 1; justify-content: center; }
	.ami-toolbar .ami-btn { width: 100%; }
	/* Kogu liin on phones: every generation steps in by the same 10px (no cap), so
	   a 13th-generation member never lines up with an older one. Avatars are hidden
	   to leave room for names; the highlighted row keeps its tint. */
	.ami-linewrap { padding: 6px; }
	.ami-line ul { margin-left: 9px; padding-left: 0; }
	.ami-line__row { padding-left: 0; padding-right: 8px; gap: 4px; }
	.ami-line__chev { width: 20px; height: 28px; padding: 6px 2px; }
	.ami-line__sp { width: 20px; }
	.ami-line__link .ami-avatar { display: none; }
	.ami-line__name, .ami-line__sub { white-space: normal; }
	.ami-line__count { display: none; }

	.ami-foldergrid { grid-template-columns: 1fr; }
	.ami-auth__card { padding: 24px 20px; }
}

@keyframes ami-sheet-in { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
	.ami *, .ami *::before, .ami *::after { animation: none !important; transition: none !important; }
}

@media print {
	.ami-sidebar, .ami-topbar, .ami-mheader, .ami-tabdock, .ami-footer { display: none !important; }
	.ami-main { margin: 0; }
}

/* ---- Uudised (news) ------------------------------------------------------- */
.ami-center { text-align: center; }
.ami-newshead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 20px; flex-wrap: wrap; }
.ami-newshead__text { flex: 1; min-width: 240px; }
.ami-newshead__text .ami-eyebrow { margin-bottom: 6px; }
.ami-newshead__intro { margin: 0; color: var(--ami-ink-2); font-size: 16px; }
.ami-newsgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
.ami-newscard { display: flex; flex-direction: column; overflow: hidden; transition: box-shadow .15s ease, transform .15s ease; }
.ami-newscard:hover { box-shadow: 0 2px 4px rgba(34, 34, 64, .05), 0 14px 32px rgba(34, 34, 64, .09); }
.ami-newscard__media, .ami-latest__media { position: relative; display: block; aspect-ratio: 3 / 2; background: linear-gradient(135deg, #7B7BBE, #4E4E8C); overflow: hidden; }
.ami-newscard__media img, .ami-latest__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ami-newscard__media.is-empty, .ami-latest__media.is-empty { display: grid; place-items: center; }
.ami-newscard__media .ami-newscard__mark, .ami-latest__media .ami-newscard__mark { position: static; width: 64px; height: auto; opacity: .9; }
.ami-newscard__body { display: flex; flex-direction: column; flex: 1; padding: 18px 20px 18px; }
.ami-newscard__date, .ami-latest__date { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--ami-ink-3); }
.ami-newscard__meta { display: flex; align-items: center; gap: 10px; min-height: 22px; }
.ami-newscard__title { margin: 6px 0 8px; font-family: var(--ami-serif); font-weight: 600; font-size: 24px; line-height: 1.12; letter-spacing: -.005em; }
.ami-newscard__title a { color: var(--ami-ink) !important; text-decoration: none !important; }
.ami-newscard__title a:hover { color: var(--ami-purple-deep) !important; }
.ami-newscard__excerpt { margin: 0 0 16px; color: var(--ami-ink-2); font-size: 14.5px; line-height: 1.55; }
.ami-newscard__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ami-newscard__author { color: var(--ami-ink-3); font-size: 13.5px; font-weight: 600; }
.ami-pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 26px 0 4px; }

/* Home: latest news card */
.ami-latest { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); overflow: hidden; margin-bottom: 22px; }
.ami-latest__media { aspect-ratio: auto; min-height: 260px; }
.ami-latest__body { display: flex; flex-direction: column; align-items: flex-start; padding: 26px 30px 24px; }
.ami-latest__body .ami-badges { gap: 12px; }
.ami-latest__title { margin: 14px 0 10px; }
.ami-latest__title a { color: var(--ami-ink) !important; text-decoration: none !important; }
.ami-latest__title a:hover { color: var(--ami-purple-deep) !important; }
.ami-latest__excerpt { margin: 0 0 14px; color: var(--ami-ink); line-height: 1.6; }
.ami-latest__author { color: var(--ami-ink-3); font-size: 13.5px; font-weight: 600; }
.ami-latest__more { margin-top: auto; padding-top: 16px; }

/* Single post */
.ami-post { max-width: 820px; }
.ami-backlink { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; color: var(--ami-purple-ink) !important; margin: 0 0 14px; }
.ami-backlink .ami-icon { width: 16px; height: 16px; }
.ami-post__head { margin: 0 0 18px; }
.ami-post__meta { font-size: 12.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ami-ink-3); margin-bottom: 8px; }
.ami-post__cover { margin: 0 0 18px; border-radius: var(--ami-radius); overflow: hidden; box-shadow: var(--ami-shadow); }
.ami-post__cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.ami-post__body { margin-bottom: 18px; }
.ami-post .ami-prose { font-size: 17px; line-height: 1.7; }
.ami-post .ami-prose h2, .ami-post .ami-prose h3, .ami-post .ami-prose h4 { font-family: var(--ami-serif); font-weight: 600; color: var(--ami-ink); line-height: 1.15; margin: 26px 0 10px; }
.ami-post .ami-prose h2 { font-size: 30px; }
.ami-post .ami-prose h3 { font-size: 26px; }
.ami-post .ami-prose h4 { font-size: 21px; }
.ami-post .ami-prose > :first-child { margin-top: 0; }
.ami-post .ami-prose ul, .ami-post .ami-prose ol { margin: 0 0 14px; padding-left: 22px; }
.ami-post .ami-prose li { margin-bottom: 4px; }
.ami-post .ami-prose blockquote { margin: 18px 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--ami-gold-300); color: var(--ami-ink-2); font-family: var(--ami-serif); font-size: 22px; line-height: 1.35; }
.ami-post .ami-prose figure, .ami-post .ami-prose img { max-width: 100%; height: auto; border-radius: var(--ami-radius-sm); margin: 16px 0; }
.ami-post .ami-prose figcaption { color: var(--ami-ink-3); font-size: 13.5px; margin-top: 6px; text-align: center; }
.ami-post .ami-prose a { text-decoration: underline; text-underline-offset: 3px; }
.ami-post__edit { margin: 22px 0 0; }

@media (max-width: 1180px) {
	.ami-newsgrid { grid-template-columns: 1fr 1fr; }
	.ami-latest { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
}
@media (max-width: 860px) {
	.ami-newsgrid { grid-template-columns: 1fr; gap: 14px; }
	.ami-newshead .ami-btn { width: 100%; }
	.ami-newscard__title { font-size: 23px; }
	.ami-latest { grid-template-columns: 1fr; }
	.ami-latest__media { aspect-ratio: 3 / 2; min-height: 0; }
	.ami-latest__body { padding: 18px 20px 20px; }
	.ami-post .ami-prose { font-size: 16.5px; }
	.ami-post .ami-prose h2 { font-size: 26px; }
	.ami-post .ami-prose h3 { font-size: 23px; }
}
.ami-stats + .ami-widget__more { margin-top: 22px; }

/* Semestri kava (events calendar) */
.ami-semcal__grid { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.ami-cal { padding: 22px 24px 26px; }
.ami-cal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ami-cal__title { font-family: var(--ami-serif); font-weight: 600; font-size: 22px; margin: 0; color: var(--ami-ink); }
.ami-cal__nav { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--ami-border-strong); background: #fff; color: var(--ami-purple-ink); font-size: 20px; line-height: 1; cursor: pointer; }
.ami-cal__nav:hover:not(:disabled) { background: var(--ami-lilac-100); }
.ami-cal__nav:disabled { opacity: .35; cursor: default; }
.ami-cal__days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px 4px; text-align: center; }
.ami-cal__wd { font-size: 12px; font-weight: 700; color: var(--ami-ink-3); padding-bottom: 6px; }
.ami-cal__day { display: flex; align-items: center; justify-content: center; height: 40px; border-radius: 12px; border: 1px solid transparent; background: none; font: inherit; font-size: 14px; color: var(--ami-ink-3); padding: 0; position: relative; }
.ami-cal__day.has-ev { background: var(--ami-lilac-100); color: var(--ami-purple-deep); font-weight: 800; cursor: pointer; }
.ami-cal__day.has-ev:hover { background: var(--ami-lilac-200); }
/* One dot per event, at most three. */
.ami-cal__dots { position: absolute; left: 0; right: 0; bottom: 6px; height: 4px; display: flex; justify-content: center; align-items: center; gap: 3px; pointer-events: none; }
.ami-cal__dots i { display: block; flex: none; width: 4px; height: 4px; border-radius: 50%; background: var(--ami-purple); }
.ami-cal__day.is-today { border-color: var(--ami-purple-deep); color: var(--ami-ink); font-weight: 800; }
.ami-calside .ami-eyebrow { margin-bottom: 8px; }
.ami-calside__list { list-style: none; margin: 0; padding: 0; }
.ami-calside__list li + li { border-top: 1px solid var(--ami-border); }
.ami-calside__item { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; background: none; border: 0; padding: 14px 0; cursor: pointer; font: inherit; color: inherit; }
.ami-calside__item:hover .ami-calside__title { color: var(--ami-purple-ink); }
.ami-calside__date.is-range .ami-calside__num { font-size: 17px; white-space: nowrap; }
.ami-calside__date { flex: none; width: 76px; display: flex; flex-direction: column; }
.ami-calside__num { font-family: var(--ami-serif); font-weight: 600; font-size: 22px; color: var(--ami-purple); font-variant-numeric: oldstyle-nums; line-height: 1.1; }
.ami-calside__wd { font-size: 12px; color: var(--ami-ink-2); }
.ami-calside__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ami-calside__title { font-weight: 800; font-size: 15px; }
.ami-calside__meta { font-size: 13px; color: var(--ami-ink-2); }
@media (max-width: 860px) {
	.ami-semcal__grid { grid-template-columns: 1fr; }
	.ami-cal { padding: 16px; }
}

/* Profile photo: click to enlarge */
.ami-avatar-zoom { position: relative; flex: none; padding: 0; border: 0; background: none; border-radius: 50%; cursor: zoom-in; line-height: 0; }
.ami-avatar-zoom .ami-avatar { box-shadow: 0 0 0 3px #fff, 0 6px 18px rgba(34, 34, 64, .16); transition: box-shadow .15s; }
.ami-avatar-zoom:hover .ami-avatar { box-shadow: 0 0 0 3px #fff, 0 8px 22px rgba(34, 34, 64, .24); }
.ami-avatar-zoom__badge { position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; border-radius: 50%; background: var(--ami-purple-deep); color: #fff; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; opacity: 0; transform: scale(.85); transition: opacity .15s, transform .15s; line-height: 0; }
.ami-avatar-zoom__badge .ami-icon { width: 15px; height: 15px; }
.ami-avatar-zoom:hover .ami-avatar-zoom__badge, .ami-avatar-zoom:focus-visible .ami-avatar-zoom__badge { opacity: 1; transform: none; }
@media (hover: none), (max-width: 860px) { .ami-avatar-zoom__badge { display: none; } }
.ami-photobox { cursor: pointer; margin: auto; inset: 0; width: fit-content; height: fit-content; max-width: 90vw; max-height: 90vh; background: transparent; box-shadow: none; overflow: visible; }
.ami-photobox, .ami-photobox * { -webkit-tap-highlight-color: transparent; }
.ami-photobox, .ami-photobox:focus, .ami-photobox:focus-visible, .ami-photobox *:focus, .ami-photobox *:focus-visible { outline: none !important; box-shadow: none; }
.ami-photobox::backdrop { background: rgba(34, 34, 80, .82); }
.ami-photobox__fig { margin: 0; text-align: center; display: flex; flex-direction: column; align-items: center; }
.ami-photobox__fig img { display: block; width: min(86vw, 520px, 70vh); height: min(86vw, 520px, 70vh); object-fit: cover; border-radius: 50%; border: 0; box-shadow: 0 30px 80px rgba(0, 0, 0, .4); }
/* Touch: no lingering focus box / tap flash on calendar days and list items after closing a dialog. */
.ami-cal__day, .ami-calside__item, .ami-evcard, .ami-dialog button { -webkit-tap-highlight-color: transparent; }
@media (hover: none) {
	.ami-cal__day:focus, .ami-cal__day:focus-visible, .ami-calside__item:focus, .ami-calside__item:focus-visible, .ami-evcard:focus, .ami-evcard:focus-visible { outline: none; }
}

/* ---- Login page (split layout) ------------------------------------------ */
body.ami.ami-layout-login { background: #fff; }
.ami-login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ami-login__brand { background: var(--ami-purple); color: #fff; padding: 56px 64px 44px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.ami-login__logo { display: flex; align-items: center; gap: 16px; }
.ami-login__logo .ami-logo__img { width: 44px; height: 60px; }
.ami-login__logo .ami-logo__name { font-size: 32px; }
.ami-login__latin { font-family: var(--ami-serif); font-style: italic; font-weight: 500; font-size: clamp(46px, 5vw, 68px); line-height: 1.05; color: var(--ami-gold-300); margin: 0 0 22px; }
.ami-login__sub { font-size: 19px; line-height: 1.5; max-width: 420px; margin: 0; color: rgba(255,255,255,.92); }
.ami-login__foot { margin: 0; font-size: 14px; color: rgba(255,255,255,.8); }
.ami-login__panel { display: flex; align-items: center; justify-content: center; padding: 48px 32px; }
.ami-login__form { width: 100%; max-width: 460px; }
.ami-login__form .ami-h1 { font-size: 42px; margin: 0 0 8px; }
.ami-login__lead { margin: 0 0 22px; color: var(--ami-ink-2); font-size: 17px; line-height: 1.45; max-width: 340px; }
.ami-login__lead-short { display: none; }
.ami-login__error { display: flex; gap: 10px; align-items: flex-start; background: #FBEDEC; color: var(--ami-danger); border: 1px solid #F0C9C6; border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; font-size: 14.5px; line-height: 1.45; }
.ami-login__error .ami-icon { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.ami-login__google .wp_google_login { margin: 0; }
.ami-login__google .wp_google_login__button-container { margin: 0; }
.ami-login__google a.wp_google_login__button { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 20px; border: 1.5px solid var(--ami-purple); border-radius: 999px; background: #fff; color: var(--ami-purple-deep); font: 800 16px var(--ami-sans); line-height: 1.2; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.ami-login__google a.wp_google_login__button:hover { background: var(--ami-lilac-50, #F4F4FB); color: var(--ami-purple-deep); }
.ami-login__google .wp_google_login__google-icon { width: 22px; height: 22px; margin: 0; background: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23EA4335' d='M24 9.5c3.5 0 6.6 1.2 9.1 3.6l6.8-6.8C35.8 2.4 30.3 0 24 0 14.6 0 6.5 5.4 2.6 13.2l7.9 6.1C12.4 13.6 17.7 9.5 24 9.5z'/%3E%3Cpath fill='%234285F4' d='M46.5 24.5c0-1.6-.1-3.1-.4-4.5H24v9h12.7c-.6 3-2.3 5.5-4.8 7.2l7.5 5.8c4.4-4.1 7.1-10.1 7.1-17.5z'/%3E%3Cpath fill='%23FBBC05' d='M10.5 28.7c-.5-1.5-.8-3-.8-4.7s.3-3.2.8-4.7l-7.9-6.1C1 16.4 0 20.1 0 24s1 7.6 2.6 10.8l7.9-6.1z'/%3E%3Cpath fill='%2334A853' d='M24 48c6.5 0 11.9-2.1 15.9-5.8l-7.5-5.8c-2.1 1.4-4.8 2.3-8.4 2.3-6.3 0-11.6-4.1-13.5-9.8l-7.9 6.1C6.5 42.6 14.6 48 24 48z'/%3E%3C/svg%3E") no-repeat 50% / contain; flex: none; }
.ami-login__google a.wp_google_login__button.is-loading { opacity: .6; pointer-events: none; }
.ami-login__or { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: var(--ami-ink-2); font-size: 14px; }
.ami-login__or::before, .ami-login__or::after { content: ''; flex: 1; height: 1px; background: var(--ami-border); }
.ami-login__fields { display: flex; flex-direction: column; }
.ami-login__fields .ami-label { margin: 0 0 6px; font-size: 15px; font-weight: 800; color: var(--ami-ink); }
.ami-login__fields input[type=email], .ami-login__fields input[type=password] { width: 100%; min-height: 54px; padding: 8px 16px; margin: 0 0 18px; border: 1px solid var(--ami-border-strong); border-radius: 14px; background: #fff; font: 500 16px var(--ami-sans); color: var(--ami-ink); }
.ami-login__fields input:focus { outline: none; border-color: var(--ami-purple); box-shadow: 0 0 0 3px rgba(108,108,178,.18); }
.ami-login__submit { min-height: 52px; border: 0; border-radius: 999px; background: var(--ami-gold-300); color: var(--ami-ink); font: 800 17px var(--ami-sans); cursor: pointer; }
.ami-login__submit:hover { background: #F2D985; }
.ami-login__forgot { text-align: center; margin: 16px 0 0; font-weight: 800; }
.ami-login__forgot a { color: var(--ami-purple-deep); }
.ami-login__legal { margin: 14px 0 0; font-size: 13px; color: var(--ami-ink-3, var(--ami-ink-2)); }
.ami-login__legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ami-login__legal a:hover { color: var(--ami-ink-1, var(--ami-ink-2)); }
.ami-login__note { margin: 26px 0 0; padding-top: 20px; border-top: 1px solid var(--ami-border); font-size: 14px; line-height: 1.55; color: var(--ami-ink-2); }
@media (max-width: 860px) {
	/* Purple only at the top of the canvas (Safari's top bar, pulling down); white from the middle down (below the form, pulling up). */
	html:has(body.ami-layout-login) { background: linear-gradient(var(--ami-purple) 50%, #fff 50%); }
	.ami-login__brand { position: relative; }
	.ami-login__brand::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 100vh; background: var(--ami-purple); pointer-events: none; }
	.ami-login { display: flex; flex-direction: column; min-height: 100vh; }
	.ami-login__brand { padding: calc(28px + env(safe-area-inset-top)) 22px 48px; gap: 0; }
	.ami-login__motto, .ami-login__foot { display: none; }
	.ami-login__logo .ami-logo__img { width: 34px; height: 46px; }
	.ami-login__logo .ami-logo__name { font-size: 26px; }
	/* White sheet overlaps the purple header with rounded top corners (matches the mobile mockup). */
	.ami-login__panel { flex: 1; align-items: flex-start; padding: 28px 20px 32px; position: relative; margin-top: -24px; background: #fff; border-radius: 28px 28px 0 0; }
	.ami-login__form .ami-h1 { font-size: 34px; }
	.ami-login__lead-long { display: none; }
	.ami-login__lead-short { display: inline; }
	.ami-login__lead { margin-bottom: 16px; }
	.ami-login__or { margin: 16px 0; }
	.ami-login__fields input[type=email], .ami-login__fields input[type=password] { min-height: 50px; margin-bottom: 14px; }
	.ami-login__note { margin-top: 20px; padding-top: 16px; }
}

/* Privacy policy (public page in the auth layout) */
.ami-view-privacy .ami-auth__card { max-width: 760px; }
.ami-view-privacy .ami-prose h2 { font-family: var(--ami-serif); font-weight: 600; font-size: 22px; line-height: 1.2; color: var(--ami-ink); margin: 24px 0 8px; }
.ami-view-privacy .ami-prose { font-size: 15.5px; }

.ami-auth__inner .ami-btn + .ami-link { margin-left: 16px; }

.ami-auth__back { margin: 18px 0 0; }

/* Auth pages: buttons and back links all sit on the left (UM centres its button by default) */
.ami-auth__card .um-center, .ami-auth__card .um-col-alt { text-align: left !important; }
.ami-auth__card .um-col-alt { margin-top: 16px; }
.ami-auth__card .um-col-alt .um-clear { display: none; }

/* Password-reset page (UM markup): match the other auth pages — left text, normal-size button */
.ami-auth__card .um, .ami-auth__card .um-form { max-width: none !important; width: 100% !important; margin: 0 !important; }
.ami-auth__card .um-field-block, .ami-auth__card .um-field-block div { text-align: left !important; font: 500 15.5px/1.6 var(--ami-sans) !important; color: var(--ami-ink) !important; }
.ami-auth__card .um-field { padding: 0 !important; margin: 0 0 14px !important; }
.ami-auth__card .um-col-alt, .ami-auth__card .um-col-alt-b { width: auto !important; float: none !important; display: block !important; }
.ami-auth__card .um-center { width: auto !important; display: block !important; }
.ami-auth__card input[type=submit].um-button, .ami-auth__card .um-button { width: auto !important; min-width: 0 !important; display: inline-block !important; padding: 0 24px !important; min-height: 44px !important; line-height: 44px !important; float: none !important; }

/* iPhone home-screen app: no Google button (v1.3.10) */
.ami-login__app-note { display: none; margin: 0 0 18px; padding: 10px 14px; border-radius: 12px; background: var(--ami-lilac-50, #F4F4FB); color: var(--ami-ink-2); font-size: 14px; line-height: 1.4; }
.ami-ios-app .ami-login__google { display: none; }
.ami-ios-app .ami-login__app-note { display: block; }

/* Sisselogimine: pääsuvõti, e-posti kood, parool (v1.4.0) */
.ami-signin { display: block; }
.ami-signin [hidden] { display: none !important; }
.ami-login__pk { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; margin: 10px 0 0; padding: 0 20px; border: 1.5px solid var(--ami-purple); border-radius: 999px; background: var(--ami-purple); color: #fff; font: 800 16px var(--ami-sans); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ami-login__pk:hover { background: var(--ami-purple-600); border-color: var(--ami-purple-600); }
.ami-login__pk[hidden], .ami-login__methods[hidden], .ami-login__emailview[hidden] { display: none; }
.ami-login__em { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; margin: 10px 0 0; padding: 0 20px; border: 1.5px solid var(--ami-gold-300); border-radius: 999px; background: var(--ami-gold-300); color: var(--ami-ink); font: 800 16px var(--ami-sans); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ami-login__em:hover { background: #F2D985; border-color: #F2D985; }
.ami-login__back { margin: 0 0 18px; padding: 0; font-weight: 800; color: var(--ami-purple-deep); }
.ami-login__pk:disabled { opacity: .6; cursor: default; }
.ami-signin .ami-login__fields input[type=text] { width: 100%; min-height: 54px; padding: 8px 16px; margin: 0 0 18px; border: 1px solid var(--ami-border-strong); border-radius: 14px; background: #fff; font: 600 22px var(--ami-sans); letter-spacing: .18em; }
.ami-login__submit:disabled { opacity: .6; cursor: default; }
.ami-login__code-links { margin: 14px 0 0; text-align: center; color: var(--ami-ink-2); font-size: 14px; }
.ami-login__linkbtn { border: 0; background: none; padding: 0; color: var(--ami-purple-deep); font: 800 14px var(--ami-sans); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.ami-login__linkbtn:disabled { color: var(--ami-ink-2); text-decoration: none; cursor: default; }
.ami-login__msg { margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--ami-lilac-50, #F4F4FB); color: var(--ami-ink-2); font-size: 14px; line-height: 1.45; }
.ami-login__msg.is-err { background: #FDECEC; color: #8A1F1F; }
.ami-login__pw { margin: 22px 0 0; }
.ami-login__pw summary { cursor: pointer; text-align: center; font-weight: 800; font-size: 15px; color: var(--ami-purple-deep); list-style: none; }
.ami-login__pw summary::-webkit-details-marker { display: none; }
.ami-login__pw summary::after { content: ' ▾'; }
.ami-login__pw[open] summary::after { content: ' ▴'; }
.ami-login__pw .ami-login__fields { margin-top: 16px; }
.ami-pk__list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ami-pk__list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--ami-border); border-radius: 14px; background: #fff; }
.ami-pk__list li div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ami-pk__here { display: none; color: var(--ami-purple-deep); font-weight: 800; font-size: 12.5px; }
.ami-pk__list li.is-here .ami-pk__here { display: block; }
.ami-pk__msg { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--ami-lilac-50, #F4F4FB); color: var(--ami-ink-2); font-size: 14px; }
.ami-pk__msg.is-err { background: #FDECEC; color: #8A1F1F; }
.ami-login__back { text-decoration: none; font-size: 15px; }
.ami-pkprompt .ami-dialog__head { border-bottom: 0; padding-bottom: 4px; }
.ami-pkprompt .ami-dialog__head .ami-h2 { margin: 4px 0 0; font-size: 26px; padding-right: 0; }
.ami-pkprompt .ami-dialog__body { padding-top: 6px; }
.ami-pkprompt .ami-dialog__body .ami-muted { margin: 0; }
.ami-pkprompt__foot { justify-content: flex-end; }
.ami-pkprompt__foot .ami-btn { flex: 1; justify-content: center; }
@media (min-width: 521px) { .ami-pkprompt__foot .ami-btn { flex: 0 0 auto; } }


.ami-calside__fold { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 0; background: none; border: 0; cursor: pointer; font: 800 14px var(--ami-sans); color: var(--ami-purple-deep); text-align: left; -webkit-tap-highlight-color: transparent; }
.ami-calside__fold:hover { color: var(--ami-purple); }
.ami-calside__foldchev { width: 18px; height: 18px; transform: rotate(90deg); transition: transform .15s; flex: none; }
.ami-calside__fold.is-open .ami-calside__foldchev { transform: rotate(-90deg); }
.ami-calside__past[hidden] { display: none; }

/* Muudatused (changelog) */
.ami-support--update { margin-top: 4px; }
.ami-changelog { display: grid; gap: 14px; max-width: 760px; }
.ami-changelog__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 10px; }
.ami-changelog__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ami-changelog__list li { display: flex; gap: 10px; align-items: baseline; line-height: 1.45; }
.ami-changelog__chip { flex: 0 0 auto; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; background: var(--ami-lilac-100); color: var(--ami-purple-ink); }
.ami-changelog__chip--new { background: var(--ami-gold-100); color: var(--ami-gold-ink); }
.ami-changelog__chip--fixed { background: var(--ami-green-50); color: var(--ami-green); }
@media (max-width: 860px) { .ami-changelog__list li { flex-direction: column; gap: 4px; } }

/* Phones: fields under 16px make iOS zoom the page in when tapped. */
@media (hover: none) and (pointer: coarse) {
	body.ami:not(.ami-layout-login):not(.ami-layout-auth) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=submit]):not([type=button]):not([type=hidden]), select, textarea) { font-size: 16px; }
}

/* ==========================================================================
   Ürituste registreerimine (theme 1.6.0)
   ========================================================================== */
.ami-form input[type=datetime-local], .ami-form input[type=number] {
	width: 100%; min-height: 48px; padding: 10px 16px; border-radius: 14px;
	border: 1px solid var(--ami-border-strong); background: #fff; color: var(--ami-ink);
	font: 500 15px var(--ami-sans); display: block; min-width: 0; max-width: 100%; box-sizing: border-box; -webkit-appearance: none; appearance: none; text-align: left;
}
.ami-btn--danger { background: var(--ami-danger); color: #fff !important; }
.ami-btn--danger:hover { background: #8A1F18; }

/* In the event dialog */
.ami-reg { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--ami-border); }
.ami-reg > .ami-label { margin: 0 0 8px; }
.ami-reg__meta { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 10px; font-size: 14.5px; color: var(--ami-ink-2); }
.ami-reg__meta .ami-icon { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.ami-reg__meta strong { color: var(--ami-ink); }
.ami-reg__info { margin-bottom: 4px; }
.ami-reg__closed { margin: 8px 0 0; font-weight: 700; color: var(--ami-ink-2); }
.ami-reg__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
.ami-reg__actions .ami-btn .ami-icon { width: 16px; height: 16px; }
.ami-reg .ami-help { margin-top: 8px; }
.ami-regform { margin-top: 10px; gap: 14px; }
.ami-regform .ami-fieldset { margin: 0; }
.ami-regform .ami-fieldset legend { margin-bottom: 8px; }
.ami-regform textarea { min-height: 76px; }
.ami-regchips { display: flex; flex-wrap: wrap; gap: 8px; }
.ami-regchip { position: relative; display: inline-flex; cursor: pointer; }
.ami-regchip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.ami-regchip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--ami-border-strong); background: #fff; font-size: 14px; font-weight: 700; color: var(--ami-ink); }
.ami-regchip:hover span { border-color: var(--ami-purple); }
.ami-regchip input:checked + span { background: var(--ami-green-50); border: 2px solid var(--ami-green); color: var(--ami-green); padding: 0 15px; }
.ami-regchip input:focus-visible + span { outline: 2px solid var(--ami-purple); outline-offset: 2px; }
.ami-regform__muu { display: none; margin-top: 12px; }
.ami-regform:has(input[value=muu]:checked) .ami-regform__muu { display: block; }
.ami-reg__done { padding: 14px 16px; border-radius: 16px; background: var(--ami-green-50); border: 1px solid var(--ami-green-200); }
.ami-reg__done-title { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 800; color: var(--ami-green); }
.ami-reg__done-title .ami-icon { width: 18px; height: 18px; }
.ami-reg__answer { margin: 6px 0 0; font-size: 14px; color: var(--ami-ink); }
.ami-reg__answer span { font-weight: 800; color: var(--ami-ink-2); }
.ami-reg__done .ami-reg__actions { margin-top: 12px; }
.ami-reg__done .ami-regform { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--ami-green-200); }
.ami-reg__people { margin-top: 18px; }
.ami-reg__people > .ami-label { margin: 0 0 10px; }
.ami-reg__plist { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ami-reg__plist a { display: inline-flex; align-items: center; gap: 8px; padding: 3px 14px 3px 3px; border: 1px solid var(--ami-border); border-radius: 999px; font-size: 14px; font-weight: 700; color: var(--ami-ink) !important; text-decoration: none !important; background: #fff; }
.ami-reg__plist a:hover { border-color: var(--ami-purple); }
.ami-reg__plist .ami-avatar { width: 30px; height: 30px; font-size: 11px; }
.ami-reg__setup { margin: 18px 0 0; }
.ami-reg__setup .ami-icon { width: 15px; height: 15px; }

/* Organizer page */
.ami-regadmin__event .ami-h1 { margin: 8px 0 6px; }
.ami-regadmin__event .ami-muted { margin: 0; }
.ami-regadmin__intro { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--ami-lilac-50); font-size: 14.5px; }
.ami-regadmin__intro .ami-icon { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--ami-purple); }
.ami-regadmin { margin-top: 18px; gap: 26px; }
.ami-regadmin .ami-fieldset { margin: 0; }
.ami-regadmin .ami-fieldset legend.ami-h2 { font-size: 24px; }
.ami-modecards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ami-modecard { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; border: 1px solid var(--ami-border-strong); border-radius: 16px; background: #fff; cursor: pointer; }
.ami-modecard input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.ami-modecard__t { font-weight: 800; font-size: 15.5px; }
.ami-modecard__d { font-size: 14px; color: var(--ami-ink-2); }
.ami-modecard:hover { border-color: var(--ami-purple); }
.ami-modecard:has(input:checked) { border: 2px solid var(--ami-purple-deep); padding: 13px 17px; background: var(--ami-lilac-50); }
.ami-modecard:has(input:focus-visible) { outline: 2px solid var(--ami-purple); outline-offset: 2px; }
.ami-regadmin:has(input[name=mode][value=form]:checked) [data-mode=intra],
.ami-regadmin:has(input[name=mode][value=intra]:checked) [data-mode=form] { display: none; }
.ami-switches { list-style: none; margin: 18px 0 0; padding: 0; }
.ami-switches li + li { border-top: 1px solid var(--ami-border); }
.ami-switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; font-weight: 700; font-size: 15px; cursor: pointer; }
.ami-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.ami-switch__track { position: relative; flex: none; width: 50px; height: 30px; border-radius: 999px; background: #8C8AA6; transition: background .15s; }
.ami-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.ami-switch input:checked + .ami-switch__track { background: var(--ami-purple-600); }
.ami-switch input:checked + .ami-switch__track::after { transform: translateX(20px); }
.ami-switch input:focus-visible + .ami-switch__track { outline: 2px solid var(--ami-purple); outline-offset: 2px; }
.ami-orglist { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.ami-orglist li { display: flex; align-items: center; gap: 10px; }
.ami-orglist__name { flex: 1; font-weight: 700; }
.ami-orglist__rm { flex: none; }
.ami-orglist__rm[hidden] { display: none; }
.ami-maplink { text-decoration: underline; text-underline-offset: 2px; }
.ami-maplink .ami-icon { width: 13px; height: 13px; vertical-align: -1px; }
.ami-regadmin__list, .ami-regadmin__danger { margin-top: 18px; }
.ami-regadmin__listhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.ami-regstats { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.ami-regstats li { padding: 12px 14px; border-radius: 14px; background: var(--ami-lilac-50); }
.ami-regstats__n { display: block; font-family: var(--ami-serif); font-weight: 600; font-size: 30px; line-height: 1.1; color: var(--ami-purple-deep); }
.ami-regstats__l { font-size: 13.5px; font-weight: 700; color: var(--ami-ink-2); }
.ami-regadmin__list, .ami-regadmin, .ami-regadmin__event { min-width: 0; max-width: 100%; }
.ami-tablewrap { position: relative; overflow-x: auto; max-width: 100%; margin: 0 -4px; padding: 0 4px; }
.ami-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14.5px; }
.ami-table th { text-align: left; padding: 8px 10px 8px 0; font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ami-ink-2); }
.ami-table td { padding: 10px 10px 10px 0; border-top: 1px solid var(--ami-border); vertical-align: top; }
.ami-table__name a { font-weight: 800; color: var(--ami-ink) !important; }
.ami-table__note { display: block; font-size: 12.5px; }
.ami-table__comment { max-width: 260px; }
.ami-table__date { white-space: nowrap; color: var(--ami-ink-2); }
.ami-table__act { width: 40px; padding-right: 0 !important; }
.ami-table__act .ami-iconbtn { width: 32px; height: 32px; margin-top: -4px; }
.ami-table__act .ami-icon { width: 16px; height: 16px; }
.ami-regadmin__add { margin-top: 18px; gap: 12px; }
.ami-regadmin__add .ami-form-actions { border-top: 0; padding-top: 0; }
.ami-regadmin__danger summary { cursor: pointer; font-weight: 800; color: var(--ami-danger); }
.ami-regadmin__danger p { margin: 12px 0; }
@media (max-width: 600px) {
	.ami-modecards { grid-template-columns: 1fr; }
}

/* 1.6.1: no grey/blue tap box on phones when choosing food, mode or a switch (keyboard focus ring stays). */
.ami-regchip, .ami-regchip span, .ami-modecard, .ami-switch { -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.ami-regchip input:focus:not(:focus-visible) + span { outline: none; }
.ami-reg__footlinks { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.ami-reg__footlinks .ami-icon { width: 14px; height: 14px; }
.ami-regadmin__list .ami-actions { margin-top: 4px; }
.ami-calside__item .ami-badge { flex: none; }
@media (max-width: 600px) {
	/* Phone: the Registreeru / Registreerunud chip goes under the event text instead of squeezing it. */
	.ami-calside__item:has(> .ami-badge) { flex-wrap: wrap; row-gap: 6px; }
	.ami-calside__item:has(> .ami-badge) .ami-calside__body { flex: 1 1 calc(100% - 92px); min-width: 0; }
	.ami-calside__item > .ami-badge { margin-left: 92px; }
}

.ami-reg__sheet { margin: 12px 0 0; }
.ami-reg__sheet .ami-icon { width: 14px; height: 14px; }
