/* Diet Layout's own layout. Diet DS tokens only; editor chrome follows Figma's conventions. */
html, body { height: 100%; }
.screen { min-height: 100%; }
.brand { font-family: 'Diet Circle standard', var(--ui-font); font-size: 40px; line-height: 1; letter-spacing: -0.005em; }
.brand-s { font-family: 'Diet Circle standard', var(--ui-font); font-size: 20px; line-height: 1; }
.signin { width: 320px; }
a.button { text-decoration: none; }

/* Documents */
.doc-tile .media { aspect-ratio: 4 / 3; background: var(--wash); overflow: hidden; position: relative; }
.doc-tile .media iframe { position: absolute; left: 0; top: 0; border: 0; pointer-events: none; transform-origin: 0 0; background: var(--bg); }
.doc-tile { cursor: pointer; }

/* People */
.person img { width: 32px; height: 32px; border-radius: 50%; }

/* Editor: top bar, two panels, canvas */
.editor { position: fixed; inset: 0; display: grid; grid-template-columns: 240px 1fr 264px; grid-template-rows: 48px 1fr; }
.topbar { grid-column: 1 / -1; background: var(--raised); border-bottom: 1px solid var(--line); }
.panel { background: var(--raised); overflow-y: auto; overflow-x: hidden; min-height: 0; min-width: 0; }
.panel.left { border-right: 1px solid var(--line); }
.panel.right { border-left: 1px solid var(--line); }
.panel-head { border-bottom: 1px solid var(--line); }
.docname { border: 0; background: transparent; color: var(--text); height: var(--control-s); padding: 0 var(--space-8); border-radius: var(--radius-field); min-width: 0; width: 320px; outline: none; }
.docname:hover, .docname:focus { background: var(--wash); }

