:root {
  --yellow: #ffcc00;
  --yellow-hover: #ffd633;
  --yellow-soft: #fff7cc;
  --black: #09090b;
  --ink: #18181b;
  --zinc-700: #3f3f46;
  --zinc-600: #52525b;
  --zinc-500: #71717a;
  --zinc-400: #a1a1aa;
  --zinc-300: #d4d4d8;
  --zinc-200: #e4e4e7;
  --zinc-100: #f4f4f5;
  --zinc-50: #fafafa;
  --red: #dc2626;
  --page: #f3f3f1;
  --tile: #ffffff;
  --shadow: 0 1px 2px rgba(9, 9, 11, .06), 0 1px 1px rgba(9, 9, 11, .04);
  --shadow-hover: 0 10px 24px rgba(9, 9, 11, .10), 0 2px 6px rgba(9, 9, 11, .06);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f4f4f5; --zinc-600: #a1a1aa; --zinc-500: #a1a1aa; --zinc-300: #3f3f46; --zinc-200: #27272a; --zinc-100: #1f1f23; --zinc-50: #18181b;
    --page: #0f0f11; --tile: #18181b; --yellow-soft: #3a3000;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-hover: 0 10px 24px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #f4f4f5; --zinc-600: #a1a1aa; --zinc-500: #a1a1aa; --zinc-300: #3f3f46; --zinc-200: #27272a; --zinc-100: #1f1f23; --zinc-50: #18181b;
  --page: #0f0f11; --tile: #18181b; --yellow-soft: #3a3000;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-hover: 0 10px 24px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; line-height: 1.45;
}
button, input { font: inherit; color: inherit; }
.muted { color: var(--zinc-500); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* ---- Top bar ---- */
.top { position: sticky; top: 0; z-index: 20; background: var(--yellow); color: var(--black); box-shadow: 0 1px 0 rgba(9, 9, 11, .12); }
.top-inner { max-width: 1240px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 16px; color: var(--black); text-decoration: none; flex: none; min-width: 0; }
.turck-logo { display: block; height: 30px; width: auto; flex: none; }
.turck-logo.small { height: 22px; }
.brand-divider { width: 2px; height: 28px; background: rgba(9, 9, 11, .35); flex: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; background: var(--yellow); color: var(--black); border-radius: 8px; }
.brand-name { font-size: 18px; font-weight: 800; letter-spacing: .01em; color: var(--black); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search { position: relative; flex: 1; max-width: 520px; margin-left: auto; }
.search input {
  width: 100%; height: 42px; padding: 0 14px 0 42px; border: 2px solid rgba(9, 9, 11, .25); border-radius: 999px;
  background: #fff; color: var(--black); outline: none; transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: #71717a; }
.search input:focus { border-color: var(--black); box-shadow: 0 0 0 3px rgba(9, 9, 11, .12); }
.search-icon { position: absolute; left: 15px; top: 12px; color: #52525b; pointer-events: none; }
.top-button {
  flex: none; height: 42px; padding: 0 18px; border: 2px solid var(--black); border-radius: 999px; background: transparent; color: var(--black);
  font-weight: 700; cursor: pointer; transition: background .15s, color .15s;
}
.top-button:hover, .top-button:focus-visible { background: var(--black); color: var(--yellow); outline: none; }

.editbar { background: var(--black); color: #fff; }
.editbar-inner { max-width: 1240px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px; }
.editbar-actions { display: flex; align-items: center; gap: 14px; }
.done-button { height: 36px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--yellow); color: var(--black); font-weight: 700; cursor: pointer; }
.editbar .link-button { color: #fff; }

/* ---- Page ---- */
.main { max-width: 1240px; margin: 0 auto; padding: 36px 24px 64px; }
.hero { margin-bottom: 36px; text-align: center; }
.greeting { margin: 0 0 4px; color: var(--zinc-500); font-size: 14px; font-weight: 600; letter-spacing: .02em; }
.hero h1 { margin: 0; font-size: 34px; line-height: 1.15; font-weight: 800; letter-spacing: -.01em; }
.subtitle { margin: 6px 0 0; color: var(--zinc-600); font-size: 16px; }
.hero.editable h1, .hero.editable .subtitle { cursor: pointer; text-decoration: underline dashed var(--zinc-400) 1px; text-underline-offset: 6px; }

.groups { display: grid; gap: 34px; }
.group-head { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 16px; min-height: 32px; }
.group-head h2 { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--zinc-600); display: flex; align-items: center; gap: 10px; }
.group-head h2::before { content: ''; width: 4px; height: 16px; background: var(--yellow); border-radius: 2px; }
.group-name { width: min(320px, 100%); height: 34px; padding: 0 10px; border: 2px solid var(--zinc-300); border-radius: 8px; background: var(--tile); font-weight: 700; outline: none; }
.group-name:focus { border-color: var(--yellow); }
.group-tools { display: flex; gap: 4px; }

.tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.tiles > .tile, .tiles > .add-tile { width: 180px; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 12px;
  min-height: 164px; padding: 28px 14px 18px; border-radius: var(--radius); background: var(--tile); color: var(--ink);
  text-decoration: none; text-align: center; box-shadow: var(--shadow); border: 1px solid var(--zinc-200);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; outline: none;
}
.tile::after { content: ''; position: absolute; left: 18px; right: 18px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--yellow); transform: scaleX(0); transition: transform .18s ease; }
a.tile:hover, a.tile:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--zinc-300); }
a.tile:hover::after, a.tile:focus-visible::after { transform: scaleX(1); }
a.tile:focus-visible { border-color: var(--yellow); }
.tile-icon { width: 64px; height: 64px; flex: none; display: grid; place-items: center; }
.tile-icon img { width: 64px; height: 64px; object-fit: contain; border-radius: 14px; }
.letter { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; font-size: 24px; font-weight: 800; letter-spacing: .02em; color: #fff; }
.letter.light { color: var(--black); }
.tile-title { font-size: 15px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tile mark { background: var(--yellow-soft); color: inherit; border-radius: 3px; padding: 0 1px; }

/* Editing */
.editing .tile { cursor: grab; }
.editing .tile:hover { border-color: var(--zinc-300); }
.tile.dragging { opacity: .35; }
.tile.drop-before { box-shadow: -4px 0 0 var(--yellow), var(--shadow); }
.tiles.drop-end { outline: 2px dashed var(--yellow); outline-offset: 6px; border-radius: var(--radius); }
.tile-tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.icon-button {
  width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 1px solid var(--zinc-200); border-radius: 8px;
  background: var(--tile); color: var(--zinc-600); cursor: pointer; transition: background .12s, color .12s, border-color .12s;
}
.icon-button:hover, .icon-button:focus-visible { background: var(--yellow); border-color: var(--yellow); color: var(--black); outline: none; }
.icon-button.danger:hover, .icon-button.danger:focus-visible { background: var(--red); border-color: var(--red); color: #fff; }
.add-tile {
  min-height: 164px; border: 2px dashed var(--zinc-300); border-radius: var(--radius); background: transparent; color: var(--zinc-500);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-weight: 700; transition: border-color .15s, color .15s, background .15s;
}
.add-tile:hover, .add-tile:focus-visible { border-color: var(--yellow); color: var(--ink); background: var(--yellow-soft); outline: none; }
.add-group { justify-self: center; }
.empty-group { color: var(--zinc-500); font-size: 14px; margin: 12px 0 0; text-align: center; }
.no-results { padding: 40px 0; text-align: center; color: var(--zinc-500); }

/* Buttons */
.primary-button, .plain-button, .danger-button {
  height: 40px; padding: 0 18px; border-radius: 999px; font-weight: 700; cursor: pointer; border: 2px solid transparent; transition: background .15s, border-color .15s;
}
.primary-button { background: var(--yellow); color: var(--black); }
.primary-button:hover { background: var(--yellow-hover); }
.plain-button { background: transparent; border-color: var(--zinc-300); color: var(--ink); }
.plain-button:hover { border-color: var(--ink); }
.danger-button { background: transparent; border-color: transparent; color: var(--red); padding: 0 8px; }
.danger-button:hover { text-decoration: underline; }
.link-button { padding: 0; border: 0; background: none; color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 14px; }

/* Dialogs */
.dialog { width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 18px; background: var(--tile); color: var(--ink); box-shadow: 0 24px 60px rgba(0, 0, 0, .25); }
.dialog::backdrop { background: rgba(9, 9, 11, .55); backdrop-filter: blur(2px); }
.dialog form { padding: 24px; display: grid; gap: 14px; }
.dialog h2 { margin: 0; font-size: 20px; font-weight: 800; }
.small-dialog { width: min(420px, calc(100vw - 32px)); }
.preview-wrap { display: grid; place-items: center; padding: 18px; background: var(--zinc-100); border-radius: 12px; }
.preview-wrap .tile { width: 160px; pointer-events: none; }
.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; font-size: 13px; font-weight: 700; color: var(--zinc-600); }
.field legend { padding: 0; margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--zinc-500); }
.field input:not([type="radio"]):not([type="file"]) {
  height: 42px; padding: 0 12px; border: 2px solid var(--zinc-300); border-radius: 10px; background: var(--tile); color: var(--ink); font-weight: 400; font-size: 15px; outline: none;
}
.field input:focus { border-color: var(--yellow); }
.segmented { display: flex; gap: 6px; flex-wrap: wrap; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: inline-block; padding: 7px 14px; border: 2px solid var(--zinc-300); border-radius: 999px; font-weight: 700; color: var(--ink); }
.segmented input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--tile); }
.segmented input:focus-visible + span { border-color: var(--yellow); }
.icon-option { margin-top: 10px; font-weight: 400; color: var(--ink); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.swatch[aria-checked="true"] { border-color: var(--tile); box-shadow: 0 0 0 2px var(--ink); }
.dialog-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.spacer { flex: 1; }
.error { margin: 0; padding: 10px 12px; border-radius: 10px; background: #fef2f2; color: #991b1b; font-size: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; padding: 10px 18px; border-radius: 999px;
  background: var(--black); color: #fff; font-weight: 600; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.toast.bad { background: var(--red); }

@media (max-width: 720px) {
  .top-inner { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .brand-name { font-size: 15px; }
  .turck-logo { height: 24px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .top-button { margin-left: auto; height: 36px; padding: 0 14px; }
  .main { padding: 24px 16px 48px; }
  .hero h1 { font-size: 26px; }
  .tiles { gap: 10px; }
  .tiles > .tile, .tiles > .add-tile { width: calc(50% - 5px); }
  .tile { min-height: 132px; padding: 18px 8px 14px; gap: 10px; }
  .tile-icon, .tile-icon img, .letter { width: 52px; height: 52px; }
  .add-tile { min-height: 132px; }
  .editbar-inner { padding: 10px 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }


/* A tile opened in a frame: the bar of the dashboard stays, with the shortcuts in a menu */
body.framed { overflow: hidden; }
body.framed > .top, body.framed > .editbar, body.framed > .main { display: none !important; }
.frame-view { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--page); z-index: 30; }
.frame-bar { flex: none; height: 54px; display: flex; align-items: center; gap: 12px; padding: 0 12px; background: var(--yellow); color: var(--black); box-shadow: 0 1px 0 rgba(9, 9, 11, .15); }
.frame-button {
  height: 36px; min-width: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px;
  border: 2px solid var(--black); border-radius: 999px; background: transparent; color: var(--black); font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer; flex: none;
}
.frame-button:hover, .frame-button:focus-visible { background: rgba(9, 9, 11, .1); outline: none; }
.frame-button.primary { background: var(--black); border-color: var(--black); color: var(--yellow); }
.frame-button.primary:hover, .frame-button.primary:focus-visible { background: #27272a; color: var(--yellow); }
.menu-button { padding: 0; width: 40px; border-radius: 10px; }
.menu-button[aria-expanded="true"] { background: var(--black); color: var(--yellow); }
.frame-brand { display: flex; align-items: center; gap: 12px; color: var(--black); text-decoration: none; min-width: 0; }
.brand-mark.small { width: 30px; height: 30px; border-radius: 7px; flex: none; }
.frame-dashboard-title { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frame-sep { color: rgba(9, 9, 11, .45); }
.frame-title { color: var(--black); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.frame-wrap { position: relative; flex: 1; }
.frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.drawer {
  position: fixed; top: 55px; left: 0; bottom: 0; z-index: 32; width: min(340px, 88vw); overflow-y: auto; padding: 16px 12px 24px;
  background: var(--tile); color: var(--ink); box-shadow: 8px 0 32px rgba(0, 0, 0, .25); display: grid; align-content: start; gap: 4px;
}
.drawer h3 { margin: 14px 10px 6px; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--zinc-500); }
.drawer h3:first-child { margin-top: 0; }
.drawer-link { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.drawer-link:hover, .drawer-link:focus-visible { background: var(--zinc-100); outline: none; }
.drawer-link.current { background: var(--yellow-soft); }
.drawer-link .tile-icon, .drawer-link .tile-icon img, .drawer-link .letter { width: 32px; height: 32px; }
.drawer-link .letter { font-size: 13px; border-radius: 8px; }
.drawer-link .tile-icon img { border-radius: 7px; }
.drawer-home { border-bottom: 1px solid var(--zinc-200); border-radius: 10px 10px 0 0; margin-bottom: 6px; padding-bottom: 12px; }
.drawer-shade { position: fixed; inset: 55px 0 0 0; z-index: 31; background: rgba(9, 9, 11, .35); }
@media (max-width: 720px) {
  .frame-label, .frame-sep, .frame-dashboard-title, .frame-brand .brand-divider { display: none; }
  .turck-logo.small { height: 18px; }
  .frame-button { padding: 0; width: 36px; }
}
.field .hint { font-weight: 400; color: var(--zinc-500); font-size: 12px; margin-top: 6px; }

/* The buttons of a dialog stay in view at the bottom (a long form scrolls above them). */
.dialog { max-height: calc(100vh - 32px); overflow: auto; }
.dialog-actions { position: sticky; bottom: 0; margin: 4px -24px -24px; padding: 14px 24px 24px; background: var(--tile); border-top: 1px solid var(--zinc-200); }
/* Phones, the bar above a frame: the logo keeps its size, the name of the page gets what is left. */
@media (max-width: 720px) {
  .frame-bar { gap: 8px; padding: 0 8px; }
  .frame-brand { flex: none; }
  .frame-title { flex: 1; font-size: 14px; }
  .frame-bar .spacer { display: none; }
}

/* Sign in first (the page of a tile asks for the Microsoft account) */
.signin { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px 16px; background: var(--page); overflow: auto; }
.signin-card { width: min(460px, 100%); padding: 32px 28px; border-radius: 18px; background: var(--tile); border: 1px solid var(--zinc-200); box-shadow: var(--shadow-hover); text-align: center; display: grid; gap: 14px; justify-items: center; }
.signin-logo { height: 26px; width: auto; }
:root[data-theme="dark"] .signin-logo { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .signin-logo { filter: invert(1); } }
.signin-card h2 { margin: 6px 0 0; font-size: 22px; font-weight: 800; }
.signin-card p { margin: 0; color: var(--zinc-600); font-size: 15px; }
.signin-button { height: 46px; padding: 0 22px; display: inline-flex; align-items: center; gap: 10px; font-size: 15px; }
.signin-waiting { padding: 10px 14px; border-radius: 10px; background: var(--yellow-soft); color: var(--ink) !important; }
.signin-alt { font-size: 13px !important; }
.signin-alt a { color: var(--ink); font-weight: 700; }

/* Symbols: the icon in the colour of its group, on a light tint of it */
.symbol { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.symbol.light { color: #18181b; background: color-mix(in srgb, var(--c) 55%, transparent); }
.symbol svg { width: 30px; height: 30px; }
.drawer-link .symbol { width: 32px; height: 32px; border-radius: 8px; }
.drawer-link .symbol svg { width: 18px; height: 18px; }
@media (max-width: 720px) { .tile .symbol { width: 52px; height: 52px; border-radius: 14px; } .tile .symbol svg { width: 26px; height: 26px; } }

/* Choosing a symbol in the tile dialog */
.symbol-option { display: grid; gap: 10px; }
.symbol-search { height: 38px; padding: 0 12px; border: 2px solid var(--zinc-300); border-radius: 10px; background: var(--tile); color: var(--ink); font-size: 14px; font-weight: 400; outline: none; }
.symbol-search:focus { border-color: var(--yellow); }
.symbols { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; max-height: 214px; overflow-y: auto; padding: 2px; }
.symbol-choice { display: grid; justify-items: center; gap: 4px; padding: 8px 4px; border: 2px solid transparent; border-radius: 10px; background: var(--zinc-100); color: var(--ink); cursor: pointer; font-size: 11px; font-weight: 600; line-height: 1.2; }
.symbol-choice svg { width: 22px; height: 22px; }
.symbol-choice:hover, .symbol-choice:focus-visible { border-color: var(--zinc-300); outline: none; }
.symbol-choice[aria-checked="true"] { border-color: var(--ink); background: var(--yellow-soft); }
.symbol-colors { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.group-swatch { width: auto !important; min-width: 32px; padding: 0 8px !important; border-radius: 999px !important; background: var(--zinc-100) !important; color: var(--ink); font-size: 11px; font-weight: 800; }

/* The colour of a group, in the editor */
.color-wrap { position: relative; display: inline-flex; }
.color-dot { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.color-pop { position: absolute; top: 36px; right: 0; z-index: 15; display: flex; flex-wrap: wrap; gap: 6px; width: 228px; padding: 10px; border-radius: 12px; background: var(--tile); border: 1px solid var(--zinc-200); box-shadow: var(--shadow-hover); }

/* The edit button: a pencil */
.top-button.icon-only { width: 42px; padding: 0; display: grid; place-items: center; }
@media (max-width: 720px) { .top-button.icon-only { width: 36px; height: 36px; } }

/* Without the search field the edit button stays on the right */
.top-inner > .top-button { margin-left: auto; }
/* Phones: the logo, the title and the pencil on one line (the search field, when there, under them) */
@media (max-width: 720px) {
  .top-inner > .brand { flex: 1 1 0; min-width: 0; }
  .top-inner > .top-button { flex: none; }
}
