/* Rakmentor-portaali. Paletti sama kuin tarjouskoneessa: Charcoal, Glacier, Stone. */
:root {
  --ink: #1F2329;
  --char: #3B404C;
  --char-2: #555B68;
  --mute: #6B6F78;
  --glacier: #CFE1ED;
  --glacier-2: #E6EFF5;
  --deep: #9DBFD6;
  --stone: #D0CFC4;
  --stone-2: #E2E2DB;
  --band: #ECECE7;
  --paper: #F6F7F6;
  --white: #FFFFFF;
  --blue: #2E75B6;
  --red: #B3261E;
  --radius: 8px;
  --font: "Hanken Grotesk", "Liberation Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { font-family: var(--font); font-size: 15px; color: var(--ink); background: var(--paper); }
body { margin: 0; min-height: 100vh; background: var(--paper); }
h1, h2 { color: var(--char); margin: 0; line-height: 1.2; }
h1 { font-size: 1.9rem; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 .6em; line-height: 1.5; }
.muted { color: var(--mute); }
.small { font-size: .85rem; }
.error { color: var(--red); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

button {
  font: inherit; font-weight: 500; cursor: pointer; border-radius: var(--radius);
  border: 1px solid var(--stone); background: var(--white); color: var(--char); padding: .55rem 1rem;
}
button:hover:not(:disabled) { border-color: var(--char-2); }
button:disabled { opacity: .35; cursor: default; }
button.primary { background: var(--char); border-color: var(--char); color: var(--white); }
button.primary:hover { background: var(--ink); }
button.ghost { background: transparent; }

/* ---------------------------------------------------------------- yläpalkki */
.topbar {
  height: 60px; display: flex; align-items: center; gap: 1.5rem; padding: 0 32px;
  background: var(--band); border-bottom: 1px solid var(--stone-2);
}
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--char); }
.brand img { height: 22px; }
.brand span { font-weight: 600; padding-left: .75rem; border-left: 1px solid var(--stone); }
.user { margin-left: auto; font-size: .9rem; color: var(--char-2); display: flex; gap: .75rem; align-items: center; }
.user button { padding: .35rem .7rem; font-size: .85rem; }
.badge { background: #FFF4D6; color: #7A5A00; border-radius: 99px; padding: .15rem .6rem; font-size: .75rem; font-weight: 600; }

/* ---------------------------------------------------------------- sisältö */
main { max-width: 1120px; margin: 0 auto; padding: 40px 32px 64px; }
.loading { color: var(--mute); }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 28px; flex-wrap: wrap; }
.head p { margin: .35rem 0 0; }
.head-actions { display: flex; gap: .5rem; }
.hint { color: var(--char-2); background: var(--glacier-2); border-radius: var(--radius); padding: .7rem 1rem; margin: -12px 0 20px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.tile {
  display: flex; gap: 16px; align-items: flex-start; padding: 20px; min-height: 128px;
  background: var(--white); border: 1px solid var(--stone-2); border-radius: 10px;
  text-decoration: none; color: inherit; position: relative;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
a.tile:hover { border-color: var(--deep); box-shadow: 0 6px 18px rgba(31, 35, 41, .08); transform: translateY(-1px); }
a.tile:active { transform: none; }
.tile.soon { opacity: .6; }
.tile.editing { border-style: dashed; border-color: var(--stone); padding-bottom: 56px; }
.icon {
  flex: none; width: 48px; height: 48px; border-radius: 12px; background: var(--glacier-2);
  display: grid; place-items: center; color: var(--char);
}
a.tile:hover .icon { background: var(--glacier); }
.icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.txt { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.name { font-weight: 600; font-size: 1.08rem; color: var(--char); }
.desc { color: var(--char-2); font-size: .92rem; line-height: 1.4; }
.host { color: var(--mute); font-size: .78rem; margin-top: .2rem; }
.tools { position: absolute; left: 20px; right: 20px; bottom: 14px; display: flex; gap: .4rem; }
.tools button { padding: .3rem .65rem; font-size: .85rem; }
.tools button:last-child { margin-left: auto; }

.hidden-apps { margin-top: 36px; }
.hidden-apps h2 { margin-bottom: .75rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { border-radius: 99px; padding: .4rem .9rem; font-size: .9rem; }

.empty { background: var(--white); border: 1px solid var(--stone-2); border-radius: 10px; padding: 32px; max-width: 620px; }
.empty h2 { margin-bottom: .5rem; }
.foot { margin-top: 32px; }

/* ---------------------------------------------------------------- kirjautuminen */
.login {
  max-width: 440px; margin: 8vh auto 0; background: var(--white); border: 1px solid var(--stone-2);
  border-radius: 12px; padding: 40px 36px; text-align: center;
}
.login img { height: 30px; margin-bottom: 28px; }
.login h1 { font-size: 1.5rem; margin-bottom: .6rem; }
.login p { margin-bottom: 1.4rem; }
.login button { width: 100%; padding: .75rem 1rem; font-size: 1rem; }

@media (max-width: 640px) {
  .topbar { padding: 0 16px; gap: .75rem; }
  .brand span { display: none; }
  .user > span:not(.badge) { display: none; }
  main { padding: 28px 16px 48px; }
  h1 { font-size: 1.5rem; }
  .grid { grid-template-columns: 1fr; }
  .login { margin-top: 4vh; padding: 32px 20px; }
}