.iconbtn { width: 32px; height: 32px; border: 0; border-radius: var(--radius-field); background: transparent; color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.iconbtn:hover { background: var(--wash); }
.iconbtn[aria-pressed="true"] { background: var(--wash-strong); }

/* Layers */
.layers { padding: var(--space-4) 0; }
.layer { display: flex; align-items: center; gap: var(--space-4); height: 28px; padding-right: var(--space-8); cursor: default; color: var(--text); white-space: nowrap; overflow: hidden; }
.layer:hover { background: var(--wash); }
.layer[aria-selected="true"] { background: var(--wash-strong); }
.layer .icon { color: var(--text-muted); flex: none; }
.layer .nm { overflow: hidden; text-overflow: ellipsis; }
.layer.isboard { font-weight: 600; }

/* Canvas */
.canvas { position: relative; overflow: hidden; background: var(--surface); cursor: default; }
.canvas.panning, .canvas.space { cursor: grab; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.board { position: absolute; }
.board-name { position: absolute; left: 0; top: -22px; white-space: nowrap; color: var(--text-muted); cursor: default; }
.board iframe { border: 0; display: block; background: transparent; pointer-events: none; }
.overlay { position: absolute; inset: 0; pointer-events: none; }
.sel, .hov { position: absolute; box-shadow: inset 0 0 0 1px var(--select); }
.sel { box-shadow: inset 0 0 0 2px var(--select); }
.sel-tag { position: absolute; transform: translate(-50%, 6px); background: var(--select); color: #FFFFFF; padding: 2px 6px; border-radius: 4px; font: 600 11px/1.2 var(--ui-font); white-space: nowrap; }
.gapmark { position: absolute; background: var(--select-wash); }
:root { --select: #0D99FF; --select-wash: rgba(13, 153, 255, 0.12); }

/* Inspector */
.sec { padding: var(--space-12) var(--space-16); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: var(--space-8); }
.sec-title { font: 600 12px/1 var(--ui-font); letter-spacing: -0.02em; color: var(--text); padding-bottom: var(--space-4); }
.prop { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: var(--space-8); }
.prop > label, .prop > span:first-child { font: 400 12px/1 var(--ui-font); color: var(--text-muted); }
.prop2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8); }
.in { height: 28px; border: 0; border-radius: var(--radius-field); background: var(--wash); color: var(--text); padding: 0 var(--space-8); font: 400 12px/1 var(--ui-font); width: 100%; min-width: 0; outline: none; }
.in:focus { box-shadow: inset 0 0 0 1px var(--select); }
textarea.in { height: auto; min-height: 56px; padding: var(--space-8); line-height: 1.4; resize: vertical; }
.seg { display: flex; min-width: 0; background: var(--wash); border-radius: var(--radius-field); padding: 2px; gap: 2px; }
.seg button { flex: 1 1 0; min-width: 0; overflow: hidden; white-space: nowrap; height: 24px; border: 0; border-radius: calc(var(--radius-field) - 2px); background: transparent; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font: 600 11px/1 var(--ui-font); }
.seg button[aria-pressed="true"] { background: var(--raised); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.seg .icon { font-size: 16px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--accent); color: var(--on-accent); padding: var(--space-12) var(--space-16); border-radius: var(--radius-field); z-index: 10; }
[hidden] { display: none !important; }
button.holder { border: 0; cursor: pointer; }

/* Account menu: a sheet under the avatar */
.account { position: fixed; top: 72px; right: 32px; width: 320px; padding: 0; gap: 0; z-index: 20; }
.account .sep { border-top: 1px solid var(--line); }
.menu-item { display: flex; align-items: center; height: 44px; padding: 0 var(--space-16); border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; cursor: pointer; text-decoration: none; width: 100%; }
.menu-item:hover { background: var(--wash); }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 11px; line-height: 1.4; }
#me { overflow: hidden; padding: 0; }
#me img { display: block; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-8); }
.pair:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.unit { display: flex; align-items: center; gap: var(--space-4); background: var(--wash); border-radius: var(--radius-field); padding-left: var(--space-8); min-width: 0; color: var(--text-muted); font: 400 12px/1 var(--ui-font); }
.unit .in { background-color: transparent; padding-left: var(--space-4); }
.unit .icon { color: var(--text-faint); }
.chip { height: 28px; border: 0; border-radius: var(--radius-field); background: var(--wash); color: var(--text); font: 600 12px/1 var(--ui-font); cursor: pointer; }
.chip:hover { background: var(--wash-strong); }
select.in { appearance: none; -webkit-appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%23888888' d='M12 15.4 6.6 10 8 8.6l4 4 4-4 1.4 1.4z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; cursor: pointer; }

/* Where a layer comes from: Diet DS component (purple, as Figma marks components), changed (purple + dot), part of one (muted purple), custom (grey) */
:root { --component: #9747FF; --component-part: rgba(151, 71, 255, 0.7); }
.layer.component .icon, .layer.component .nm, .layer.changed .icon, .layer.changed .nm { color: var(--component); }
.layer.part .icon { color: var(--component-part); }
.layer .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--component); flex: none; margin-left: auto; }
.layer.lib { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; padding-left: var(--space-16); font: inherit; }
.lib-head { padding: var(--space-12) var(--space-16) var(--space-4); }
.view-toggle { width: 200px; }
#left-tabs button { height: 28px; }
.comp-icon { color: var(--component); }
.swatch-in { padding: 2px; height: 28px; cursor: pointer; }
.sec-title.h { display: flex; }
.dropline { position: absolute; background: var(--select); border-radius: 2px; }
.layer.newboard { color: var(--text-muted); margin-top: var(--space-4); }
.layer.newboard .icon { color: var(--text-muted); }
.canvas.tool-board { cursor: crosshair; }
/* Icon picker */
.iconpick { display: flex; align-items: center; gap: var(--space-8); height: 32px; padding: 0 var(--space-8); border: 0; border-radius: var(--radius-field); background: var(--wash); color: var(--text); cursor: pointer; width: 100%; min-width: 0; font: 400 12px/1 var(--ui-font); text-align: left; }
.iconpick .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconpick .chev { color: var(--text-faint); }
.picker { position: fixed; width: 312px; max-height: 420px; padding: var(--space-12); gap: var(--space-8); z-index: 30; }
.picker-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; overflow: auto; max-height: 340px; }
.pick { aspect-ratio: 1; border: 0; border-radius: var(--radius-field); background: transparent; color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pick:hover { background: var(--wash); }
.pick[aria-pressed="true"] { background: var(--wash-strong); }
/* Measuring (Option) and snapping guides: Figma's red */
:root { --measure: #F24822; }
.measure { position: absolute; background: var(--measure); }
.measure-box { position: absolute; box-shadow: inset 0 0 0 1px var(--measure); }
.measure-tag { position: absolute; transform: translate(-50%, -50%); background: var(--measure); color: #FFFFFF; padding: 1px 4px; border-radius: 3px; font: 600 11px/1.2 var(--ui-font); white-space: nowrap; }
.guide { position: absolute; background: var(--measure); }
